Programmatically fetch GPU utilization

两盒软妹~` 提交于 2019-12-12 08:26:40

问题


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?


回答1:


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.




回答2:


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

nvidia --help for full helping information.




回答3:


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.



来源:https://stackoverflow.com/questions/2160935/programmatically-fetch-gpu-utilization

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!