Skip to content

Commit 78bf436

Browse files
feat: add ROCm 6.4.3 support for RockyLinux-9 CUDA container images
1 parent 7535fb8 commit 78bf436

3 files changed

Lines changed: 112 additions & 0 deletions

File tree

.github/workflows/ci_linux.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
- name: RockyLinux-9 / CUDA-12.8.1 / x86_64
4949
image: "ghcr.io/rust-gpu/rust-cuda-rockylinux9-cuda12:latest"
5050
runner: ubuntu-latest
51+
- name: RockyLinux-9 / CUDA-12.8.1 / ROCm 6.4.3 / x86_64
52+
image: "ghcr.io/rust-gpu/rust-cuda-rockylinux9-cuda12-rocm6.4.3:latest"
53+
runner: ubuntu-latest
5154
outputs:
5255
# Output the result of the permission check
5356
actor_has_write_permission: ${{ steps.check_access.outputs.require-result }}
@@ -162,6 +165,9 @@ jobs:
162165
- name: RockyLinux-9 / CUDA-12.8.1 / x86_64
163166
image: "ghcr.io/rust-gpu/rust-cuda-rockylinux9-cuda12:latest"
164167
runner: ubuntu-latest
168+
- name: RockyLinux-9 / CUDA-12.8.1 / ROCm 6.4.3 / x86_64
169+
image: "ghcr.io/rust-gpu/rust-cuda-rockylinux9-cuda12-rocm6.4.3:latest"
170+
runner: ubuntu-latest
165171
steps:
166172
- name: Download build artifacts
167173
uses: actions/download-artifact@v4

.github/workflows/container_images.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
- name: RockyLinux-9/CUDA-12.8.1
4343
image: "rust-gpu/rust-cuda-rockylinux9-cuda12"
4444
dockerfile: ./container/rockylinux9-cuda12/Dockerfile
45+
- name: RockyLinux-9/CUDA-12.8.1-ROCm-6.4.3
46+
image: "rust-gpu/rust-cuda-rockylinux9-cuda12-rocm6.4.3"
47+
dockerfile: ./container/rockylinux9-cuda12-rocm6.4.3/Dockerfile
4548
steps:
4649
- name: Checkout repository
4750
uses: actions/checkout@v4
@@ -124,6 +127,8 @@ jobs:
124127
image: "rust-gpu/rust-cuda-ubuntu24-cuda12"
125128
- name: RockyLinux-9/CUDA-12.8.1
126129
image: "rust-gpu/rust-cuda-rockylinux9-cuda12"
130+
- name: RockyLinux-9/CUDA-12.8.1-ROCm-6.4.3
131+
image: "rust-gpu/rust-cuda-rockylinux9-cuda12-rocm6.4.3"
127132
steps:
128133
- name: Set artifact name
129134
run: |
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-rockylinux9
2+
3+
RUN dnf -y update && \
4+
dnf -y install \
5+
clang \
6+
openssl-devel \
7+
pkgconfig \
8+
redhat-rpm-config \
9+
which \
10+
xz \
11+
zlib-devel && \
12+
dnf clean all
13+
14+
# Needed to build `path_tracer`, `optix/ex03_window` example
15+
RUN dnf -y install \
16+
cmake \
17+
fontconfig-devel \
18+
libX11-devel \
19+
libXcursor-devel \
20+
libXi-devel \
21+
libXrandr-devel && \
22+
dnf clean all
23+
24+
# Get LLVM 7
25+
WORKDIR /data/llvm7
26+
27+
# Install dependencies for building LLVM
28+
RUN dnf -y install epel-release && \
29+
dnf -y install \
30+
libffi-devel \
31+
ncurses-devel \
32+
libxml2-devel \
33+
libedit-devel \
34+
python3 \
35+
make && \
36+
dnf clean all
37+
38+
# Download and build LLVM 7.1.0 for all architectures
39+
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
40+
tar -xf llvm-7.1.0.src.tar.xz && \
41+
cd llvm-7.1.0.src && \
42+
mkdir build && cd build && \
43+
ARCH=$(uname -m) && \
44+
if [ "$ARCH" = "x86_64" ]; then \
45+
TARGETS="X86;NVPTX"; \
46+
else \
47+
TARGETS="AArch64;NVPTX"; \
48+
fi && \
49+
cmake \
50+
-DCMAKE_BUILD_TYPE=Release \
51+
-DLLVM_TARGETS_TO_BUILD="$TARGETS" \
52+
-DLLVM_BUILD_LLVM_DYLIB=ON \
53+
-DLLVM_LINK_LLVM_DYLIB=ON \
54+
-DLLVM_ENABLE_ASSERTIONS=OFF \
55+
-DLLVM_ENABLE_BINDINGS=OFF \
56+
-DLLVM_INCLUDE_EXAMPLES=OFF \
57+
-DLLVM_INCLUDE_TESTS=OFF \
58+
-DLLVM_INCLUDE_BENCHMARKS=OFF \
59+
-DLLVM_ENABLE_ZLIB=ON \
60+
-DLLVM_ENABLE_TERMINFO=ON \
61+
-DCMAKE_INSTALL_PREFIX=/usr \
62+
.. && \
63+
make -j$(nproc) && \
64+
make install && \
65+
cd ../.. && \
66+
rm -rf llvm-7.1.0.src* && \
67+
ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7 && \
68+
dnf clean all
69+
70+
# Get Rust
71+
RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y
72+
ENV PATH="/root/.cargo/bin:${PATH}"
73+
74+
# Setup the workspace
75+
WORKDIR /data/rust-cuda
76+
RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/rust-cuda/rust-toolchain.toml \
77+
rustup show
78+
79+
# Add nvvm to LD_LIBRARY_PATH.
80+
ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}"
81+
ENV LLVM_LINK_STATIC=1
82+
ENV RUST_LOG=info
83+
84+
RUN dnf install -y https://repo.radeon.com/amdgpu-install/6.4.3/rhel/9.6/amdgpu-install-6.4.60403-1.el9.noarch.rpm && \
85+
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
86+
dnf install -y dnf-plugin-config-manager && \
87+
crb enable && \
88+
dnf install -y python3-setuptools python3-wheel ninja-build perl-core perl-devel openssl-devel && \
89+
dnf clean all
90+
91+
RUN \
92+
for ver in 6.4.3 6.4; do \
93+
printf '[ROCm-%s]\nname=ROCm%s\nbaseurl=https://repo.radeon.com/rocm/el9/%s/main\nenabled=1\npriority=50\ngpgcheck=1\ngpgkey=https://repo.radeon.com/rocm/rocm.gpg.key\n' "$ver" "$ver" "$ver" >> /etc/yum.repos.d/rocm.repo; \
94+
done && \
95+
dnf install rocm6.4.3 -y && \
96+
dnf clean all
97+
98+
# Add rocm libraries to LD_LIBRARY_PATH.
99+
ENV LD_LIBRARY_PATH="/opt/rocm/lib:${LD_LIBRARY_PATH}"
100+
# Add rocm binaries to PATH.
101+
ENV PATH="/opt/rocm/bin:${PATH}"

0 commit comments

Comments
 (0)