6

I want to know how to display percentage of the graphics card ability upon tasks being sent to the card. Like a Gnome's system monitor.

Moreover, how to obtain device parameters to calculate a percentage based on its hardware specs

How does nvidia-smi -a get utilization? Is there an Cuda API to ask the card for this information?

stackoverflow
  • 18,348
  • 50
  • 129
  • 196

2 Answers2

6

Process Hacker does this (this is only for Windows), but it's not CUDA-specific.

I know it uses some undocumented functions -- take a look at the plugin's source code to find out how.

user541686
  • 205,094
  • 128
  • 528
  • 886
  • Note that this appears to only work on Windows 7+ according to the source-code. Either way, the undocumented function would be "D3DKMTQueryStatistics" from GDI32.dll and you'd need to get your hands on d3dkmt.h (google it) for structure definitions. – Jasper Bekkers Dec 08 '11 at 15:08
3

What you want to do is not done in CUDA. For a percentage output of the utilization handles by a specific cuda device you have to ask the GPU driver like nvidia-smi does.

EDIT: After a little google search i found open-hardware-monitor It is written in C# and shows a way to get the utilization of AMD and nVidia cards on windows systems. The implementation for AMD cards works on linux and windows.

I've looked a bit inside the code. Look at the NVAPI.cs file to see how open-hardware-monitor uses the nvidia dlls on windows to get all sensor and load data.

Michael Haidl
  • 5,384
  • 25
  • 43