From a99ebf0ae050274e00544585e64c946a99ebb1bb Mon Sep 17 00:00:00 2001 From: Tom Vokac Date: Wed, 15 Jul 2026 00:23:32 -0400 Subject: [PATCH] fix: detect NVIDIA GPU from installer --- build/windows/nsis/project.nsi | 11 ++++++++++- internal/buildcheck/subsystem_test.go | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/build/windows/nsis/project.nsi b/build/windows/nsis/project.nsi index 4579ebc..ddd2d28 100644 --- a/build/windows/nsis/project.nsi +++ b/build/windows/nsis/project.nsi @@ -131,7 +131,12 @@ Section IfFileExists "$INSTDIR\resources\nemotron\.ready" nemotron_present nemotron_probe_gpu nemotron_probe_gpu: - nsExec::ExecToStack 'cmd /C nvidia-smi -L' + # NSIS is a 32-bit process even for an amd64 installer. Without disabling + # filesystem redirection, System32 resolves to SysWOW64, where NVIDIA's + # 64-bit nvidia-smi.exe is not installed. + ${DisableX64FSRedirection} + nsExec::ExecToStack '"$SYSDIR\nvidia-smi.exe" -L' + ${EnableX64FSRedirection} Pop $1 Pop $2 StrCmp $1 "0" nemotron_gpu_found nemotron_no_gpu @@ -143,7 +148,11 @@ Section nemotron_provision: DetailPrint "NVIDIA GPU detected; provisioning Nemotron 3.5 ASR Streaming..." + # Launch 64-bit PowerShell so setup.ps1 can also resolve nvidia-smi and + # validate VRAM/compute capability without WOW64 redirection. + ${DisableX64FSRedirection} nsExec::ExecToLog '"$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -File "$INSTDIR\resources\nemotron\setup.ps1" -InstallRoot "$INSTDIR\resources\nemotron"' + ${EnableX64FSRedirection} Pop $1 StrCmp $1 "0" 0 nemotron_provision_failed IfFileExists "$INSTDIR\resources\nemotron\.ready" nemotron_provisioned nemotron_not_ready diff --git a/internal/buildcheck/subsystem_test.go b/internal/buildcheck/subsystem_test.go index efcdf34..180b304 100644 --- a/internal/buildcheck/subsystem_test.go +++ b/internal/buildcheck/subsystem_test.go @@ -40,9 +40,14 @@ func TestInstallerOffersMissingNemotronOnUpgrade(t *testing.T) { `StrCmp $IsUpgrade "0" nemotron_provision`, `MessageBox MB_YESNO|MB_ICONQUESTION`, `IfSilent nemotron_silent_skip`, + `${DisableX64FSRedirection}`, + `nsExec::ExecToStack '"$SYSDIR\nvidia-smi.exe" -L'`, } { if !strings.Contains(installer, required) { t.Fatalf("%s no longer contains %q; missing Nemotron upgrades will not be handled safely", path, required) } } + if strings.Contains(installer, "cmd /C nvidia-smi") { + t.Fatalf("%s probes nvidia-smi through 32-bit cmd; WOW64 redirection hides the System32 executable", path) + } }