Note that there are some explanatory texts on larger screens.

plurals
  1. POreading GPU-Z shared memory
    primarykey
    data
    text
    <p>i'm trying to read information from <a href="http://www.techpowerup.com/gpuz/" rel="nofollow">GPU-Z</a> shared memory, but i'm doing something wrong. I've managed to translate the shared memory structure posted on <a href="http://www.techpowerup.com/forums/showthread.php?t=65258" rel="nofollow">TechPowerUp</a> forums. I can read all the <code>GPUZ_RECORD</code> but not the <code>GPUZ_SENSOR_RECORD</code>. Any help will be apreciated. Thank you!</p> <p><strong>LATER EDIT I:</strong></p> <p>if i use <code>packet record</code> instead i don`t get the AV anymore, but i still can't get the sensors info.</p> <p><strong>LATER EDIT II:</strong></p> <p>If i read the <code>data</code> from 0 to 128 (129 elements), then the 128 element is the first sensor and i can see the data correctly. :( </p> <pre><code>const MAX_RECORDS = 128; GPUZ_RECORD = record key: array[0..255] of WChar; value: array[0..255] of WChar; end; GPUZ_SENSOR_RECORD = record name: array[0..255] of WChar; units: array[0..7] of WChar; digits: Cardinal; value: double; end; GPUZ_SH_MEM = record version : Cardinal; busy: Boolean; lastUpdate: Cardinal; data: array [0..MAX_RECORDS] of GPUZ_RECORD; sensors: array [0..MAX_RECORDS] of GPUZ_SENSOR_RECORD; end; PGPUZ_SH_MEM = ^GPUZ_SH_MEM; </code></pre> <p>//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p> <pre><code>procedure TMainForm.readSensors; var hMapFile: Thandle; sKey, sVal: string; GPUInfo: PGPUZ_SH_MEM; s, d: integer; begin hMapFile := OpenFileMapping(FILE_MAP_READ, FALSE, 'GPUZShMem'); if hMapFile &lt;&gt; 0 then begin log(['Mapping succesfully']);; GPUInfo := MapViewOfFile(hMapFile, FILE_MAP_READ, 0, 0, 0); // ShowMessage(IntToStr(GetLastError)); if GPUInfo &lt;&gt; nil then begin log([ GPUInfo^.version ]); log([ GPUInfo^.busy ]); log([ GPUInfo^.lastUpdate ]); log(['LOGING DATA ~~~~~~~~~~~~~~~~~~~~~~']); for d:= 0 to Pred(MAX_RECORDS) do begin sKey := GPUInfo^.data[d].key; sVal := GPUInfo^.data[d].value; if sKey &lt;&gt; '' then log([d, '#: ', sKey, sVal ]); end; log(['LOGING SENSORS ~~~~~~~~~~~~~~~~~~~~']); for s:= 0 to Pred(MAX_RECORDS) do begin sKey := GPUInfo^.sensors[s].name; // i get an AV here when s:=127 log([ 'Sensor ', s, '#: ', sKey ]); // sVal := TPN^.sensors[s].units; // log([ 'Unit: ', sVal ]); // log(['Digits: ', TPN^.sensors[s].digits ]); // log(['Value: ', TPN^.sensors[s].value ]); end; end else log([ 'Could not map that zone!' ]); end else begin log(['Could not find the zone for mapping...']); UnmapViewOfFile(GPUInfo); CloseHandle(hMapFile); end; end; </code></pre> <p>log() is a small procedure defined like this:</p> <pre><code>procedure log( vData: array of Variant ); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload