Skip to content

Commit 48ecf18

Browse files
nnethercoteLegNeato
authored andcommitted
Add Dockerfiles for CUDA 13.
For both Ubuntu 24.04 and RockyLinux 9. Both files are just copies of the respective CUDA 12 Dockerfiles with `12.8.1` changed to `13.0.2`. Also include them in the container image jobs on CI.
1 parent 2e499e8 commit 48ecf18

File tree

3 files changed

+191
-0
lines changed

3 files changed

+191
-0
lines changed

.github/workflows/container_images.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ jobs:
3333
- name: Ubuntu-24.04/CUDA-12.8.1
3434
image: "rust-gpu/rust-cuda-ubuntu24-cuda12"
3535
dockerfile: ./container/ubuntu24-cuda12/Dockerfile
36+
- name: Ubuntu-24.04/CUDA-13.0.2
37+
image: "rust-gpu/rust-cuda-ubuntu24-cuda13"
38+
dockerfile: ./container/ubuntu24-cuda13/Dockerfile
3639
- name: RockyLinux-9/CUDA-12.8.1
3740
image: "rust-gpu/rust-cuda-rockylinux9-cuda12"
3841
dockerfile: ./container/rockylinux9-cuda12/Dockerfile
42+
- name: RockyLinux-9/CUDA-13.0.2
43+
image: "rust-gpu/rust-cuda-rockylinux9-cuda13"
44+
dockerfile: ./container/rockylinux9-cuda13/Dockerfile
3945
steps:
4046
- name: Free up space
4147
# Without this the job will likely run out of disk space.
@@ -153,8 +159,12 @@ jobs:
153159
variance:
154160
- name: Ubuntu-24.04/CUDA-12.8.1
155161
image: "rust-gpu/rust-cuda-ubuntu24-cuda12"
162+
- name: Ubuntu-24.04/CUDA-13.0.2
163+
image: "rust-gpu/rust-cuda-ubuntu24-cuda13"
156164
- name: RockyLinux-9/CUDA-12.8.1
157165
image: "rust-gpu/rust-cuda-rockylinux9-cuda12"
166+
- name: RockyLinux-9/CUDA-13.0.2
167+
image: "rust-gpu/rust-cuda-rockylinux9-cuda13"
158168
steps:
159169
- name: Set artifact name
160170
run: |
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
FROM nvcr.io/nvidia/cuda:13.0.2-cudnn-devel-rockylinux9 AS llvm-builder
2+
3+
RUN dnf -y install \
4+
--nobest \
5+
--allowerasing \
6+
--setopt=install_weak_deps=False \
7+
openssl-devel \
8+
pkgconfig \
9+
which \
10+
xz \
11+
zlib-devel \
12+
libffi-devel \
13+
ncurses-devel \
14+
libxml2-devel \
15+
libedit-devel \
16+
python3 \
17+
make \
18+
cmake && \
19+
dnf clean all
20+
21+
WORKDIR /data/llvm7
22+
23+
# Download and build LLVM 7.1.0 for all architectures.
24+
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
25+
tar -xf llvm-7.1.0.src.tar.xz && \
26+
cd llvm-7.1.0.src && \
27+
mkdir build && cd build && \
28+
ARCH=$(uname -m) && \
29+
if [ "$ARCH" = "x86_64" ]; then \
30+
TARGETS="X86;NVPTX"; \
31+
else \
32+
TARGETS="AArch64;NVPTX"; \
33+
fi && \
34+
cmake \
35+
-DCMAKE_BUILD_TYPE=Release \
36+
-DLLVM_TARGETS_TO_BUILD="$TARGETS" \
37+
-DLLVM_BUILD_LLVM_DYLIB=ON \
38+
-DLLVM_LINK_LLVM_DYLIB=ON \
39+
-DLLVM_ENABLE_ASSERTIONS=OFF \
40+
-DLLVM_ENABLE_BINDINGS=OFF \
41+
-DLLVM_INCLUDE_EXAMPLES=OFF \
42+
-DLLVM_INCLUDE_TESTS=OFF \
43+
-DLLVM_INCLUDE_BENCHMARKS=OFF \
44+
-DLLVM_ENABLE_ZLIB=ON \
45+
-DLLVM_ENABLE_TERMINFO=ON \
46+
-DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
47+
.. && \
48+
make -j$(nproc) && \
49+
make install && \
50+
cd ../.. && \
51+
rm -rf llvm-7.1.0.src* && \
52+
dnf clean all
53+
54+
FROM nvcr.io/nvidia/cuda:13.0.2-cudnn-devel-rockylinux9
55+
56+
RUN dnf -y install \
57+
--nobest \
58+
--allowerasing \
59+
--setopt=install_weak_deps=False \
60+
clang \
61+
openssl-devel \
62+
fontconfig-devel \
63+
libX11-devel \
64+
libXcursor-devel \
65+
libXi-devel \
66+
libXrandr-devel \
67+
libxml2-devel \
68+
ncurses-devel \
69+
pkgconfig \
70+
which \
71+
xz \
72+
zlib-devel \
73+
cmake && \
74+
dnf clean all
75+
76+
COPY --from=llvm-builder /opt/llvm-7 /opt/llvm-7
77+
RUN ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config && \
78+
ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config-7
79+
80+
# Get Rust (install rustup; toolchain installed from rust-toolchain.toml below)
81+
RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y --profile minimal --default-toolchain none
82+
ENV PATH="/root/.cargo/bin:${PATH}"
83+
84+
# Setup the workspace
85+
WORKDIR /data/rust-cuda
86+
RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/rust-cuda/rust-toolchain.toml \
87+
rustup show
88+
89+
# Add nvvm to LD_LIBRARY_PATH.
90+
ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}"
91+
ENV LLVM_LINK_STATIC=1
92+
ENV RUST_LOG=info
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
FROM nvcr.io/nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04 AS llvm-builder
2+
3+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
4+
build-essential \
5+
clang \
6+
curl \
7+
libffi-dev \
8+
libedit-dev \
9+
libncurses5-dev \
10+
libssl-dev \
11+
libtinfo-dev \
12+
libxml2-dev \
13+
cmake \
14+
ninja-build \
15+
pkg-config \
16+
python3 \
17+
xz-utils \
18+
zlib1g-dev && \
19+
rm -rf /var/lib/apt/lists/*
20+
21+
WORKDIR /data/llvm7
22+
23+
# Download and build LLVM 7.1.0 for all architectures.
24+
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
25+
tar -xf llvm-7.1.0.src.tar.xz && \
26+
cd llvm-7.1.0.src && \
27+
mkdir build && cd build && \
28+
ARCH=$(dpkg --print-architecture) && \
29+
if [ "$ARCH" = "amd64" ]; then \
30+
TARGETS="X86;NVPTX"; \
31+
else \
32+
TARGETS="AArch64;NVPTX"; \
33+
fi && \
34+
cmake -G Ninja \
35+
-DCMAKE_BUILD_TYPE=Release \
36+
-DLLVM_TARGETS_TO_BUILD="$TARGETS" \
37+
-DLLVM_BUILD_LLVM_DYLIB=ON \
38+
-DLLVM_LINK_LLVM_DYLIB=ON \
39+
-DLLVM_ENABLE_ASSERTIONS=OFF \
40+
-DLLVM_ENABLE_BINDINGS=OFF \
41+
-DLLVM_INCLUDE_EXAMPLES=OFF \
42+
-DLLVM_INCLUDE_TESTS=OFF \
43+
-DLLVM_INCLUDE_BENCHMARKS=OFF \
44+
-DLLVM_ENABLE_ZLIB=ON \
45+
-DLLVM_ENABLE_TERMINFO=ON \
46+
-DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
47+
.. && \
48+
ninja -j$(nproc) && \
49+
ninja install && \
50+
cd ../.. && \
51+
rm -rf llvm-7.1.0.src*
52+
53+
FROM nvcr.io/nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04
54+
55+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
56+
build-essential \
57+
clang \
58+
curl \
59+
libssl-dev \
60+
libtinfo-dev \
61+
pkg-config \
62+
xz-utils \
63+
zlib1g-dev \
64+
cmake \
65+
libfontconfig-dev \
66+
libx11-xcb-dev \
67+
libxcursor-dev \
68+
libxi-dev \
69+
libxinerama-dev \
70+
libxrandr-dev && \
71+
rm -rf /var/lib/apt/lists/*
72+
73+
COPY --from=llvm-builder /opt/llvm-7 /opt/llvm-7
74+
RUN ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config && \
75+
ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config-7
76+
77+
# Get Rust (install rustup; toolchain installed from rust-toolchain.toml below)
78+
RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y --profile minimal --default-toolchain none
79+
ENV PATH="/root/.cargo/bin:${PATH}"
80+
81+
# Setup the workspace
82+
WORKDIR /data/rust-cuda
83+
RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/rust-cuda/rust-toolchain.toml \
84+
rustup show
85+
86+
# Add nvvm to LD_LIBRARY_PATH.
87+
ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}"
88+
ENV LLVM_LINK_STATIC=1
89+
ENV RUST_LOG=info

0 commit comments

Comments
 (0)