diff --git a/src/utils.ts b/src/utils.ts index 114957e9..269a48c9 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -93,13 +93,22 @@ export async function validateHardware(): Promise { if (!hasNvidia) { try { - await execAsync('nvidia-smi'); + // wmic is unreliable. Check in PS. + const res = await execAsync( + 'powershell.exe -c "$n = \'*NVIDIA*\'; Get-CimInstance win32_videocontroller | ? { $_.Name -like $n -or $_.VideoProcessor -like $n -or $_.AdapterCompatibility -like $n }"' + ); + if (!res) throw new Error('No video card'); return { isValid: true }; } catch { - return { - isValid: false, - error: 'ComfyUI requires an NVIDIA GPU on Windows. No NVIDIA GPU was detected.', - }; + try { + await execAsync('nvidia-smi'); + return { isValid: true }; + } catch { + return { + isValid: false, + error: 'ComfyUI requires an NVIDIA GPU on Windows. No NVIDIA GPU was detected.', + }; + } } }