Jump to content

Fun and games with Task Manager's GPU page

Mira Yurizaki

It seems to be a common belief that Task Manager is "unreliable" at reporting GPU usage statistics. So I thought that well... this is something that would be useful for game developers and GPU manufacturers so unreliable behavior and inaccuracies would be quickly pointed out to Microsoft.  So rather than just go with the flow and assume this really is the case, I thought I'd check out what this feature really is about. Thankfully someone at Microsoft made a nice blog post about it: https://devblogs.microsoft.com/directx/gpus-in-the-task-manager/

 

Then something caught my eye:

Quote

The data in the Task Manager is gathered directly from VidSch and VidMm. As such, performance data for the GPU is available no matter what API is being used, whether it be Microsoft DirectX API, OpenGL, OpenCL, Vulkan or even proprietary API such as AMD’s Mantle or Nvidia’s CUDA.

So where would this live exactly? Digging around I found this diagram living in https://docs.microsoft.com/en-us/windows-hardware/drivers/display/windows-vista-and-later-display-driver-model-architecture

 

dx10arch.png

 

So this information lives in the kernel mode space, which is how Task Manager can gather this data regardless of API, since applications that use the API live in user mode space. (note that the actual 3D rendering portion of DirectX is handled by Direct3D, the "DirectX" part may just be a carry-over name since DirectX is a family of API)

 

There was also another part that struck out at me

Quote

Some GPUs support multiple engines mapping to the same underlying set of cores. While these engines can also be scheduled in parallel, they end up sharing the underlying cores. This is conceptually similar to hyper-threading on the CPU. For example, a 3D engine and a compute engine may in fact be relying on the same set of unified cores. In such a scenario, the cores are either spatially or temporally partitioned between engines when executing.

The figure below illustrates engines and cores of a hypothetical GPU.

GPUTaskblog_gpuarch-1024x385.png

Wait, "compute engine"? "Copy engine 1"? When I open Task Manager all I see is:

 

taskmanager-gpu-page.png.4f1c67982705a7d08e739335285849c0.png

 

But if you click on the labels, you get:

unknown.png?width=839&height=596

 

That's a lot of other engines. But why is there "Graphics_1" and "Compute_1" if there's already a "3D" and "Compute_0"? So for craps and laughs, I changed "Video Encode" to "Graphics_1" and ran the Rise of the Tomb Raider benchmark, both when the game was running DX11 and DX12. And since something like GPU-Z is trusted as far as reporting GPU usage statistics went, I threw that up there too.

 

Spoiler

Also I used Compute_1 because why not.

 

rottr_usage_dx11.thumb.png.da35cff3f85b0b950fb92205764a20d0.png

Rise of the Tomb Raider in DX11

 

rottr_usage.thumb.png.f926db3f132ba67a41521afaf11ff689.png

Rise of the Tomb Raider in DX12

Wait, wut. Rise of the Tomb Raider didn't trigger activity in the "3D" graph, yet there's plenty of activity in the "Graphics_1" graph. Also of note, in the DX12 run, "Compute_1" was showing some activity. Otherwise GPU-Z's "GPU Load" and Task Manager's "Graphics_1" graphs appear to more or less agree.

 

Then I tried another game with a DX11 and DX12 render path: The Division.

Spoiler

division-dx11.thumb.png.4a216b938b8dd7399b2683f530162bdb.png

The Division DX11

division-dx12.thumb.png.ba1037e47746e752750b7c594f9ad0e7.png

The Division DX12

This time the DX11 render path triggered the "3D" graph while the DX12 one triggered the "Graphics_1" graph. However at this point, I don't really know what triggers which "engine" gets used and nothing on the internet is pointing out an obvious answer.

 

So what does GPU-Z use to poll GPU statistics? Well, according to a post on the forums of the site that makes it

Quote

  on both nvidia and amd the driver gives you a number between 0 and 100 that it calls gpu load/activity or other interchangeable terms, without any explanation what it really measures

This points them using a different way of gathering this data. It's likely since a lot of other applications, like HWMonitor, EVGA Precision X, and I'm presuming MSI Afterburner (I'm a heathen, I don't use it) all show the same statistics as GPU-Z, they too must be polling from the same place. Where exactly they are pulling it from, I'm not sure. (the drivers? well if someone wants to find a programming manual or something feel free)

 

So what's the point I'm trying to make?

Two things:

  1. The GPU page in Task Manager does a lot more than it appears to at first glance.
  2. It polls data at the kernel level, which should be able to figure out more intimate things that the GPU is doing. So once you figure out which engines are being used in your task, it's about as accurate as you'll get.
Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, Mira Yurizaki said:

The GPU page in Task Manager does a lot more than it appears to at first glance.

As another example, if you're doing F@H the default Task Manager default view won't show any activity on the GPU, but if you change one of the graphs to Compute(?) it will show the cards usage.

CPU: Intel i7 6700k  | Motherboard: Gigabyte Z170x Gaming 5 | RAM: 2x16GB 3000MHz Corsair Vengeance LPX | GPU: Gigabyte Aorus GTX 1080ti | PSU: Corsair RM750x (2018) | Case: BeQuiet SilentBase 800 | Cooler: Arctic Freezer 34 eSports | SSD: Samsung 970 Evo 500GB + Samsung 840 500GB + Crucial MX500 2TB | Monitor: Acer Predator XB271HU + Samsung BX2450

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, Spotty said:

As another example, if you're doing F@H the default Task Manager default view won't show any activity on the GPU, but if you change one of the graphs to Compute(?) it will show the cards usage.

That reminds me, the graph on the summary list on the left-hand side shows the "engine" you have listed with the most activity. Can be annoying, but what else can you do when you have a single entity with a dozen independent data points?

Link to comment
Share on other sites

Link to post
Share on other sites

  • 9 months later...

Is it possible to make the Task Manager GPU persist some changes?

For example, I select the CUDA graph, but when I close the Task Manager and re-open it, the CUDA graph has been changed to the default one.

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, pc_user said:

Is it possible to make the Task Manager GPU persist some changes?

For example, I select the CUDA graph, but when I close the Task Manager and re-open it, the CUDA graph has been changed to the default one.

I'm unaware if there's a way to do this, but I suspect if the feature was there, it wouldn't need anything special.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×