24

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?

2

3 Answers 3

35

For Nvidia GPUs:

nvidia-smi

For Intel GPUs:

intel_gpu_tools

For AMD GPUs:

aticonfig --odgc --odgt

For real time watching -- example:

watch nvidia-smi
2
  • +1. Just a headsup: intel_gpu_tools (underscore, not dash), as a command.
    – IsaacS
    Jan 14, 2015 at 20:09
  • watch nvidia-smi will do it, no need for sudo there I think.
    – user345394
    Sep 28, 2021 at 2:34
3

I think the better way is to install a utility nvtop

E.g. In the following picture almost 100% memory is used on all 3 GPUs as per nvtop. command is

nvtop

enter image description here

3

If you want to check memory usage for every 1 second, then the watch command does the job.

watch -n 1 nvidia-smi
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .