• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

exe to read GPU-Z shared memory data?

Joined
Apr 12, 2012
Messages
9 (0.00/day)
(The original thread on this matter seems to have been locked, so I'm making a new one here.)


I would love to see someone make a command-line exe that will let you output GPU-Z data values into a shell window :D

I want to implement data from GPU-Z into MRTG graphs.


If you dont know MRTG... it will read data from SNMP, WMI or other sources, and create graphs.

MRTG requires 4 lines of data when sending values to it's script. (Info here, scroll down to 'External Monitoring Scripts')

Code:
number value 1
number value 2
system uptime (in human readable form)
system name
The two first lines is what's interesting. The two last lines are easy to create using windows shell commands. But for the sake of userfriendlyness, you could also let the exe generate the two last lines.

For example, you use various command line argument to select what graphics card you want to pull data from, and then you select what data will be used for value 1 and value 2
Code:
readgpu-z.exe /gpu:1 /sensor1:temp /sensor2:rpmpercent
would give you this result
Code:
85.0
41
1 day 4 hours 33 minutes 25 seconds
WorkStation03

It's very important there is only outputted raw numeric values on the two first lines, with . used for decimal point (not comma)

To create an exe that could be used for many other applications (and not only MRTG) perhaps just make it output a single value, and not pre-formatted for MRTG?

There already exists a similar command line exe for SpeedFan, and it would be so neat to have one for GPU-Z as well.
See my example graphs here...
Server: http://demux.net/mrtg/deckard/summary.html
Workstation: http://demux.net/mrtg/tyrell/summary.html



EDIT: GPU-Z would need an option for starting minimized (sys tray) so you can put GPU-Z in the startup folder.
 
Last edited:

JohnnyUT

New Member
Joined
Jul 14, 2008
Messages
7 (0.00/day)
Hi, I could write this for you. However, as far as I know, there is no possibility to select the GPU. An .exe file could just access the data that GPU-Z is currently displaying, which is the data of the currently selected GPU in GPU-Z. ;)

@EDIT: Try to set "execution" to "minimized" in the "properties" of GPU-Z's link in the startup folder. This might work.
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
27,029 (3.71/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
gpuz has a -card parameter that selects the card on startup.

e.g.
Code:
gpu-z.exe -card 1
the first card is 1, the second card is 2, and so on

for minimized, this should work:
 
Joined
Apr 12, 2012
Messages
9 (0.00/day)
Hi, I could write this for you. However, as far as I know, there is no possibility to select the GPU. An .exe file could just access the data that GPU-Z is currently displaying, which is the data of the currently selected GPU in GPU-Z. ;)

@EDIT: Try to set "execution" to "minimized" in the "properties" of GPU-Z's link in the startup folder. This might work.

I didnt even take into consideration using start with the minimized argument as I figured it would simply minimize to the task bar, but I see that GPU-Z is actually minimized to the sys tray :)

So the contents of the shared memory depends on what gpu is active in the GUI hmmm
Maybe the developer could implement a feature that allows several GPUs to be active?

Or maybe this solution....
I've noticed you can have more than one instance of GPU-Z.
What happens if you have two instances of GPU-Z...? Would this program that reads the shared memory know the differences between these two instances if they have different process names (i.e. renamed the GPU-Z exe)? Maybe have a command line argument for the readgpu-z program so you can select the correct instance. (i.e. /instance:gpu-z-2.exe)

Does shared memory contain all the data being read from the gpu, or only the current tab?

I would be very grateful for help with this.
Also, I'm quite sure your program would be quite popular among MRTG Windows users :)
 

JohnnyUT

New Member
Joined
Jul 14, 2008
Messages
7 (0.00/day)
As far as I can tell, there's only one shared memory "slot" and only data of one GPU fits into this slot at the same time. At least it has been like this 4 years ago. At this time I had 2 GPUs myself and I "fixed" this issue by running 2 GPU-Z instances at the same time and by periodically reading the data from the shared memory. It was totally random, which core's data was in the shared memory when I read it. However, since one GPU core had 900 Mhz and the other had 901 Mhz, I managed to distinguish the read data by this single difference.

I don't know if there is some special data value in GPU-Z's shared memory that uniquely identifies the GPU or core. Maybe W1zzard can tell us. If there was such a value, I could build some workaround that would work as follows:

-) Program A periodically reads from the shared memory and stores the data with the clearly identified GPU/core. This program has to run in the background.
-) Now you can call program B with a parameter indicating which GPU's value you want to output. This program gets the latest value from program A and produces the output that you want.

In the mean time, I've created the tool you asked for without multi GPU support. You can download it here:

http://www.file-upload.net/download-4267232/readgpuz.zip.html

You have to put both, the .exe and the .dll file into the same folder, otherwise it won't work. If you encounter problems, you might be missing the required .NET Framework Runtime 4, which you can download for free here:

http://www.microsoft.com/download/en/details.aspx?id=17718

Feel free to ask if anything isn't working as intended. ;)
 
Last edited:
Joined
Apr 12, 2012
Messages
9 (0.00/day)
Holy cow, JohhnyUT, that was fast :D
Superthanks!

I'm doing some testing now, poking and probing your readgpuz.exe in a shell to see what comes out of it. And so far it's looking perfect :D

A minor cosmetic thing... I see you're truncating some of the values rather than doing a proper rounding.
For example VDCC 0,8750 becomes 0.87 in the output.
To be honest, dont be afraid of showing the whole value with all it's decimals.

Ok, for this thing to run you must have the whole .NET Framework Runtime 4 to be installed? I havent got a system here without this installed, so I'm not to able to test to see if it works without it.
(I'm working on a comprehensive FAQ/HOWTO on running MRTG on Windows, and this is useful information to put there.)
 

JohnnyUT

New Member
Joined
Jul 14, 2008
Messages
7 (0.00/day)
Yeah, i truncated the output to 2 digits after the comma for simplicity, but i can adjust it to show all digits, if you like.

Yes, .NET Framework Runtime 4 is absolutely necessary, as the tool is programmed in C# for this specific version. However, as no special .NET 4 and 3 features are required, I could also drop the requirement to .NET 2, if requested. But it shouldn't be such a big deal, as .NET 4 is quite widespread. ;)
 
Joined
Apr 12, 2012
Messages
9 (0.00/day)
Runnnig readgpuz.exe without any arguments is done in a jiffy - but it takes quite a long time for the program to do it's job when you use arguments. Maybe a whole second or so. When grabbing a bunch of GPU-Z values sequentially in a bat file it takes a while to finish (and it it might create some timing issues when I'm running this script on a remote remotely system.)
Why does it take less time for it to output all the values in the summary compared to only outputting two values?


EDIT: ok thanks for the .NET info, much appreciated :)
 

JohnnyUT

New Member
Joined
Jul 14, 2008
Messages
7 (0.00/day)
You are right, this is strange. I did some tests and the reason for the delay is the request for the system uptime. I managed to make the request faster, so now the delay should be gone. I changed the download link in the post above. ;)
 
Joined
Apr 12, 2012
Messages
9 (0.00/day)
Yeah the delay is gone :)
I'm currently using your program on my system... gonna play some rounds of BF3 to get some pretty graphs.
I'll post some graphs in a little while to show what the results are.

A small note on using the minimze argument on GPU-Z... it only minimizes to the task bar, and not straight to the sys tray, like suspected.
 
Joined
Apr 12, 2012
Messages
9 (0.00/day)
Ok, here are some graphs.

http://demux.net/mrtg/tyrell/summary_gpu.html

Data is collected every 5 mins, and graphs are generated and updated automatically.
At the time of writing this, the script has only been running for two hours while playing some BF3 (without vertical sync to push the GPU a little harder than usual) and doing some websurfing, so there's not much stuff there.
This workstation is turned off at night - and while the system is off, the server automatically stops collecting data - that's why there are 'gaps' with zero values in the graphs.
('GPU Temp' data is provided by SpeedFan)

EDIT: Another page showing more stats from my workstation: http://demux.net/mrtg/tyrell/summary.html
 
Last edited:
Top