2

What is the internal operation that allows nvidia-smi fetch the hardware level details? The tool executes even when some process is already running on the GPU device and gets the utilization details, name and id of the process etc. Is it possible to develop such a tool at the user level? How is NVML related?

Rakesh Kumar
  • 51
  • 1
  • 7

1 Answers1

6

Nvidia-smi is a thin wrapper around NVML. You can code with NVML with help of SDK contained in Tesla Deployment Kit.

Everything that can be done with nvidia-smi can be queried straight from the C library NVML. If you need to query this data in an app of some sort, it's better (and probably easier) to write against NVML instead of parse nvidia-smi stdout (which format changed in the past).

There are also python and perl bindings for NVML library. So you can use higher level programming langugage than C.

Przemyslaw Zych
  • 2,000
  • 1
  • 21
  • 24
  • So it is not possible to query anything, not provided through NVML using nvidia-smi? NVML doesn't provide any access to SM level detail. So I was thinking of communicating with the driver in alternate ways. Is it possible with nvidia-smi or some other tool? – Rakesh Kumar Feb 16 '13 at 07:10
  • There are more libraries provided by NVIDIA. NVML is for managing GPUs on a high level (e.g. Tool for an sys admin). It seems you're interested more in profiling. Take a look at http://docs.nvidia.com/cuda/cupti/index.html than. – Przemyslaw Zych Feb 16 '13 at 07:42
  • Do commandline profiling, nvprof and visual profiler use the same CUPTI? With those, I can just get the profiling results at the end of execution. And they are specific to applications. The profiling of an application can be done by adding CUPTI APIs in the source code (like in events_sampling example with threads) or during execution, the nvvp or nvprof commands are associated with the executable. – Rakesh Kumar Feb 16 '13 at 08:00
  • [continued..] That means CUPTI is used for application profiling. I want some tool like nvidia-smi, which just gives the status of the device. CUPTI provides APIs for active_cycles, active_warps etc. but can they be used outside the application to just check the instantaneous status of an SM? I am a beginner, sorry if I am wrong somewhere. – Rakesh Kumar Feb 16 '13 at 08:00
  • I haven't ever used CUPTI. The easiest way is to try it out. AFAIK nvprof uses CUPTI underneath so the functionality of these utilities is a good representation of what's available in CUPTI API. – Przemyslaw Zych Feb 16 '13 at 10:48