nvidia-smi with CUDA dev environment

Hi everyone,

I need to use nvidia-smi to frequently poll my GPUs and keep them active, or else this will happen: http://forums.nvidia.com/index.php?showtopic=188174. Also, I want to be able to set compute exclusive mode.

I’m on Ubuntu (11.10) and have installed the CUDA Toolkit (4.1) and the NVIDIA 285.05.33 driver from the website. The nvidia-smi tool is not part of it however, and if I install nvidia-current from the Ubuntu repository it messes up my driver installation.

So, the question is this: How can I install nvidia-smi (or something similar) without running into driver-trouble. Alternatively, how can I poll the GPUs to keep them active (see link).

Hi heipei,

nvidia-smi and NVML should be both installed as a part of NVIDIA Driver Installation process to /usr/bin/nvidia-smi and /usr/lib64/libnvidia-ml.so*.

Are you installing the driver in some non-standard way?

A quick fix for your case could be:

Write a very short application that runs “cuInit” and freezes. This will keep the device nodes busy.

Or write an application that opens the nodes yourself:

Something like:

fopen("/dev/nvidiactl", "r")

 fopen("/dev/nvidia0", "r")

 fopen("/dev/nvidia1", "r")

...

The best way though would be to download the Driver again. e.g. http://developer.download.nvidia.com/compute/cuda/4_1/rel/drivers/NVIDIA-Linux-x86_64-285.05.33.run

And make a fresh default installation with “./NVIDIA-Linux-x86_64-285.05.33.run -s”.

When both NVML and (the command line wrapper around NVML) nvidia-smi are both present, the best solution would be to enable “persistence mode”

nvidia-smi --persistence-mode=1

Which will prevent the driver from unloading.

Let me know if you have other questions.

Regrads,

Przemyslaw Zych

Thanks a lot, that solved it. I had installed the driver using sh <filename.sh>, without the -s flag. Now I have nvidia-smi and was able to set persistence mode. Thank you for the quick response!