-
Notifications
You must be signed in to change notification settings - Fork 36
97 lines (91 loc) · 3.63 KB
/
windows-cuda.yml
File metadata and controls
97 lines (91 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Windows CUDA
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
PYTHON_VERSION: '3.12'
CUDA_CACHE_ROOT: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA"
jobs:
build-windows-cuda:
strategy:
fail-fast: false
matrix:
include:
# Windows Server 2025 + Visual Studio 2026 + CUDA 13.2.0
- name: "Windows Server 2025 + Visual Studio 2026 + CUDA 13.2.0 (Release)"
os: windows-2025-vs2026
cuda: "13.2.0"
visual_studio: "Visual Studio 18 2026"
solution: CubbyFlow.slnx
# Windows Server 2022 + Visual Studio 2022 + CUDA 12.6.3
- name: "Windows Server 2022 + Visual Studio 2022 + CUDA 12.6.3 (Release)"
os: windows-2022
cuda: "12.6.3"
visual_studio: "Visual Studio 17 2022"
solution: CubbyFlow.sln
runs-on: ${{ matrix.os }}
name: 🪟 CUDA Build - ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install CUDA
shell: powershell
env:
cuda: ${{ matrix.cuda }}
visual_studio: ${{ matrix.visual_studio }}
run: |
.\.github\workflows\scripts\actions\install_cuda_windows.ps1
$cudaMajorMinor = ([regex]::Match("${{ matrix.cuda }}", "^\d+\.\d+")).Value
if (-not $cudaMajorMinor) {
throw "Failed to parse CUDA major.minor version from '${{ matrix.cuda }}'."
}
$cudaVersionVarName = "CUDA_PATH_V$($cudaMajorMinor.Replace('.', '_'))"
$cudaPath = [Environment]::GetEnvironmentVariable($cudaVersionVarName, "Machine")
if (-not $cudaPath) {
$cudaPath = "$env:CUDA_CACHE_ROOT\v$cudaMajorMinor"
}
if (-not (Test-Path $cudaPath)) {
throw "CUDA path '$cudaPath' does not exist."
}
$nvccExe = Join-Path $cudaPath "bin\nvcc.exe"
if (-not (Test-Path $nvccExe)) {
throw "nvcc executable '$nvccExe' does not exist."
}
"CUDA_PATH=$cudaPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"$cudaVersionVarName=$cudaPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"CUDAToolkitDir=$cudaPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"$cudaPath\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
& $nvccExe -V
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Configure Build
shell: powershell
run: |
$nvccExe = Join-Path $env:CUDA_PATH "bin\nvcc.exe"
if (-not (Test-Path $nvccExe)) {
throw "nvcc executable '$nvccExe' does not exist."
}
New-Item -ItemType Directory -Path build -Force | Out-Null
cmake -S . -B build -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_BUILD_TYPE=Release -DUSE_CUDA=ON -DCUDA_CRT_LINKAGE=dynamic -DCMAKE_CUDA_COMPILER="$nvccExe" -DCUDAToolkit_ROOT="$env:CUDA_PATH"
- name: Build
shell: powershell
run: MSBuild.exe "build\\${{ matrix.solution }}" /p:Configuration=Release
- name: Run CUDA Unit Test
shell: powershell
run: |
$nvidiaSmi = Get-Command "nvidia-smi.exe" -ErrorAction SilentlyContinue
if ($null -ne $nvidiaSmi) {
& nvidia-smi.exe -L | Out-Host
if ($LASTEXITCODE -eq 0) {
& /a/CubbyFlow/CubbyFlow/build/bin/Release/CUDATests.exe
exit $LASTEXITCODE
}
}
Write-Host "No CUDA-capable GPU detected on runner. Skipping CUDA unit tests."