Skip to content

Commit 4d741e9

Browse files
authored
Merge pull request #93 from filecoin-project/galargh-patch-1
ci: test gpu on self-hosted runners
2 parents 79c63a4 + 628df83 commit 4d741e9

File tree

1 file changed

+34
-14
lines changed

1 file changed

+34
-14
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
name: CI
22

3-
on: [pull_request, push]
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
48

5-
# Cancel a job if there's a new on on the same branch started.
9+
# Cancel a job if there's a new one on the same branch started.
610
# Based on https://stackoverflow.com/questions/58895283/stop-already-running-workflow-job-in-github-actions/67223051#67223051
711
concurrency:
812
group: ${{ github.ref }}
@@ -48,15 +52,31 @@ jobs:
4852
- name: Run cargo release build
4953
run: cargo build --release
5054

51-
# Enable these tests once there's a runner with a GPU.
52-
#test_gpu:
53-
# runs-on: ubuntu-24.04
54-
# name: Test
55-
# steps:
56-
# - uses: actions/checkout@v4
57-
# - name: Install required packages
58-
# run: sudo apt install --no-install-recommends --yes libhwloc-dev nvidia-cuda-toolkit ocl-icd-opencl-dev
59-
# - name: Run tests
60-
# run: cargo test
61-
# - name: Run `add` example
62-
# run: cargo run --example add
55+
test_gpu:
56+
runs-on: ['self-hosted', 'linux', 'x64', '2xlarge+gpu']
57+
name: Test
58+
steps:
59+
- uses: actions/checkout@v4
60+
# TODO: Move the driver installation to the AMI.
61+
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-nvidia-driver.html
62+
# https://www.nvidia.com/en-us/drivers/
63+
- name: Install CUDA drivers
64+
run: |
65+
curl -L -o nvidia-driver-local-repo-ubuntu2404-570.148.08_1.0-1_amd64.deb https://us.download.nvidia.com/tesla/570.148.08/nvidia-driver-local-repo-ubuntu2404-570.148.08_1.0-1_amd64.deb
66+
sudo dpkg -i nvidia-driver-local-repo-ubuntu2404-570.148.08_1.0-1_amd64.deb
67+
sudo cp /var/nvidia-driver-local-repo-ubuntu2404-570.148.08/nvidia-driver-local-*-keyring.gpg /usr/share/keyrings/
68+
sudo apt-get update
69+
sudo apt-get install --no-install-recommends --yes cuda-drivers
70+
rm nvidia-driver-local-repo-ubuntu2404-570.148.08_1.0-1_amd64.deb
71+
- name: Install required packages
72+
run: |
73+
sudo apt-get update
74+
sudo apt-get install --no-install-recommends --yes libhwloc-dev nvidia-cuda-toolkit ocl-icd-opencl-dev
75+
# TODO: Remove this and other rust installation directives from jobs running
76+
- uses: dtolnay/rust-toolchain@21dc36fb71dd22e3317045c0c31a3f4249868b17
77+
with:
78+
toolchain: 1.81
79+
- name: Run tests
80+
run: cargo test
81+
- name: Run `add` example
82+
run: cargo run --example add

0 commit comments

Comments
 (0)