@@ -125,6 +125,131 @@ jobs:
125125 retention-days : ${{ github.repository == 'NVIDIA/warp' && 7 || 1 }}
126126
127127
128+ build-warp-cmake :
129+ if : github.event_name != 'schedule' || github.repository == 'NVIDIA/warp'
130+ runs-on : ${{ matrix.os }}
131+ permissions :
132+ contents : read
133+ strategy :
134+ fail-fast : false
135+ matrix :
136+ include :
137+ - os : windows-2025
138+ platform : windows
139+ cuda-version : " 13.0.2"
140+ cuda-sub-packages : ' ["cudart", "crt", "nvcc", "nvrtc_dev", "nvjitlink", "nvvm", "nvptxcompiler"]'
141+ cuda-non-cuda-packages : ' '
142+ warp-cache-root-suffix : ' \warp-cache-cmake'
143+ - os : ubuntu-24.04
144+ platform : ubuntu-x86_64
145+ cuda-version : " 13.0.2"
146+ cuda-sub-packages : ' ["cudart-dev", "nvcc", "nvrtc-dev"]'
147+ cuda-non-cuda-packages : ' ["libnvjitlink-dev"]'
148+ warp-cache-root-suffix : /warp-cache-cmake
149+ - os : ubuntu-24.04-arm
150+ platform : ubuntu-aarch64
151+ cuda-version : " 13.0.2"
152+ cuda-sub-packages : ' ["cudart-dev", "nvcc", "nvrtc-dev"]'
153+ cuda-non-cuda-packages : ' ["libnvjitlink-dev"]'
154+ warp-cache-root-suffix : /warp-cache-cmake
155+ steps :
156+ - name : Checkout repository
157+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
158+ with :
159+ persist-credentials : false
160+ lfs : true
161+
162+ - name : Install uv
163+ uses : astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
164+ with :
165+ version : " 0.11.16"
166+
167+ - name : Set up Python
168+ run : uv python install
169+
170+ - name : Install CTK (with non-CUDA packages)
171+ if : matrix.cuda-sub-packages != '' && matrix.cuda-non-cuda-packages != ''
172+ uses : Jimver/cuda-toolkit@3d45d157f327c09c04b50ee6ccdea2d9d017ec76 # v0.2.35
173+ with :
174+ cuda : ${{ matrix.cuda-version }}
175+ sub-packages : ${{ matrix.cuda-sub-packages }}
176+ non-cuda-sub-packages : ${{ matrix.cuda-non-cuda-packages }}
177+ method : ' network'
178+
179+ - name : Install CTK (without non-CUDA packages)
180+ if : matrix.cuda-sub-packages != '' && matrix.cuda-non-cuda-packages == ''
181+ uses : Jimver/cuda-toolkit@3d45d157f327c09c04b50ee6ccdea2d9d017ec76 # v0.2.35
182+ with :
183+ cuda : ${{ matrix.cuda-version }}
184+ sub-packages : ${{ matrix.cuda-sub-packages }}
185+ method : ' network'
186+
187+ - name : Print build tool versions
188+ run : |
189+ cmake --version
190+ ninja --version
191+
192+ - name : Prepare Python environment for CMake codegen
193+ run : uv sync --no-install-project
194+
195+ - name : Set up MSVC developer environment
196+ if : matrix.platform == 'windows'
197+ run : |
198+ $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
199+ $vsPath = & $vswhere -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
200+ $vsDevCmd = Join-Path $vsPath "Common7\Tools\VsDevCmd.bat"
201+ if (!(Test-Path $vsDevCmd)) {
202+ throw "VsDevCmd.bat was not found"
203+ }
204+
205+ $before = @{}
206+ Get-ChildItem Env: | ForEach-Object { $before[$_.Name] = $_.Value }
207+ cmd /c "`"$vsDevCmd`" -arch=x64 -host_arch=x64 > nul && set" |
208+ ForEach-Object {
209+ $name, $value = $_ -split '=', 2
210+ if ($name -and $before[$name] -ne $value) {
211+ "$name=$value" >> $env:GITHUB_ENV
212+ }
213+ }
214+
215+ - name : Build Warp with CMake
216+ if : matrix.platform != 'windows'
217+ env :
218+ WARP_CACHE_ROOT : ${{ runner.temp }}${{ matrix.warp-cache-root-suffix }}
219+ WARP_CACHE_PATH : ${{ runner.temp }}${{ matrix.warp-cache-root-suffix }}
220+ run : |
221+ cuda_path="${CUDA_HOME:-${CUDA_PATH:-}}"
222+ if [ -z "$cuda_path" ]; then
223+ echo "CUDA_HOME or CUDA_PATH must be set" >&2
224+ exit 1
225+ fi
226+ cmake -S . -B _build/cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DWARP_CUDA_PATH:PATH="$cuda_path"
227+ cmake --build _build/cmake --parallel
228+
229+ - name : Build Warp with CMake
230+ if : matrix.platform == 'windows'
231+ env :
232+ WARP_CACHE_ROOT : ${{ runner.temp }}${{ matrix.warp-cache-root-suffix }}
233+ WARP_CACHE_PATH : ${{ runner.temp }}${{ matrix.warp-cache-root-suffix }}
234+ run : |
235+ if (!$env:CUDA_PATH) {
236+ throw "CUDA_PATH must be set"
237+ }
238+ cmake -S . -B _build/cmake -G Ninja `
239+ -DCMAKE_BUILD_TYPE=Release `
240+ -DCMAKE_C_COMPILER=cl `
241+ -DCMAKE_CXX_COMPILER=cl `
242+ "-DWARP_CUDA_PATH:PATH=$env:CUDA_PATH"
243+ cmake --build _build/cmake --parallel
244+
245+ - name : Verify Warp diagnostics
246+ env :
247+ WARP_CACHE_ROOT : ${{ runner.temp }}${{ matrix.warp-cache-root-suffix }}
248+ WARP_CACHE_PATH : ${{ runner.temp }}${{ matrix.warp-cache-root-suffix }}
249+ run : |
250+ uv run python -c "import warp; info = warp.print_diagnostics(); assert not info['warp_native'].startswith('unknown'); assert not info['warp_clang'].startswith('unknown')"
251+
252+
128253 test-warp-cpu :
129254 if : github.event_name != 'schedule' || github.repository == 'NVIDIA/warp'
130255 runs-on : ${{ matrix.os }}
0 commit comments