Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically fetch GPU utilization

Tags:

c++

.net

gpu

Is there a standard way of getting the current load on the GPU? I'm looking for something similar to the Task Manager showing CPU%. Utilities such as GPU-Z show this value but I'm not sure how it gets this. I'm specifically interested in AMD graphics cards at the moment, any pointers would be helpful.

If there's no clean API way of doing it, are there any programs whose output I can capture to get this info?

like image 706
Amit G Avatar asked Jan 29 '10 09:01

Amit G


3 Answers

For AMD/ATI cards, check out GPU PerfStudio. http://developer.amd.com/gpu/Pages/default.aspx

For NVidia cards, look at PerfHUD. http://developer.nvidia.com/object/nvperfhud_home.html

There is also a more generic tool in the DirectX SDK from MS called Pix that overlaps partially with these tools.

AFAIK there's no way to get something as simple as a %-use number for the GPU because it isn't that simple. But these tools will help in debugging and profiling what's going on in the GPU. Both ATI and NVidia provide public documentation with recommended steps to find and fix specific types of GPU bottlenecks.

like image 161
Alan Avatar answered Nov 02 '22 19:11

Alan


Try nvidia-smi -a. It is shipped with nvidia drivers. Provides current GPU core and memory utilization information.

nvidia --help for full helping information.

like image 27
fflower Avatar answered Nov 02 '22 20:11

fflower


This kind of information is always provided either through a PerformanceCounter or WMI. Use Perfmon.exe or download WmiCodeCreator to find out what the card manufacturer provided. Perhaps needless to say, this kind of code doesn't port well from one machine to another.

like image 20
Hans Passant Avatar answered Nov 02 '22 20:11

Hans Passant