Skip to content

Commit 540d34f

Browse files
committed
Pin Windows CUDA CMake toolchain
1 parent 3e79199 commit 540d34f

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.ci/scripts/test_model_e2e_windows.ps1

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,31 @@ try {
159159
}
160160
Write-Host "CUDA version check passed: $actualCudaVersion"
161161
}
162+
$cmakeCudaArgs = @()
163+
if (-not [string]::IsNullOrWhiteSpace($env:CUDA_HOME)) {
164+
$cudaNvcc = Join-Path -Path $env:CUDA_HOME -ChildPath "bin\nvcc.exe"
165+
if (-not (Test-Path -Path $cudaNvcc -PathType Leaf)) {
166+
throw "CUDA compiler not found at '$cudaNvcc'"
167+
}
168+
$env:CUDACXX = $cudaNvcc
169+
$cmakeCudaArgs = @(
170+
"-T", "cuda=$env:CUDA_HOME",
171+
"-DCMAKE_CUDA_COMPILER=$cudaNvcc",
172+
"-DCUDAToolkit_ROOT=$env:CUDA_HOME"
173+
)
174+
}
162175
Write-Host "::endgroup::"
163176

164177
Write-Host "::group::Build ExecuTorch (CUDA)"
165178
$numCores = [Math]::Max([Environment]::ProcessorCount - 1, 1)
166-
cmake --preset llm-release-cuda
179+
cmake --preset llm-release-cuda @cmakeCudaArgs
167180
cmake --build cmake-out --target install --config Release -j $numCores
168181
Write-Host "::endgroup::"
169182

170183
Write-Host "::group::Build $runnerTarget"
171184
Push-Location (Join-Path -Path $executorchRoot -ChildPath "examples\models\$runnerPath")
172185
try {
173-
cmake --preset $runnerPreset
186+
cmake --preset $runnerPreset @cmakeCudaArgs
174187
cmake --build (Join-Path -Path $executorchRoot -ChildPath "cmake-out\examples\models\$runnerPath") --target $runnerTarget --config Release -j $numCores
175188
}
176189
finally {

0 commit comments

Comments
 (0)