• We've upgraded our forums. Please post any issues/requests in this thread.

GPU-Z Shared Memory Layout

SirReal

New Member
Joined
Jul 5, 2010
Messages
3 (0.00/day)
Likes
1
#26
what happens if 2 or more GPUs are present ?

- the structure posted on the OP provide all the info ?
- the OP is rather old, does the OP structure is still up to date ?
The structure just contains name-value pairs, and so does not limit itself to one GPU.
For more details, I suggest you contact the author of GPU-Z.
 
Joined
Sep 25, 2012
Messages
2 (0.00/day)
Likes
0
#27
how to get free video card memory

Code:
#define SHMEM_NAME _T("GPUZShMem")
#define MAX_RECORDS 128

#pragma pack(push, 1)
struct GPUZ_RECORD 
{
	WCHAR key[256];
	WCHAR value[256];
};

struct GPUZ_SENSOR_RECORD
{
	WCHAR name[256];
	WCHAR unit[8];
	UINT32 digits;
	double value;
};

struct GPUZ_SH_MEM
{
	UINT32 version; 	 // Version number, 1 for the struct here
	volatile LONG busy;	 // Is data being accessed?
	UINT32 lastUpdate; // GetTickCount() of last update
	GPUZ_RECORD data[MAX_RECORDS];
	GPUZ_SENSOR_RECORD sensors[MAX_RECORDS];
};
#pragma pack(pop)
If you use this shared memory in your application please leave a short comment.
Hello!I want to know, How can I get how much video card I have used.
My application use C++ Language. I want to get the Free physical video card, like Gpu-Z.
Do you have suggestion?
 
Joined
Sep 3, 2010
Messages
3,443 (1.29/day)
Likes
1,685
Location
NL, Europe
Processor Intel Core i5-4460
Motherboard Gigabyte GA-Z97-D3H
Cooling Arctic Freezer i11
Memory Crucial Ballistix Sport, DDR3-1600, 2x4 GB kit
Video Card(s) Sapphire Radeon R9 270X Vapor-X
Storage Kingston SSDNow V300 (120GB) + Seagate Barracuda 7200.14 (1TB)
Display(s) AOC G2260VWQ6 | Acer AL1916 (in reserve)
Case Cooler Maste Centurion 5
Audio Device(s) integrated
Power Supply Seasonic G450
Mouse Logitech G500
Keyboard Qpad MK-50
Software Windows 10
#28
Joined
Mar 23, 2012
Messages
675 (0.32/day)
Likes
228
Location
Norway
System Name Games/internet/usage - Server - backup - HTPC
Processor I7 5820k - AMD A8-5600K BE - I7 920 - A8-7600
Motherboard ASUS X99-A2 - Gigabyte GA-F2A85X-UP4 - MSI x58 pro-e - Gigabyte GA-F2A88XN-WIFI
Cooling custom water loop for cpu and gpus - Arctic Cooling Freezer Xtreme r.2 - Noctua NH-U12P SE1366
Memory 16GiB Crucial Ballistix Sport 2666 MHz - 8GiB 1600MHz - 12 GiB corsair thing - 8GB 1866MHz
Video Card(s) 2x Radeon R9 290X CF - HD 7560D - 2x Radeon HD6950 CF - A8 -7600
Storage Samsung XP941 500 GB - 60 GB SSD + 6 x HDD 4 TB in RAID 6 - 4 SSD and 2 HDD - 250 GB SSD
Display(s) Dell 3008WFP - Remote desktop - the Dell when in use - 55" TV screen
Case Caselabs Magnum M8 - Fractal Design Define R4 - Nanoxia DS 1 - Antec ISK 110 VESA
Audio Device(s) Toslink -> Shiit Modi 2 Uber -> Matrix m-stage -> HD650 - none - as main - HDMI out -> 5.1 system
Power Supply beQuiet dark power pro 1200W- corsair RM750x - Corsair AX850 - Antec 90 W pico power
Mouse Roccat tyon - remote desktop - Roccat tyon when in use - Logitech K830
Keyboard Corsair K95 RGB - remote desktop - Corsair K95 RGB when in use - Logitech K830
Software Win 10 Pro - Win server 2012 essentials - Win 7 Pro - Win 10 Pro
Benchmark Scores Not high enough
#30
I am guessing that its not possible to get someone to explain how GPU-z gets the temps, but is it possible for it to start in minimized mode ?.

I am guessing that what SirReal says still holds true, one instance of GPU-z now gives you the temps of all your GPUs
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
17,063 (3.44/day)
Likes
17,967
Processor Core i7-4790K
Memory 16 GB
Video Card(s) GTX 1080
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 7
#31
I am guessing that its not possible to get someone to explain how GPU-z gets the temps, but is it possible for it to start in minimized mode ?.

I am guessing that what SirReal says still holds true, one instance of GPU-z now gives you the temps of all your GPUs
There is not a single way, it depends on the card, OS, driver etc.

GPU-Z has a -minimized command line parameter you can use.
 
Joined
Mar 23, 2012
Messages
675 (0.32/day)
Likes
228
Location
Norway
System Name Games/internet/usage - Server - backup - HTPC
Processor I7 5820k - AMD A8-5600K BE - I7 920 - A8-7600
Motherboard ASUS X99-A2 - Gigabyte GA-F2A85X-UP4 - MSI x58 pro-e - Gigabyte GA-F2A88XN-WIFI
Cooling custom water loop for cpu and gpus - Arctic Cooling Freezer Xtreme r.2 - Noctua NH-U12P SE1366
Memory 16GiB Crucial Ballistix Sport 2666 MHz - 8GiB 1600MHz - 12 GiB corsair thing - 8GB 1866MHz
Video Card(s) 2x Radeon R9 290X CF - HD 7560D - 2x Radeon HD6950 CF - A8 -7600
Storage Samsung XP941 500 GB - 60 GB SSD + 6 x HDD 4 TB in RAID 6 - 4 SSD and 2 HDD - 250 GB SSD
Display(s) Dell 3008WFP - Remote desktop - the Dell when in use - 55" TV screen
Case Caselabs Magnum M8 - Fractal Design Define R4 - Nanoxia DS 1 - Antec ISK 110 VESA
Audio Device(s) Toslink -> Shiit Modi 2 Uber -> Matrix m-stage -> HD650 - none - as main - HDMI out -> 5.1 system
Power Supply beQuiet dark power pro 1200W- corsair RM750x - Corsair AX850 - Antec 90 W pico power
Mouse Roccat tyon - remote desktop - Roccat tyon when in use - Logitech K830
Keyboard Corsair K95 RGB - remote desktop - Corsair K95 RGB when in use - Logitech K830
Software Win 10 Pro - Win server 2012 essentials - Win 7 Pro - Win 10 Pro
Benchmark Scores Not high enough
#32
ok, thank you
 

Ganesh_AT

New Member
Joined
Dec 15, 2013
Messages
4 (0.00/day)
Likes
0
#33
Edit: W1zzard has already answered this in the other thread here: http://www.techpowerup.com/forums/t...-gpu-z-shared-memory-update-frequency.195840/

I am using the shared memory [ currently with a DLL built with the code here: https://github.com/JohnnyUT/GpuzShMem , but have a newer version coming up with that dependency removed, and using some code modified from here: http://www.techpowerup.com/forums/threads/gpu-z-shared-memory-class-in-c.164244/#post-2605403 ] in my freeware project 'Remote Sensor Monitor'.

Details about the project can be found here:

http://www.hwinfo.com/forum/Thread-Introducing-Remote-Sensor-Monitor-A-RESTful-Web-Server

I am posting in this thread with reference to some 'discrepancies' I observed in the shared memory update frequency. I was assuming it could be polled every second. I have a Perl script running on a client machine accessing the GPU-Z shared memory values over HTTP based on this polling interval. A sample debug output of that script is below. The values in the CSV file lines are: 'lastUpdateTime' from GPU-Z shared memory converted to 'seconds' from 'milliseconds', GPU load and GPU power consumption. The line next to it has parameters from the client machine: Elapsed refers to the amount of time in seconds between the time the request to the shared memory was sent over the network to the time it took for the data to come back (this includes network delays etc.). Usually, it is between 10ms to 250ms, skewed towards lower delays. The SleepInterval number corresponds to the time after which the next request to the shared memory is placed on the network.

Code:
Enqueueing to CSV File : , 331202, 0.002799, 0.046480
Elapsed: 0.022736, SleepInterval: 0.977264
Enqueueing to CSV File : , 331202, 0.002799, 0.046480
Elapsed: 0.015493, SleepInterval: 0.984507
Enqueueing to CSV File : , 331204, 0.001460, 0.047216
Elapsed: 0.025459, SleepInterval: 0.974541
Enqueueing to CSV File : , 331204, 0.001460, 0.047216
Elapsed: 0.010567, SleepInterval: 0.989433
Enqueueing to CSV File : , 331207, 0.000000, 0.000000
Elapsed: 0.01458, SleepInterval: 0.98542
Enqueueing to CSV File : , 331207, 0.000000, 0.000000
Elapsed: 0.056981, SleepInterval: 0.943019
Enqueueing to CSV File : , 331207, 0.000000, 0.000000
Elapsed: 0.097846, SleepInterval: 0.902154
Enqueueing to CSV File : , 331209, 0.001490, 0.046605
Elapsed: 0.104709, SleepInterval: 0.895291
Enqueueing to CSV File : , 331209, 0.001490, 0.046605
Elapsed: 0.019662, SleepInterval: 0.980338
Enqueueing to CSV File : , 331212, 0.000000, 0.000000
Elapsed: 0.016406, SleepInterval: 0.983594
Enqueueing to CSV File : , 331212, 0.000000, 0.000000
Elapsed: 0.018795, SleepInterval: 0.981205
Enqueueing to CSV File : , 331212, 0.000000, 0.000000
Elapsed: 0.018195, SleepInterval: 0.981805
Enqueueing to CSV File : , 331214, 0.000000, 0.000000
Elapsed: 0.019669, SleepInterval: 0.980331
Enqueueing to CSV File : , 331214, 0.000000, 0.000000
Elapsed: 0.019537, SleepInterval: 0.980463
Enqueueing to CSV File : , 331217, 0.000000, 0.000000
Elapsed: 0.027269, SleepInterval: 0.972731
Enqueueing to CSV File : , 331217, 0.000000, 0.000000
Elapsed: 0.020597, SleepInterval: 0.979403
Enqueueing to CSV File : , 331217, 0.000000, 0.000000
Elapsed: 0.019204, SleepInterval: 0.980796
Enqueueing to CSV File : , 331219, 0.000000, 0.000000
Elapsed: 0.224437, SleepInterval: 0.775563
Enqueueing to CSV File : , 331219, 0.000000, 0.000000
Elapsed: 0.022575, SleepInterval: 0.977425
Enqueueing to CSV File : , 331222, 0.000000, 0.000000
Elapsed: 0.022621, SleepInterval: 0.977379
Enqueueing to CSV File : , 331222, 0.000000, 0.000000

I would expect the update time provided by GPU-Z in the shared memory to closely follow 1 second skips, but I see the parameters being repeated multiple times and the update time skipping by 2 or 3 seconds. I am wondering why I am unable to access updated values on a more frequent basis. I did face a similar issue (though not this much skew) with HWiNFO, which I solved by setting the scan interval to 900ms in the HWiNFO software. Any similar feature (or, any way to ensure I can read GPU-Z shared memory updated values every second) would be awesome to have.
 
Last edited:

eFMer

New Member
Joined
Dec 28, 2013
Messages
1 (0.00/day)
Likes
0
#34
Is the shared memory on the first page still valid.

I'm added GPUZ to TThrottle http://www.efmer.eu/boinc/

GPUZ_RECORD data[MAX_RECORDS]; seem to align properly.

The following record GPUZ_SENSOR_RECORD sensors[MAX_RECORDS];

Starts at address xxxx 10 according to the debugger.
name 0x0000000002270010 "U Core Clock" wchar_t [256]

But it's actually starting at 0x000000000227000B

I can move the pointer 4 bytes back, but I like to know why. The only thing I can think of is that the data structure is somehow different, but that doesn't explain why the date is aligned as it should.

Code:
#define MAX_RECORDS 128

typedef struct GPUZ_RECORD
{
    WCHAR key[256];
    WCHAR value[256];
}GPUZ_RECORD;

typedef struct GPUZ_SENSOR_RECORD
{
    WCHAR name[256];
    WCHAR unit[8];
    UINT32 digits;
    double value;
}GPUZ_SENSOR_RECORD;

typedef struct GPUZ_SH_MEM
{
    UINT32 version;            // Version number, 1 for the struct here
    volatile LONG busy;        // Is data being accessed?
    UINT32 lastUpdate;        // GetTickCount() of last update
    GPUZ_RECORD data[MAX_RECORDS];
    GPUZ_SENSOR_RECORD sensors[MAX_RECORDS];
}GPUZ_SH_MEM, *LPGPUZ_SH_MEM;
It seems the alignment fails on the double value;

I changed it to BYTE bValue[8];
That holds the 64 bit double.

Code:
    double dValue;
    memcpy(&dValue, lpMem->sensors[2].bValue, sizeof dValue);
This generates the right double, a bit awkward, but Visual studio aligns the whole block when using a double.
 
Last edited: