Skip to content

Commit 0d9e792

Browse files
manuelcandalesCopilot
authored andcommitted
Make nvidia-smi non-fatal in Windows CUDA CI (pytorch#18565)
Some Windows GPU runners don't have nvidia-smi available even though the CUDA toolkit (nvcc) is properly installed. The nvidia-smi call is purely informational — the actual CUDA toolchain validation is done by nvcc --version and the version check that follows. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 0058035 commit 0d9e792

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.ci/scripts/test_model_e2e_windows.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,19 @@ try {
135135
Write-Host "::group::Check CUDA toolchain"
136136
$nvccOutput = nvcc --version | Out-String
137137
Write-Host $nvccOutput
138-
nvidia-smi
138+
$nvidiaSmiCmd = Get-Command nvidia-smi -ErrorAction SilentlyContinue
139+
if ($null -eq $nvidiaSmiCmd) {
140+
Write-Host "nvidia-smi not available (command not found; driver may not be installed)"
141+
}
142+
else {
143+
try {
144+
nvidia-smi
145+
}
146+
catch {
147+
Write-Host "nvidia-smi failed (driver or GPU issue). Error details:"
148+
Write-Host $_
149+
}
150+
}
139151
if (-not [string]::IsNullOrWhiteSpace($ExpectedCudaVersion)) {
140152
$versionMatch = [Regex]::Match($nvccOutput, "release\s+(\d+\.\d+)")
141153
if (-not $versionMatch.Success) {

0 commit comments

Comments
 (0)