When you want to get the RAM capacity of the graphics card installed on the computer, It’s more simple to use WMI class.

You can give a look at the AdapterRAM attribute of Win32_VideoController.

The Win32_VideoController WMI class represents the capabilities and management capacity of the video controller. AdapterRAM is one of its attibute:


AdapterRAM
Data type: uint32
Access type: Read-only
Qualifiers: Units(Bytes)
Memory size of the video adapter.

Example: 64000

The full syntax is listed here:



class Win32_VideoController : CIM_PCVideoController
{
uint16 AcceleratorCapabilities[] ;
string AdapterCompatibility ;
string AdapterDACType ;
uint32 AdapterRAM ;
uint16 Availability ;
string CapabilityDescriptions[] ;
string Caption ;
uint32 ColorTableEntries ;
uint32 ConfigManagerErrorCode ;
boolean ConfigManagerUserConfig ;
string CreationClassName ;
uint32 CurrentBitsPerPixel ;
uint32 CurrentHorizontalResolution ;
uint64 CurrentNumberOfColors ;
uint32 CurrentNumberOfColumns ;
uint32 CurrentNumberOfRows ;
uint32 CurrentRefreshRate ;
uint16 CurrentScanMode ;
uint32 CurrentVerticalResolution ;
string Description ;
string DeviceID ;
uint32 DeviceSpecificPens ;
uint32 DitherType ;
datetime DriverDate ;
string DriverVersion ;
boolean ErrorCleared ;
string ErrorDescription ;
uint32 ICMIntent ;
uint32 ICMMethod ;
string InfFilename ;
string InfSection ;
datetime InstallDate ;
string InstalledDisplayDrivers ;
uint32 LastErrorCode ;
uint32 MaxMemorySupported ;
uint32 MaxNumberControlled ;
uint32 MaxRefreshRate ;
uint32 MinRefreshRate ;
boolean Monochrome ;
string Name ;
uint16 NumberOfColorPlanes ;
uint32 NumberOfVideoPages ;
string PNPDeviceID ;
uint16 PowerManagementCapabilities[] ;
boolean PowerManagementSupported ;
uint16 ProtocolSupported ;
uint32 ReservedSystemPaletteEntries ;
uint32 SpecificationVersion ;
string Status ;
uint16 StatusInfo ;
string SystemCreationClassName ;
string SystemName ;
uint32 SystemPaletteEntries ;
datetime TimeOfLastReset ;
uint16 VideoArchitecture ;
uint16 VideoMemoryType ;
uint16 VideoMode ;
string VideoModeDescription ;
string VideoProcessor ;
};