Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C (Windows) - GPU usage (load %)

Tags:

c

windows

gpu

According to many sources on the Internet its possible to get GPU usage (load) using D3DKMTQueryStatistics.

How to query GPU Usage in DirectX?

I've succeded to get memory information using code from here with slight modifications: http://processhacker.sourceforge.net/forums/viewtopic.php?t=325#p1338

However I didn't find a member of D3DKMT_QUERYSTATISTICS structure that should carry information regarding GPU usage.

like image 834
Dan Avatar asked Apr 13 '15 17:04

Dan


People also ask

Is 1% GPU usage normal?

Although it's normal to see low GPU usage in eSports titles, it should be around 95-100% in the latest AAA games. If you're getting less than 80-90% GPU usage in demanding games, you most likely have a CPU bottleneck. The CPU has to feed data to the GPU.

Why is my GPU at 100% usage?

GPU always at 100% when playing games suggests that there is nothing in your computer that will trigger a bottleneck on your graphics cards. GPU usage is a quite contextual parameter thus it reaches different values in different games.

What percentage of GPU usage is normal?

Generally, you can expect a 30 to 70% GPU usage if you're playing a less demanding game. On the other hand, a high-demanding game can have the GPU running at almost 100%, which is normal. A high GPU usage means that the game uses all of the GPU's available FPS or performance.

Why is my GPU at 99% usage?

Yes, it's entirely normal. 99% load means your GPU is being fully used. That's fine, because that's exactly what it's for. 70 degrees is a very good temperature for a GTX 970 under max load.


1 Answers

Look at the EtpUpdateNodeInformation function in gpumon.c. It queries for process statistic per GPU node. There can be several processing nodes per graphics card:

queryStatistics.Type = D3DKMT_QUERYSTATISTICS_PROCESS_NODE
...
totalRunningTime += queryStatistics.QueryResult.ProcessNodeInformation.RunningTime.QuadPart
...
PhUpdateDelta(&Block->GpuRunningTimeDelta, totalRunningTime);
...
block->GpuNodeUsage = (FLOAT)(block->GpuRunningTimeDelta.Delta / (elapsedTime * EtGpuNodeBitMapBitsSet));

It gathers process running time and divides by actual time span.

like image 184
Anton Krouglov Avatar answered Oct 13 '22 00:10

Anton Krouglov