Skip to content

Commit 3295b72

Browse files
committed
compile the cuda kernels in CI on a gpu-less runner
1 parent 3a569b3 commit 3295b72

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,37 @@ jobs:
4545

4646
- name: Clippy
4747
run: cargo clippy --all-targets -- -D warnings
48+
49+
# Hosted runners have no GPU, so the kernels cannot run here. They still
50+
# compile: nvcc parses kernels.cu, the linker resolves every FFI symbol
51+
# against the real libraries, and a signature drift between ffi.rs and the
52+
# kernels fails in CI instead of on the next machine with a GPU. The parity
53+
# suite notices there is no device at runtime and skips itself.
54+
cuda-build:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Install Rust
60+
uses: dtolnay/rust-toolchain@stable
61+
62+
- name: Install CUDA toolkit (no driver, compile only)
63+
uses: Jimver/cuda-toolkit@v0.2.36
64+
with:
65+
cuda: '12.4.1'
66+
method: 'network'
67+
68+
- name: Cache cargo
69+
uses: actions/cache@v4
70+
with:
71+
path: |
72+
~/.cargo/registry
73+
~/.cargo/git
74+
target
75+
key: ${{ runner.os }}-cargo-cuda-${{ hashFiles('**/Cargo.lock') }}
76+
77+
- name: Build with the cuda feature
78+
run: cargo build --features cuda --all-targets
79+
80+
- name: Parity tests (self-skip without a device)
81+
run: cargo test --features cuda --test cuda_parity -- --test-threads=1

0 commit comments

Comments
 (0)