Skip to content

ci: install nvidia driver in workflow (PROOF-911) #102

ci: install nvidia driver in workflow (PROOF-911)

ci: install nvidia driver in workflow (PROOF-911) #102

Workflow file for this run

name: Test-Check-Lint
on:
workflow_call:
pull_request:
types:
- opened
- synchronize
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# format-code:
# name: Check Code
# runs-on: nvidia-nc4as-t4
# steps:
# - name: Checkout Code Format
# uses: actions/checkout@v3
# - run: docker run --rm -v "$PWD":/src:ro -w /src --privileged rust:1.80 /bin/bash -c "cp -av /src/ /src_tmp/; cd /src_tmp; rustup component add rustfmt; cargo fmt --all -- --config imports_granularity=Crate,group_imports=One --check"
# clippy-code:
# name: Clippy Code
# runs-on: nvidia-nc4as-t4
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# - run: docker run --rm -v "$PWD":/src:ro -w /src --privileged rust:1.80 /bin/bash -c "cp -av /src/ /src_tmp/; cd /src_tmp; rustup component add clippy; cargo clippy --all-targets --all-features -- -D warnings"
# test-cpu:
# name: Test the CPU backend
# runs-on: nvidia-nc4as-t4
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# - run: docker run --rm -v "$PWD":/src:ro -w /src --privileged rust:1.80 /bin/bash -c "cp -av /src/ /src_tmp/; cd /src_tmp; cargo test --features cpu"
test-gpu:
name: Test the GPU backend
runs-on: nvidia-nc4as-t4
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-test-
${{ runner.os }}-cargo-
${{ runner.os }}-
- name: Install stable toolchain
run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env
- name: Install Dependencies
run: |
export DEBIAN_FRONTEND=non-interactive
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install -y nvidia-open-560 nvidia-container-runtime
- name: Run GPU test
run: docker run --rm -v "$PWD":/src:ro -w /src --gpus all --privileged nvidia/cuda:12.6.1-runtime-ubuntu24.04 /bin/bash -c "cp -av /src/ /src_tmp/; cd /src_tmp; cargo test --features gpu"