确定通过WMI运行的GPU

时间:2016-06-15 02:57:01

标签: python windows wmi gpu

我正在尝试编写一个python脚本,以确定当前正在运行的GPU(专用或集成)。到目前为止,我已经设法通过运行dxdiag并解析每个gpu设备模式的输出来实现它,但这需要太长时间。有谁知道dxdiag如何获取这些信息?有没有办法通过Windows管理工具获取信息?任何帮助表示赞赏。

由于

1 个答案:

答案 0 :(得分:1)

DXDiag大多数可能WMI表中获取数据。 我需要确认一下。

wmic PATH Win32_VideoController GET Adapterram

将为您提供所需的信息。如果您想了解更多信息,请运行下面提到的命令。

wmic PATH Win32_VideoController

如果你想要 GPU名称

wmic PATH Win32_VideoController GET Name

<强>更新

添加示例以便更好地理解。 您可以使用deviceid在下面提到的表格之间进行映射,并获取相关信息。

instance of Win32_VideoController
{
    AdapterCompatibility = "Intel Corporation";
    AdapterDACType = "Internal";
    AdapterRAM = 1073741824;
    Availability = 3;
    Caption = "Intel(R) HD Graphics 4600";
    ConfigManagerErrorCode = 0;
    ConfigManagerUserConfig = FALSE;
    CreationClassName = "Win32_VideoController";
    CurrentBitsPerPixel = 32;
    CurrentHorizontalResolution = 1920;
    CurrentNumberOfColors = "4294967296";
    CurrentNumberOfColumns = 0;
    CurrentNumberOfRows = 0;
    CurrentRefreshRate = 59;
    CurrentScanMode = 4;
    CurrentVerticalResolution = 1080;
    Description = "Intel(R) HD Graphics 4600";
    DeviceID = "VideoController1";
    DitherType = 0;
    DriverDate = "20150911000000.000000-000";
    DriverVersion = "20.19.15.4285";
    InfFilename = "oem79.inf";
    InfSection = "iHSWD_w10";
    InstalledDisplayDrivers = "igdumdim64.dll,igd10iumd64.dll,igd10iumd64.dll,igd12umd64.dll,igdumdim32,igd10iumd32,igd10iumd32,igd12umd32";
    MaxRefreshRate = 75;
    MinRefreshRate = 50;
    Monochrome = FALSE;
    Name = "Intel(R) HD Graphics 4600";
    PNPDeviceID = "PCI\\VEN_8086&DEV_0412&SUBSYS_18E5103C&REV_06\\3&11583659&0&10";
    Status = "OK";
    SystemCreationClassName = "Win32_ComputerSystem";
    SystemName = "---------";
    VideoArchitecture = 5;
    VideoMemoryType = 2;
    VideoModeDescription = "1920 x 1080 x 4294967296 colors";
    VideoProcessor = "Intel(R) HD Graphics Family";
};




instance of Win32_PnPEntity
{
    Caption = "Intel(R) HD Graphics 4600";
    ClassGuid = "{4d36e968-e325-11ce-bfc1-08002be10318}";
    CompatibleID = {"PCI\\VEN_8086&DEV_0412&REV_06", "PCI\\VEN_8086&DEV_0412", "PCI\\VEN_8086&CC_030000", "PCI\\VEN_8086&CC_0300", "PCI\\VEN_8086", "PCI\\CC_030000", "PCI\\CC_0300"};
    ConfigManagerErrorCode = 0;
    ConfigManagerUserConfig = FALSE;
    CreationClassName = "Win32_PnPEntity";
    Description = "Intel(R) HD Graphics 4600";
    DeviceID = "PCI\\VEN_8086&DEV_0412&SUBSYS_18E5103C&REV_06\\3&11583659&0&10";
    HardwareID = {"PCI\\VEN_8086&DEV_0412&SUBSYS_18E5103C&REV_06", "PCI\\VEN_8086&DEV_0412&SUBSYS_18E5103C", "PCI\\VEN_8086&DEV_0412&CC_030000", "PCI\\VEN_8086&DEV_0412&CC_0300"};
    Manufacturer = "Intel Corporation";
    Name = "Intel(R) HD Graphics 4600";
    PNPClass = "Display";
    PNPDeviceID = "PCI\\VEN_8086&DEV_0412&SUBSYS_18E5103C&REV_06\\3&11583659&0&10";
    Present = TRUE;
    Service = "igfx";
    Status = "OK";
    SystemCreationClassName = "Win32_ComputerSystem";
    SystemName = "-------";
};