Ubuntu – How to find the memory usage on the GPU

gpumemory usagenvidia

Previously I was checking the memory usage on my GPU with the following command:

nvidia-settings -q all | grep Memory

I am processing some scientific data on my GPU with numpy and theano. I was doing this with the gnome desktop running, and there was already 380 Mb of memory used on the device. So I stopped lightdm to free up a little more GPU memory; but, now the nvidia-settings tool no longer works.

It simply errors that there is no display

ERROR: Cannot open display ':0.0'.

Is there some other way of getting GPU memory without using this tool? Is there some way to use make it function in headless mode?

Best Answer

For Nvidia GPUs:

nvidia-smi

For Intel GPUs:

intel_gpu_tools

For AMD GPUs:

aticonfig --odgc --odgt

For real time watching -- example:

sudo watch nvidia-smi
Related Question