It is currently May 3rd, 2024, 5:40 pm

GPU-Z plugin?

Share and get help with Plugins and Addons
TheFlyingFish
Posts: 10
Joined: November 11th, 2012, 7:38 am

GPU-Z plugin?

Post by TheFlyingFish »

Does anyone know if there's a plugin that will pull data from the GPU-Z program and feed it to a Rainmeter skin? GPU-Z provides more detailed GPU sensor info than any other program I've seen out there, so it would be great if there were such a thing. Even better if it were capable of monitoring both my integrated and discrete GPUs. Then I would be very very happy. :)
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: GPU-Z plugin?

Post by Kaelri »

The author claims "it's so simple to use, you don't need documentation," so I doubt it will get a real API anytime soon. However, it looks like you can get at least some of the sensor data using the "Log to file" option. A sampling of the log contents on my system:

Code: Select all

        Date        , GPU Core Clock [MHz] , GPU Memory Clock [MHz] , GPU Temperature [°C] , Fan Speed (%) [%] , Fan Speed (RPM) [RPM] , GPU Load [%] , GPU Temp. #1 [°C] , Memory Usage (Dedicated) [MB] , Memory Usage (Dynamic) [MB] , VDDC [V] ,

2012-11-11 10:33:38 ,              157.0   ,                200.0   ,               54.0   ,              30   ,                   -   ,          0   ,            54.0   ,                          79   ,                        36   ,  0.900   ,

2012-11-11 10:33:39 ,              157.0   ,                200.0   ,               54.0   ,              30   ,                   -   ,          1   ,            54.0   ,                          78   ,                        36   ,  0.900   ,

2012-11-11 10:33:40 ,              157.0   ,                200.0   ,               54.0   ,              30   ,                   -   ,          1   ,            54.0   ,                          78   ,                        36   ,  0.900   ,
Here's a simple skin that will read the log file and show the values for the last recorded entry.
You do not have the required permissions to view the files attached to this post.
TheFlyingFish
Posts: 10
Joined: November 11th, 2012, 7:38 am

Re: GPU-Z plugin?

Post by TheFlyingFish »

Thanks a ton! I'll mess around with that and see if I can get it to do what I want.

It appears to only log to one GPU at a time (whichever one I was looking at when I told it to start logging), so I think I'll use the MSI Afterburner plugin to monitor my discrete GPU and GPU-Z to monitor my integrated one. MSI wouldn't detect the integrated GPU, which is why I didn't want to use it before. I don't particularly like having both MSI and GPU-Z running, but it won't kill me.

Also, is there a way to just grab some of the keys that Lua script provides? For instance, if I want to split out just the GPU usage without all the other data, how would I do that?
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: GPU-Z plugin?

Post by Kaelri »

TheFlyingFish wrote:Also, is there a way to just grab some of the keys that Lua script provides? For instance, if I want to split out just the GPU usage without all the other data, how would I do that?
I set up the script to make that pretty easy. The row values are saved in a table called "Main", which is sorted first by row, then by column. In the example above, Main[1][1] would give you the date of the first entry; Main[1][2] would give you the first clock speed; Main[2][1] would be the date of the second row; etc. Using #Main as the index number will provide the most recent log entry.

The column labels are stored in a table called "Keys". So in the above example, Keys[1] is "Date", Keys[2] is "GPU Core Clock [MHz]", Keys[3] is "GPU Memory Clock [MHz]", etc. I chose not to assign them names in the code just in case GPU-Z provides different values for different cards.

To your specific example (the latest recorded GPU usage), this...

Code: Select all

SKIN:Bang('!SetOption', 'MeterName',   'Text', Keys[7]..': '..Main[#Main][7])
...would change the displayed text of "MeterName" to:

Code: Select all

GPU Load [%]: 1
There are a number of other ways to get the value from Lua into the skin. You can use !SetVariable to assign the value to a dynamic variable, or return the value to use it as the string value of the script measure.

I realize I'm packing a whole lot of vocabulary into this explanation, so please don't hesitate to ask questions.
TheFlyingFish
Posts: 10
Joined: November 11th, 2012, 7:38 am

Re: GPU-Z plugin?

Post by TheFlyingFish »

I think I'm getting you. So if I add these lines to my code:

Code: Select all

	SKIN.Bang('!SetOption', 'Date',                    'Text', Main[#Main][1])
	SKIN.Bang('!SetOption', 'GPUCoreClock',            'Text', Main[#Main][2])
	SKIN.Bang('!SetOption', 'GPUMemClock',             'Text', Main[#Main][3])
	SKIN.Bang('!SetOption', 'GPUTemp',                 'Text', Main[#Main][4])
	SKIN.Bang('!SetOption', 'GPUPower',                'Text', Main[#Main][5])
	SKIN.Bang('!SetOption', 'GPULoad',                 'Text', Main[#Main][6])
	SKIN.Bang('!SetOption', 'GPUDedicatedMemUsage',    'Text', Main[#Main][7])
	SKIN.Bang('!SetOption', 'GPUDynamicMemUsage',      'Text', Main[#Main][8])
That should give me a set of value meters I can call on in the Rainmeter script whenever I like, right?

EDIT: And of course I spend half an hour messing around and trying to figure out why my skin wouldn't update before I realize that SKIN.BANG actually needs to be SKIN:BANG. :oops:

I'm using the values from my integraded HD4000 graphics, by the way, that's why there are no fan speeds and stuff like that.

Interestingly, when I switch the GPU that GPU-Z is looking at, it enters a new set of headers in the log file, because the new GPU has a different series of values. So, if I start logging while looking at my HD4000, then switch to my Geforce GT 650M after a few seconds, then switch back to my HD4000, the logfile looks like this:

Code: Select all

       Date        , GPU Core Clock [MHz] , GPU Memory Clock [MHz] , GPU Temperature [°C] , GPU Power [W] , GPU Load [%] , Memory Usage (Dedicated) [MB] , Memory Usage (Dynamic) [MB] ,

2012-11-11 21:45:52 ,              350.0   ,                800.0   ,               45.0   ,         0.0   ,          0   ,                           0   ,                        60   ,

2012-11-11 21:45:53 ,              350.0   ,                800.0   ,               43.0   ,         0.0   ,          1   ,                           0   ,                        60   ,

2012-11-11 21:45:54 ,              350.0   ,                800.0   ,               43.0   ,         0.0   ,          1   ,                           0   ,                        60   ,

2012-11-11 21:45:55 ,              350.0   ,                800.0   ,               44.0   ,         0.0   ,          2   ,                           0   ,                        60   ,

2012-11-11 21:45:56 ,              350.0   ,                800.0   ,               43.0   ,         0.0   ,          0   ,                           0   ,                        60   ,

2012-11-11 21:45:57 ,              350.0   ,                800.0   ,               43.0   ,         0.0   ,          0   ,                           0   ,                        60   ,

2012-11-11 21:45:58 ,              350.0   ,                800.0   ,               44.0   ,         0.0   ,          1   ,                           0   ,                        60   ,

2012-11-11 21:45:59 ,              350.0   ,                800.0   ,               44.0   ,         0.0   ,          1   ,                           0   ,                        60   ,

        Date        , GPU Core Clock [MHz] , GPU Memory Clock [MHz] , GPU Temperature [°C] , GPU Load [%] , Memory Controller Load [%] , Video Engine Load [%] , Memory Usage (Dedicated) [MB] , Memory Usage (Dynamic) [MB] , VDDC [V] ,

2012-11-11 21:46:00 ,              405.0   ,               1000.3   ,               34.0   ,          1   ,                        0   ,                   0   ,                           0   ,                         0   , 0.9250   ,

2012-11-11 21:46:00 ,              405.0   ,               1000.3   ,               34.0   ,          1   ,                        0   ,                   0   ,                           0   ,                         0   , 0.9250   ,

2012-11-11 21:46:01 ,              405.0   ,               1000.3   ,               34.0   ,          0   ,                        0   ,                   0   ,                           0   ,                         0   , 0.9250   ,

2012-11-11 21:46:02 ,              405.0   ,               1000.3   ,               34.0   ,          0   ,                        0   ,                   0   ,                           0   ,                         0   , 0.9250   ,

2012-11-11 21:46:03 ,              405.0   ,               1000.3   ,               35.0   ,          0   ,                        0   ,                   0   ,                           0   ,                         0   , 0.9250   ,

2012-11-11 21:46:04 ,              405.0   ,               1000.3   ,               35.0   ,          0   ,                        0   ,                   0   ,                           0   ,                         0   , 0.9250   ,

2012-11-11 21:46:05 ,              405.0   ,               1000.3   ,               35.0   ,          0   ,                        0   ,                   0   ,                           0   ,                         0   , 0.9250   ,

2012-11-11 21:46:06 ,              405.0   ,               1000.3   ,               35.0   ,          0   ,                        0   ,                   0   ,                           0   ,                         0   , 0.9250   ,

2012-11-11 21:46:07 ,              405.0   ,               1000.3   ,               35.0   ,          0   ,                        0   ,                   0   ,                           0   ,                         0   , 0.9250   ,

2012-11-11 21:46:08 ,              405.0   ,               1000.3   ,               35.0   ,          0   ,                        0   ,                   0   ,                           0   ,                         0   , 0.9250   ,

        Date        , GPU Core Clock [MHz] , GPU Memory Clock [MHz] , GPU Temperature [°C] , GPU Power [W] , GPU Load [%] , Memory Usage (Dedicated) [MB] , Memory Usage (Dynamic) [MB] ,

2012-11-11 21:46:09 ,              350.0   ,                800.0   ,               46.0   ,         0.0   ,          1   ,                           0   ,                        54   ,

2012-11-11 21:46:09 ,              350.0   ,                800.0   ,               47.0   ,         1.0   ,         23   ,                           0   ,                        54   ,

2012-11-11 21:46:10 ,              350.0   ,                800.0   ,               45.0   ,         0.0   ,          2   ,                           0   ,                        54   ,

2012-11-11 21:46:11 ,              350.0   ,                800.0   ,               45.0   ,         0.0   ,          0   ,                           0   ,                        54   ,

2012-11-11 21:46:12 ,              350.0   ,                800.0   ,               45.0   ,         0.0   ,          0   ,                           0   ,                        54   ,
The Lua script, however, only reads the initial set of headers. If I start the logfile while looking at the 650M then load the skin in Rainmeter and switch GPU-Z so it's looking at the HD4000, the meter values will change, but the keys themselves won't. So I'll end up with the meter that says "Memory Controller Load" actually giving the GPU load, and things like that.

That shouldn't be a problem, though, since I'm only planning on using this script to monitor one of my GPUs, and using MSI for the other.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: GPU-Z plugin?

Post by Kaelri »

Do you think you could attach an example log that shows what happens before, during and after the switch? (I only have one GPU, so I can't test myself.)
TheFlyingFish
Posts: 10
Joined: November 11th, 2012, 7:38 am

Re: GPU-Z plugin?

Post by TheFlyingFish »

Ok, I started out looking at the HD4000, switched to the 650M after about 5 seconds, then switched back after another 5.

EDIT: Didn't take. Apparently the extension .txt is not allowed, for some strange reason. I'll post it again, once I get the extension changed to something else. (I'm on a school computer right now that won't let me.)

In the meantime, I'm having a little trouble with making the script do exactly what I want. I can make a string that gives me the value for one of the table keys (i.e. GPULoad), but I can't do much else with it. For instance, I'm unable to make it percentual and make a line graph or histogram for it. Can I set up a measure that measures the string pulled from the Lua script in a more normal way, which I can then use for meters?

RE-EDIT: Realized I could just use sendspace. http://www.sendspace.com/file/obkzmj