【发布时间】:2021-07-06 16:12:17
【问题描述】:
我使用 WMI Win32_VideoController, AdapterRAM 属性来读取 Windows 10 中的显示适配器 RAM 大小,但问题是该值被限制为最大 4GB。
在 11GB 的显示适配器上,我仍然得到 4GB(是的,我使用 int64 作为结果,但返回的对象包含 4GB,即使使用调试器检查也是如此)。
有没有办法绕过这个错误?
【问题讨论】:
我使用 WMI Win32_VideoController, AdapterRAM 属性来读取 Windows 10 中的显示适配器 RAM 大小,但问题是该值被限制为最大 4GB。
在 11GB 的显示适配器上,我仍然得到 4GB(是的,我使用 int64 作为结果,但返回的对象包含 4GB,即使使用调试器检查也是如此)。
有没有办法绕过这个错误?
【问题讨论】:
是的,检查这个 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
【讨论】: