【问题标题】:WMI Win32_VideoController RAM 4GB LimitWMI Win32_VideoController RAM 4GB 限制
【发布时间】:2021-07-06 16:12:17
【问题描述】:

我使用 WMI Win32_VideoController, AdapterRAM 属性来读取 Windows 10 中的显示适配器 RAM 大小,但问题是该值被限制为最大 4GB。

在 11GB 的显示适配器上,我仍然得到 4GB(是的,我使用 int64 作为结果,但返回的对象包含 4GB,即使使用调试器检查也是如此)。

有没有办法绕过这个错误?

【问题讨论】:

    标签: c# wmi wmi-query


    【解决方案1】:

    是的,检查这个 POWERSHELL 代码:

    $qwMemorySize = (Get-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -Name HardwareInformation.qwMemorySize -ErrorAction SilentlyContinue)."HardwareInformation.qwMemorySize"
    foreach ($VRAM in $qwMemorySize)
    {
        Get-CimInstance -ClassName CIM_VideoController | Where-Object -FilterScript {$_.AdapterDACType -ne "Internal"} | ForEach-Object -Process {
            [PSCustomObject] @{
                Model      = $_.Caption
                "VRAM, GB" = [math]::round($VRAM/1GB)
            }
        }
    }
    

    输出:

    Model                         VRAM, GB
    -----                         --------
    NVIDIA GeForce RTX 2070 SUPER        8
    

    【讨论】:

    猜你喜欢
    • 2010-11-12
    • 1970-01-01
    • 1970-01-01
    • 2011-08-01
    • 2011-11-23
    • 2011-08-06
    • 1970-01-01
    • 2011-08-21
    • 1970-01-01
    相关资源
    最近更新 更多