简体   繁体   English

任务管理器从哪里提取 GPU 和 CPU 的指标?

[英]From where does task manager pull metrics for GPU and CPU?

I have been trying to get details from WMI to be able to replicate the task manager tabs for GPU metrics我一直在尝试从 WMI 获取详细信息,以便能够复制GPU 指标的任务管理器选项卡

I have settled on the following WMI classes to get some details which are shown in the我已经确定了以下 WMI 类以获得一些详细信息,这些详细信息显示在

  • \\<machine-name>\ROOT\CIMV2:Win32_VideoController for the driver details \\<machine-name>\ROOT\CIMV2:Win32_VideoController获取驱动程序详细信息
  • \\<device-name>\ROOT\CIMV2:Win32_PerfFormattedData_GPUPerformanceCounters_GPUEngine for the GPU utilization information \\<device-name>\ROOT\CIMV2:Win32_PerfFormattedData_GPUPerformanceCounters_GPUEngine用于GPU 利用率信息
  • \\<machine-name>\ROOT\CIMV2:Win32_PerfFormattedData_GPUPerformanceCounters_GPUAdapterMemory class for the shared and dedicated memory utilization \\<machine-name>\ROOT\CIMV2:Win32_PerfFormattedData_GPUPerformanceCounters_GPUAdapterMemory class 用于共享和专用 memory 利用率

However, the last 2 classes mentioned do not provide the metrics mapped to a named GPU identifier.但是,提到的最后 2 个类不提供映射到命名 GPU 标识符的指标。 Instead these are mapped to a LUID相反,这些被映射到一个 LUID

I am still not sure where Task Manager gets the details for the Total Dedicated Memory as I have not found any class or property exposing the same reliably.我仍然不确定任务管理器从哪里获得 Total Dedicated Memory 的详细信息,因为我没有找到任何 class 或可靠地公开相同内容的属性。 I know the total shared memory is calculated as TotalPhysicalMemory/2我知道总共享 memory 计算为TotalPhysicalMemory/2

Where is Task Manager getting all these data and how is it mapping it to the particular GPU (As there can be multiple GPUs in a machine)?任务管理器在哪里获取所有这些数据,它如何将其映射到特定的 GPU(因为一台机器中可以有多个 GPU)?

I have come across a blog post that tells how some of the metrics are calculated, but it does not say where the date is captured from: https://devblogs.microsoft.com/directx/gpus-in-the-task-manager/我遇到了一篇博客文章,其中介绍了如何计算某些指标,但没有说明从哪里捕获日期: https://devblogs.microsoft.com/directx/gpus-in-the-task-manager /

GPU and CPU speeds can be accessed by using Perfmon (performance counters). GPU 和 CPU 速度可以通过使用 Perfmon(性能计数器)来访问。 You can speed information, read/write etc.,.. It is also an alternative to using WMI.您可以加速信息、读/写等,.. 它也是使用 WMI 的替代方法。

However, the CPU and GPU are also dependent on the vendor.但是,CPU 和 GPU 也取决于供应商。 Which means if the manufacturer has not released documentation you will not be able to accurately pull the information needed.这意味着如果制造商没有发布文档,您将无法准确提取所需的信息。

Take temperature for example.以温度为例。 Many vendors keep the documentation non existent to developers, some vendors welcome the development on documentation.许多供应商对开发人员保持文档不存在,一些供应商欢迎文档开发。

So it boils down to the information you want versus what is available.因此,它归结为您想要的信息与可用的信息。 Most CPU and GPU information is limited and depends on the vendor.大多数 CPU 和 GPU 信息有限,取决于供应商。

I ran into this a few years back with the CPU temp.几年前我在 CPU 温度上遇到了这个问题。 I could get the temp from one PC and not another.我可以从一台 PC 而不是另一台 PC 上获取温度。 Found out it relies on the vendor and disclosure.发现它依赖于供应商和披露。

Basic information you can get as percentage, read/write and so forth.您可以获得百分比、读/写等形式的基本信息。 So be sure to see documentation for vendors and you may have to make a list of different vendors that shows which has access and which doesn't.因此,请务必查看供应商的文档,您可能必须列出不同供应商的列表,显示哪些可以访问,哪些没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM