Get amount of graphics memory

Yes. And particularly graphics card infos such as :

  • number of GPUs,
  • vram size by GPU,
  • name of each GPU,
  • allocated and available memory of each GPU (I’ve pushed this feature aside).

I’ve done this for WIN, MAC OS and Linux (nvidia cards only).

For NVidia on Linux, there’s the libXNVCtrl (which uses the NV-CONTROL X extension), which I believe is what nvidia-settings is built on.

You can call these APIs directly in your own apps. Saves parsing nvidia-settings outputs.

Here’s some source that queries GPU mem (in KB) for NVidia cards via NV-CONTROL:


  int ram_size;
  XNVCTRLQueryAttribute( dpy, scr, 0, NV_CTRL_VIDEO_RAM, 
                         &ram_size );

If you want a working program, just give the word.