如何在 Windows 上使用 python 与 AMD GPU 交互

How to interact with AMD GPUs using python on Windows

我想使用 python 与我的 AMD Radeon RX 580 交互。 我想要完成的基本内容:

  1. 获取功率水平(它拉动了多少瓦)
  2. 设置风扇速度
  3. 从 GPU 本身检索一些信息,例如:内存大小、子供应商(Saphhire、XFX 等)、GPU 和内存时钟、内存类型等

我正在寻找通过 "Windows" 上的 python 获取此信息的方法。

我搜索了很多,但所有的解决方案似乎都可以在 linux 上找到。

尝试:

import os
os.system("cmd \k wmic path Win32_VideoController")

它显示了一些信息。所以你可以通过修改CMD命令的get参数来提取它们。

wmic path Win32_VideoController get name

命令支持以下获取参数:

AcceleratorCapabilities AdapterCompatibility AdapterDACType AdapterRAM Availability CapabilityDescriptions Caption ColorTableEntries ConfigManagerErrorCode ConfigManagerUserConfig CreationClassName CurrentBitsPerPixel CurrentHorizontalResolution CurrentNumberOfColors CurrentNumberOfColumns CurrentNumberOfRows CurrentRefreshRate CurrentScanMode CurrentVerticalResolution Description DeviceID DeviceSpecificPens DitherType DriverDate DriverVersion ErrorCleared ErrorDescription ICMIntent ICMMethod InfFilename InfSection InstallDate InstalledDisplayDrivers LastErrorCode MaxMemorySupported MaxNumberControlled MaxRefreshRate MinRefreshRate Monochrome Name NumberOfColorPlanes NumberOfVideoPages PNPDeviceID PowerManagementCapabilities PowerManagementSupported ProtocolSupported ReservedSystemPaletteEntries SpecificationVersion Status StatusInfo SystemCreationClassName SystemName SystemPaletteEntries TimeOfLastReset VideoArchitecture VideoMemoryType VideoMode VideoModeDescription VideoProcessor

您可以安装 pyadl 来查找 amd gpu 的一些信息。 https://github.com/nicolargo/pyadl

>>> from pyadl import *
>>> 
>>> device = ADLManager.getInstance().getDevices()
...
>>> device.getCurrentCoreVoltage()
...
>>> device.getCurrentEngineClock()
...
>>> device.getCurrentFanSpeed(speedType)
...