Skip to content

Commit b273366

Browse files
committed
ci: Fix configure on Windows CUDA
1 parent 3d70953 commit b273366

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/windows-cuda.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,19 @@ jobs:
6363
throw "nvcc executable '$nvccExe' does not exist."
6464
}
6565
"CUDA_PATH=$cudaPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
66+
"$cudaVersionVarName=$cudaPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
67+
"CUDAToolkitDir=$cudaPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
6668
"$cudaPath\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
6769
& $nvccExe -V
6870
- name: Add MSBuild to PATH
6971
uses: microsoft/setup-msbuild@v2
7072
- name: Configure Build
71-
run: mkdir build && cd build && cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_BUILD_TYPE=Release -DUSE_CUDA=ON ..
73+
shell: powershell
74+
run: |
75+
$nvccExe = Join-Path $env:CUDA_PATH "bin\nvcc.exe"
76+
if (-not (Test-Path $nvccExe)) {
77+
throw "nvcc executable '$nvccExe' does not exist."
78+
}
79+
mkdir build && cd build && cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_BUILD_TYPE=Release -DUSE_CUDA=ON -DCUDA_CRT_LINKAGE=dynamic -DCMAKE_CUDA_COMPILER="$nvccExe" -DCUDAToolkit_ROOT="$env:CUDA_PATH" ..
7280
- name: Build
7381
run: cd build && MSBuild.exe ${{ matrix.solution }} /p:Configuration=Release

0 commit comments

Comments
 (0)