Add CUDA 12 to CI #299
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust CI | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
push: | |
paths-ignore: | |
- '**.md' | |
env: | |
RUST_LOG: info | |
RUST_BACKTRACE: 1 | |
jobs: | |
rust: | |
name: Rust on ${{ matrix.os }} with CUDA ${{ matrix.cuda }} | |
runs-on: ${{ matrix.os }} | |
env: | |
LLVM_LINK_STATIC: 1 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
target: x86_64-unknown-linux-gnu | |
cuda: '11.2.2' | |
linux-local-args: ["--toolkit"] | |
- os: ubuntu-24.04 | |
target: x86_64-unknown-linux-gnu | |
cuda: '12.8.1' | |
linux-local-args: ["--toolkit"] | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
cuda: '11.2.2' | |
linux-local-args: [] | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
cuda: '12.8.1' | |
linux-local-args: [] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install CUDA | |
uses: Jimver/[email protected] | |
id: cuda-toolkit | |
with: | |
cuda: ${{ matrix.cuda }} | |
linux-local-args: ${{ toJson(matrix.linux-local-args) }} | |
- name: Verify CUDA installation | |
run: nvcc --version | |
- name: List CUDA_PATH files (Linux) | |
if: runner.os == 'Linux' | |
run: find "$CUDA_PATH" -type f | |
- name: List CUDA_PATH files (Windows) | |
if: runner.os == 'Windows' | |
shell: pwsh | |
run: Get-ChildItem -Path $env:CUDA_PATH -Recurse | ForEach-Object { $_.FullName } | |
# random command that forces rustup to install stuff in rust-toolchain | |
- name: Install rust-toolchain | |
run: cargo version | |
- name: Add rustup components | |
run: rustup component add rustfmt clippy | |
- name: Install libffi7 for LLVM 7 | |
if: matrix.os == 'ubuntu-24.04' | |
run: | | |
wget http://archive.ubuntu.com/ubuntu/pool/universe/libf/libffi/libffi7_3.3-4_amd64.deb | |
sudo dpkg -i libffi7_3.3-4_amd64.deb | |
- name: Install LLVM 7 | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
mkdir -p ~/llvm7 && cd ~/llvm7 | |
wget http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7_7.0.1-12_amd64.deb \ | |
http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/libllvm7_7.0.1-12_amd64.deb \ | |
http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-runtime_7.0.1-12_amd64.deb | |
sudo apt-get update | |
sudo apt-get install -y ./*.deb | |
sudo ln -s /usr/bin/llvm-config-7 /usr/local/bin/llvm-config | |
- name: Load Rust Cache | |
uses: Swatinem/rust-cache@v1 | |
- name: Rustfmt | |
if: contains(matrix.os, 'ubuntu') | |
run: cargo fmt --all -- --check | |
- name: Build | |
run: cargo build --workspace --exclude "optix" --exclude "path_tracer" --exclude "denoiser" --exclude "add" --exclude "ex*" | |
# Don't currently test because many tests rely on the system having a CUDA GPU | |
# - name: Test | |
# run: cargo test --workspace | |
- name: Clippy | |
if: contains(matrix.os, 'ubuntu') | |
env: | |
RUSTFLAGS: -Dwarnings | |
run: cargo clippy --workspace --exclude "optix" --exclude "path_tracer" --exclude "denoiser" --exclude "add" --exclude "ex*" | |
- name: Check documentation | |
env: | |
RUSTDOCFLAGS: -Dwarnings | |
run: cargo doc --workspace --all-features --document-private-items --no-deps --exclude "optix" --exclude "path_tracer" --exclude "denoiser" --exclude "add" --exclude "ex*" |