Page 1 of 1

Get total VRAM value

Posted: June 16th, 2020, 4:05 pm
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))

Re: Get total VRAM value

Posted: June 16th, 2020, 4:25 pm
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.

Re: Get total VRAM value

Posted: June 16th, 2020, 4:32 pm
by StArL0rd84
I have a GTX 1080 8GB
*cries in 60fps* :-(

But yeah, would be nice to test on an AMD card.

Re: Get total VRAM value

Posted: April 25th, 2022, 8:51 pm
by CrimsnShadow
As of the time of this post, it works for AMD cards as well. Thanks for this btw.

Re: Get total VRAM value

Posted: April 25th, 2022, 9:53 pm
by SilverAzide
Well, since this thread has been dug up from the grave... It's nice that someone finally confirmed it applies to AMD, but this trick doesn't necessarily work. The last part of the registry key (...\0000) seems to depend on how many video cards are present (including the GPUs built into most Intel/AMD CPUs). One of my machines has (for some bizarre reason) 0000, 0001, and 0002 keys, with the HardwareInformation.qwMemorySize registry value present on only one of them (and it's not the 0000 key). This trick does work another machine I have. So this doesn't seem like a reliable way to get the total VRAM for all scenarios.