Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Deprecate repository #28

Deprecate repository

Deprecate repository #28

Workflow file for this run

name: era-cuda build and test
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
era-cuda-build:
runs-on: [ubuntu-latest]
strategy:
matrix:
cuda: ["12.0.0-devel-ubuntu20.04", "12.5.0-devel-ubuntu20.04"]
container:
image: nvidia/cuda:${{ matrix.cuda }}
steps:
- name: Prepare environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt update && apt install -y libclang-dev wget jq
echo "/usr/local/nvidia/bin:/usr/local/cuda/bin" >> $GITHUB_PATH
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3
- name: Setup rustup
run: |
wget -q -O - https://sh.rustup.rs | bash -s -- -y
echo "${HOME}/.cargo/bin" >> "${GITHUB_PATH}"
echo "export PATH=\"$HOME/.cargo/bin:\$PATH\"" >> "${HOME}/.bash_profile"
- name: Check CUDA version
run: |
nvcc --version
- name: Setup rust
run: |
rustup set profile minimal
rustup toolchain install nightly-2024-05-07
rustup default nightly-2024-05-07
- name: Build tests and copy binaries to a separate dir
shell: bash
run: |
mkdir artifacts
CARGO_TARGET_DIR=./build \
cargo +nightly-2024-05-07 test --no-run --release --message-format=json -q \
| jq -r 'select(.executable != null) | .executable' \
| while read binary; do
cp "$binary" artifacts/
done
- name: Upload test binaries as a single artifact
uses: actions/upload-artifact@v3
with:
name: era-cuda-${{ matrix.cuda }}-test-binaries
path: artifacts/
if-no-files-found: error
era-cuda-test:
runs-on: [matterlabs-ci-gpu-runner]
needs: era-cuda-build
steps:
- name: Prepare environment
run: |
echo "/usr/local/nvidia/bin:/usr/local/cuda/bin" >> $GITHUB_PATH
- name: Check Nvidia driver version
run: |
nvidia-smi
- name: Download test binaries built with CUDA 12.0
uses: actions/download-artifact@v3
with:
name: era-cuda-12.0.0-devel-ubuntu20.04-test-binaries
path: era-cuda-test-binaries/12.0
- name: Download test binaries built with CUDA 12.5
uses: actions/download-artifact@v3
with:
name: era-cuda-12.5.0-devel-ubuntu20.04-test-binaries
path: era-cuda-test-binaries/12.5
- name: Run test binaries built with CUDA 12.5
id: test_cuda_12_5
continue-on-error: true
run: |
for binary in era-cuda-test-binaries/12.5/*; do
chmod +x $binary
$binary
done
- name: Run test binaries built with CUDA 12.0
if: steps.test_cuda_12_5.outcome == 'failure' || steps.test_cuda_12_5.outcome == 'success'
run: |
for binary in era-cuda-test-binaries/12.0/*; do
chmod +x $binary
$binary
done