Skip to content

Commit 8789be7

Browse files
authored
ci: add CUDA and rocm builds
Differential Revision: D92460035 Pull Request resolved: #488
1 parent d8d0f77 commit 8789be7

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

.github/workflows/build-cuda.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
name: CI-CUDA
3+
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
permissions: read-all
11+
12+
jobs:
13+
build-cuda:
14+
name: build with CUDA ${{ matrix.cuda_version }}
15+
runs-on: ubuntu-22.04
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
cuda_version: ["11.8.0", "12.4.0"]
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
with:
25+
persist-credentials: false
26+
27+
- name: Free disk space
28+
run: |
29+
sudo rm -rf /usr/share/dotnet
30+
sudo rm -rf /usr/local/lib/android
31+
sudo rm -rf /opt/ghc
32+
33+
- name: Install CUDA toolkit
34+
uses: Jimver/cuda-toolkit@4bd727d5619dc6fa323b1e76c3aa5dca94f5ec6d # v0.2.19
35+
id: cuda-toolkit
36+
with:
37+
cuda: ${{ matrix.cuda_version }}
38+
method: network
39+
sub-packages: '["nvcc", "cudart-dev"]'
40+
41+
- name: Install apt packages
42+
run: |
43+
sudo apt-get update
44+
sudo apt-get install -y wget build-essential cmake libibverbs-dev
45+
46+
- name: Install libuv
47+
run: |
48+
wget -q -O libuv-v1.49.2.tar.gz https://dist.libuv.org/dist/v1.49.2/libuv-v1.49.2.tar.gz
49+
tar xf libuv-v1.49.2.tar.gz
50+
cd libuv-v1.49.2
51+
mkdir -p build
52+
cd build
53+
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local
54+
sudo make install
55+
56+
- name: Build with CUDA
57+
run: |
58+
mkdir -p build
59+
cd build
60+
cmake ../ \
61+
-DCMAKE_VERBOSE_MAKEFILE=ON \
62+
-DUSE_CUDA=ON \
63+
-DGLOO_USE_CUDA_TOOLKIT=ON \
64+
-DUSE_LIBUV=ON \
65+
-DUSE_IBVERBS=ON
66+
make -j"$(nproc)"

.github/workflows/build-rocm.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: CI-ROCm
3+
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
permissions: read-all
11+
12+
jobs:
13+
build-rocm:
14+
name: build with ROCm ${{ matrix.rocm_version }}
15+
runs-on: ubuntu-22.04
16+
container:
17+
image: rocm/dev-ubuntu-22.04:${{ matrix.rocm_version }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
rocm_version: ["6.0", "6.2"]
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
with:
27+
persist-credentials: false
28+
29+
- name: Install apt packages
30+
run: |
31+
apt-get update
32+
apt-get install -y wget build-essential cmake libibverbs-dev python3 pkg-config
33+
34+
- name: Install libuv
35+
run: |
36+
wget -q -O libuv-v1.49.2.tar.gz https://dist.libuv.org/dist/v1.49.2/libuv-v1.49.2.tar.gz
37+
tar xf libuv-v1.49.2.tar.gz
38+
cd libuv-v1.49.2
39+
mkdir -p build
40+
cd build
41+
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local
42+
make install
43+
44+
- name: Build with ROCm
45+
env:
46+
ROCM_PATH: /opt/rocm
47+
GLOO_ROCM_ARCH: gfx906;gfx908;gfx90a;gfx942
48+
run: |
49+
mkdir -p build
50+
cd build
51+
cmake ../ \
52+
-DCMAKE_VERBOSE_MAKEFILE=ON \
53+
-DUSE_ROCM=ON \
54+
-DUSE_LIBUV=ON \
55+
-DUSE_IBVERBS=ON \
56+
-DCMAKE_PREFIX_PATH=/opt/rocm \
57+
-DCMAKE_HIP_COMPILER=/opt/rocm/bin/hipcc
58+
make -j"$(nproc)"

0 commit comments

Comments
 (0)