It is currently November 13th, 2018, 3:37 am

[SOLVED] Available VRAM From SIV Plugin

Help with creating, editing & fixing problems with skins
User avatar
StArL0rd84
Posts: 268
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

[SOLVED] Available VRAM From SIV Plugin

StArL0rd84 » November 21st, 2017, 9:31 pm

Hi, i am experimenting with the plugin for SIV system monitoring software.
Things are going well and i can monitor the VRAM currently in use by my video card.
But for the bar meter i wan't to make, i need a max value.
My GPU has 8 gigs available, and SIV can detect this.
BUT, the way the plugin see's it, is in a long line which i suspect is a string and not a number value.
vram.png
1. Current = The current value [Default]
2. Average = The average value
3. Minimum = The minimum value
4. Maximum = The maximum value
5. String = Can use this when the measure is a pure string such as NodeName, Username etc...For numerical measures it gives you a comma separated string of the four values (Cur,Avg,Min,Max) as provided by SIV to my plugin. It can be used to see what SIV provides as raw input in case of problem or if you want to decode it yourself in Rainmeter in case of new measure format provided by SIV.

No option to just grab the available VRAM :(

The measure looks like this:

Code: Select all

[mgpuvram]
 Measure=Plugin
 Plugin=SIV
 SivKey=GPU-0-B
 Sensor=L
 SivType=String
string.png
I wonder if i could use RegExpSubstitute to extract the number eight from that line and discard everything else.
But then, would i even be able to use that number in a calc measure? Is it a sting, and not a real number?
Looked over the documentation for RegExpSubstitute, but it is just beyond my skills at this time.

https://forum.rainmeter.net/viewtopic.php?f=18&t=25097
Sadly the author is not active on his thread, so i thought i would give it a shot and ask here...
You do not have the required permissions to view the files attached to this post.
Last edited by StArL0rd84 on November 22nd, 2017, 4:10 pm, edited 1 time in total.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3008
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Available VRAM From SIV Plugin

eclectic-tech » November 22nd, 2017, 2:43 am

Try these 2 lines in the [mgpuvram] section:

Code: Select all

 RegExpSubstitute=1
 Substitute="^.*,(.*)\.(.*)$":"\1"
This will return the string "8". Then to convert the string to a number, simply put it in a Calc measure:

Code: Select all

[GPUNumber]
Measure=Calc
Formula=[mgpuvram]
The calc measure always returns the number value; the number value of the string measure [mgpuvram] is 8. [GPUNumber] measure's value is a number and can be used in other calculations.

Hope this helps.
User avatar
StArL0rd84
Posts: 268
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: Available VRAM From SIV Plugin

StArL0rd84 » November 22nd, 2017, 4:09 pm

eclectic-tech wrote:Try these 2 lines in the [mgpuvram] section:

Code: Select all

 RegExpSubstitute=1
 Substitute="^.*,(.*)\.(.*)$":"\1"
This will return the string "8". Then to convert the string to a number, simply put it in a Calc measure:

Code: Select all

[GPUNumber]
Measure=Calc
Formula=[mgpuvram]
The calc measure always returns the number value; the number value of the string measure [mgpuvram] is 8. [GPUNumber] measure's value is a number and can be used in other calculations.

Hope this helps.
Thank you eclectic-tech, that worked. :thumbup:
Cant wait till i learn RegExpSubstitute, awesome tool.
And it's good to know i can treat string numbers in a calc measure.