getGpuInfo
getGpuInfo
Info
getGpuInfo is a synchronous query function that returns GPU hardware information. It spawns the C# helper EXE which queries Win32_VideoController via WMI, returning an array of GpuInfo objects.
Signature
function getGpuInfo(): GpuInfo[];Return Value
| Type | Description |
|---|---|
GpuInfo[] | Array of GPU information objects (one per video controller) |
Warning
Virtual display adapters (emulators, remote desktop, Hyper-V) are included in the results. Filter by checking adapterRamBytes !== null to identify physical GPUs.
Usage
Use this function to display GPU specifications, identify installed graphics hardware, or check driver versions.
Note
This returns video controller data, not display output information. For connected display details, use getMonitorInfo().
Tips
Systems with hybrid graphics (integrated + discrete) return multiple entries. The discrete GPU typically has a larger adapterRamBytes value.
Example
import { getGpuInfo } from '@eisland/windows-hardware-info-helper';
const gpus = getGpuInfo();
for (const gpu of gpus) {
if (gpu.adapterRamBytes === null) continue; // skip virtual adapters
const vramGB = (gpu.adapterRamBytes / 1073741824).toFixed(1);
console.log(`${gpu.name} — ${vramGB} GB VRAM`);
console.log(`Driver: ${gpu.driverVersion} (${gpu.driverDate})`);
}const { getGpuInfo } = require('@eisland/windows-hardware-info-helper');
const gpus = getGpuInfo();
for (const gpu of gpus) {
if (gpu.adapterRamBytes === null) continue; // skip virtual adapters
const vramGB = (gpu.adapterRamBytes / 1073741824).toFixed(1);
console.log(`${gpu.name} — ${vramGB} GB VRAM`);
console.log(`Driver: ${gpu.driverVersion} (${gpu.driverDate})`);
}Notes
Note
The driverDate field is formatted as YYYY-MM-DD. WMI stores dates in a proprietary format — the EXE helper handles the conversion.
Tips
Compare driverDate against the latest available driver version to determine if an update is needed.
Important
adapterRamBytes may report a capped value (e.g., 4 GB) for GPUs with more VRAM due to WMI limitations. For accurate VRAM on NVIDIA/AMD GPUs, use vendor-specific APIs.
Danger Avoidance
Caution
Do not assume adapterRamBytes is always accurate. Some drivers report truncated values. Always treat it as an approximation.
Changelog
bb5b2-on

