It is currently November 30th, 2020, 10:42 pm

Get total VRAM value

Tips and Tricks from the Rainmeter Community
User avatar
StArL0rd84
Posts: 358
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Get total VRAM value

Post by StArL0rd84 »

Back in 2017 i needed to know the total video memory available for a monitoring skin.
Proved to be impossible with a wmic command becasue the Windows utilities have not been updated to 64-bit so can't show more than 4GB.

But i have recently learned that there's a Registry key that contains the value called HardwareInformation.qwMemorySize.
Inside the key there's other goodies too like GPU name and such.

Code: Select all

[mVramTotal1]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000
RegValue=HardwareInformation.qwMemorySize
UpdateDivider=-1
[mVramTotal2]
Measure=Calc
Formula=mVramTotal1/1073741824
UpdateDivider=-1

[mVRAMUsed1]
Measure=Plugin
Plugin=UsageMonitor
Alias=VRAM
Index=0
MinValue=0
MaxValue=(#VRAM#*1073741824)
[mVRAMUsed2]
Measure=Calc
Formula=mVRAMUsed1

[mVramFree]
Measure=Calc
Formula=(mVramTotal2-(mVRAMUsed2/1073741824))
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
SilverAzide
Posts: 1017
Joined: March 23rd, 2015, 5:26 pm

Re: Get total VRAM value

Post by SilverAzide »

Nice find! What make of video card are you using? Wondering if there is a difference between AMD and nVidia. I'm using an nVidia GPU and my registry matches yours exactly.
Gadgets Wiki GitHub More Gadgets...
User avatar
StArL0rd84
Posts: 358
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: Get total VRAM value

Post by StArL0rd84 »

I have a GTX 1080 8GB
*cries in 60fps* :-(

But yeah, would be nice to test on an AMD card.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))