Skip to content

Commit 9dc2245

Browse files
committed
Multi-stage docker images
And remove the rust cache as it likely is not helping
1 parent a51d85f commit 9dc2245

6 files changed

Lines changed: 167 additions & 142 deletions

File tree

.github/workflows/ci_linux.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ jobs:
7373
nvcc --version
7474
rustup show
7575
76-
- name: Load Rust cache
77-
uses: Swatinem/rust-cache@v2
78-
with:
79-
key: ${{ matrix.variance.name }}-${{ github.sha }}
80-
8176
- name: Rustfmt
8277
run: cargo fmt --all -- --check
8378

container/rockylinux9-cuda12/Dockerfile

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-rockylinux9
1+
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-rockylinux9 AS llvm-builder
22

33
RUN dnf -y update && \
44
dnf -y install \
@@ -8,25 +8,7 @@ RUN dnf -y update && \
88
redhat-rpm-config \
99
which \
1010
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 \
11+
zlib-devel \
3012
libffi-devel \
3113
ncurses-devel \
3214
libxml2-devel \
@@ -35,7 +17,9 @@ RUN dnf -y install epel-release && \
3517
make && \
3618
dnf clean all
3719

38-
# Download and build LLVM 7.1.0 for all architectures
20+
WORKDIR /data/llvm7
21+
22+
# Download and build LLVM 7.1.0 for all architectures.
3923
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
4024
tar -xf llvm-7.1.0.src.tar.xz && \
4125
cd llvm-7.1.0.src && \
@@ -58,15 +42,37 @@ RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmo
5842
-DLLVM_INCLUDE_BENCHMARKS=OFF \
5943
-DLLVM_ENABLE_ZLIB=ON \
6044
-DLLVM_ENABLE_TERMINFO=ON \
61-
-DCMAKE_INSTALL_PREFIX=/usr \
45+
-DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
6246
.. && \
6347
make -j$(nproc) && \
6448
make install && \
6549
cd ../.. && \
6650
rm -rf llvm-7.1.0.src* && \
67-
ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7 && \
6851
dnf clean all
6952

53+
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-rockylinux9
54+
55+
RUN dnf -y update && \
56+
dnf -y install \
57+
clang \
58+
openssl-devel \
59+
pkgconfig \
60+
redhat-rpm-config \
61+
which \
62+
xz \
63+
zlib-devel \
64+
cmake \
65+
fontconfig-devel \
66+
libX11-devel \
67+
libXcursor-devel \
68+
libXi-devel \
69+
libXrandr-devel && \
70+
dnf clean all
71+
72+
COPY --from=llvm-builder /opt/llvm-7 /opt/llvm-7
73+
RUN ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config && \
74+
ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config-7
75+
7076
# Get Rust
7177
RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y
7278
ENV PATH="/root/.cargo/bin:${PATH}"

container/ubuntu22-cuda11/Dockerfile

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,25 @@
1-
FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
1+
FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 AS llvm-builder
22

33
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
44
build-essential \
5-
curl \
65
clang \
6+
curl \
7+
libffi-dev \
8+
libedit-dev \
9+
libncurses5-dev \
710
libssl-dev \
811
libtinfo-dev \
12+
libxml2-dev \
13+
ninja-build \
914
pkg-config \
15+
python3 \
1016
xz-utils \
1117
zlib1g-dev && \
1218
rm -rf /var/lib/apt/lists/*
1319

14-
# Needed to build `path_tracer`, `optix/ex03_window` example
15-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
16-
cmake \
17-
libfontconfig-dev \
18-
libx11-xcb-dev \
19-
libxcursor-dev \
20-
libxi-dev \
21-
libxinerama-dev \
22-
libxrandr-dev && \
23-
rm -rf /var/lib/apt/lists/*
24-
25-
# Get LLVM 7
2620
WORKDIR /data/llvm7
2721

28-
# Install dependencies for building LLVM
29-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
30-
libffi-dev \
31-
libedit-dev \
32-
libncurses5-dev \
33-
libxml2-dev \
34-
python3 \
35-
ninja-build && \
36-
rm -rf /var/lib/apt/lists/*
37-
38-
# Download and build LLVM 7.1.0 for all architectures
22+
# Download and build LLVM 7.1.0 for all architectures.
3923
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
4024
tar -xf llvm-7.1.0.src.tar.xz && \
4125
cd llvm-7.1.0.src && \
@@ -58,13 +42,36 @@ RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmo
5842
-DLLVM_INCLUDE_BENCHMARKS=OFF \
5943
-DLLVM_ENABLE_ZLIB=ON \
6044
-DLLVM_ENABLE_TERMINFO=ON \
61-
-DCMAKE_INSTALL_PREFIX=/usr \
45+
-DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
6246
.. && \
6347
ninja -j$(nproc) && \
6448
ninja install && \
6549
cd ../.. && \
66-
rm -rf llvm-7.1.0.src* && \
67-
ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7
50+
rm -rf llvm-7.1.0.src*
51+
52+
FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
53+
54+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
55+
build-essential \
56+
clang \
57+
curl \
58+
libssl-dev \
59+
libtinfo-dev \
60+
pkg-config \
61+
xz-utils \
62+
zlib1g-dev \
63+
cmake \
64+
libfontconfig-dev \
65+
libx11-xcb-dev \
66+
libxcursor-dev \
67+
libxi-dev \
68+
libxinerama-dev \
69+
libxrandr-dev && \
70+
rm -rf /var/lib/apt/lists/*
71+
72+
COPY --from=llvm-builder /opt/llvm-7 /opt/llvm-7
73+
RUN ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config && \
74+
ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config-7
6875

6976
# Get Rust
7077
RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y
@@ -79,4 +86,3 @@ RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/rust-cuda/rust-too
7986
ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}"
8087
ENV LLVM_LINK_STATIC=1
8188
ENV RUST_LOG=info
82-

container/ubuntu22-cuda12/Dockerfile

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,25 @@
1-
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04
1+
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04 AS llvm-builder
22

33
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
44
build-essential \
5-
curl \
65
clang \
6+
curl \
7+
libffi-dev \
8+
libedit-dev \
9+
libncurses5-dev \
710
libssl-dev \
811
libtinfo-dev \
12+
libxml2-dev \
13+
ninja-build \
914
pkg-config \
15+
python3 \
1016
xz-utils \
1117
zlib1g-dev && \
1218
rm -rf /var/lib/apt/lists/*
1319

14-
# Needed to build `path_tracer`, `optix/ex03_window` example
15-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
16-
cmake \
17-
libfontconfig-dev \
18-
libx11-xcb-dev \
19-
libxcursor-dev \
20-
libxi-dev \
21-
libxinerama-dev \
22-
libxrandr-dev && \
23-
rm -rf /var/lib/apt/lists/*
24-
25-
# Get LLVM 7
2620
WORKDIR /data/llvm7
2721

28-
# Install dependencies for building LLVM
29-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
30-
libffi-dev \
31-
libedit-dev \
32-
libncurses5-dev \
33-
libxml2-dev \
34-
python3 \
35-
ninja-build && \
36-
rm -rf /var/lib/apt/lists/*
37-
38-
# Download and build LLVM 7.1.0 for all architectures
22+
# Download and build LLVM 7.1.0 for all architectures.
3923
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
4024
tar -xf llvm-7.1.0.src.tar.xz && \
4125
cd llvm-7.1.0.src && \
@@ -58,13 +42,36 @@ RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmo
5842
-DLLVM_INCLUDE_BENCHMARKS=OFF \
5943
-DLLVM_ENABLE_ZLIB=ON \
6044
-DLLVM_ENABLE_TERMINFO=ON \
61-
-DCMAKE_INSTALL_PREFIX=/usr \
45+
-DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
6246
.. && \
6347
ninja -j$(nproc) && \
6448
ninja install && \
6549
cd ../.. && \
66-
rm -rf llvm-7.1.0.src* && \
67-
ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7
50+
rm -rf llvm-7.1.0.src*
51+
52+
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04
53+
54+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
55+
build-essential \
56+
clang \
57+
curl \
58+
libssl-dev \
59+
libtinfo-dev \
60+
pkg-config \
61+
xz-utils \
62+
zlib1g-dev \
63+
cmake \
64+
libfontconfig-dev \
65+
libx11-xcb-dev \
66+
libxcursor-dev \
67+
libxi-dev \
68+
libxinerama-dev \
69+
libxrandr-dev && \
70+
rm -rf /var/lib/apt/lists/*
71+
72+
COPY --from=llvm-builder /opt/llvm-7 /opt/llvm-7
73+
RUN ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config && \
74+
ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config-7
6875

6976
# Get Rust
7077
RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y
@@ -79,4 +86,3 @@ RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/rust-cuda/rust-too
7986
ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}"
8087
ENV LLVM_LINK_STATIC=1
8188
ENV RUST_LOG=info
82-

container/ubuntu24-cuda12-llvmdebug/Dockerfile

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,25 @@
1-
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04
1+
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04 AS llvm-builder
22

33
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
44
build-essential \
55
clang \
66
curl \
7+
libffi-dev \
8+
libedit-dev \
9+
libncurses5-dev \
710
libssl-dev \
811
libtinfo-dev \
12+
libxml2-dev \
13+
ninja-build \
914
pkg-config \
15+
python3 \
1016
xz-utils \
1117
zlib1g-dev && \
1218
rm -rf /var/lib/apt/lists/*
1319

14-
# Needed to build `path_tracer`, `optix/ex03_window` example
15-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
16-
cmake \
17-
libfontconfig-dev \
18-
libx11-xcb-dev \
19-
libxcursor-dev \
20-
libxi-dev \
21-
libxinerama-dev \
22-
libxrandr-dev && \
23-
rm -rf /var/lib/apt/lists/*
24-
25-
# Get LLVM 7
2620
WORKDIR /data/llvm7
2721

28-
# Install dependencies for building LLVM
29-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
30-
libffi-dev \
31-
libedit-dev \
32-
libncurses5-dev \
33-
libxml2-dev \
34-
python3 \
35-
ninja-build && \
36-
rm -rf /var/lib/apt/lists/*
37-
38-
# Download and build LLVM 7.1.0 for all architectures
22+
# Download and build LLVM 7.1.0 for all architectures.
3923
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
4024
tar -xf llvm-7.1.0.src.tar.xz && \
4125
cd llvm-7.1.0.src && \
@@ -58,13 +42,36 @@ RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmo
5842
-DLLVM_INCLUDE_BENCHMARKS=OFF \
5943
-DLLVM_ENABLE_ZLIB=ON \
6044
-DLLVM_ENABLE_TERMINFO=ON \
61-
-DCMAKE_INSTALL_PREFIX=/usr \
45+
-DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
6246
.. && \
6347
ninja -j$(nproc) && \
6448
ninja install && \
6549
cd ../.. && \
66-
rm -rf llvm-7.1.0.src* && \
67-
ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7
50+
rm -rf llvm-7.1.0.src*
51+
52+
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04
53+
54+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
55+
build-essential \
56+
clang \
57+
curl \
58+
libssl-dev \
59+
libtinfo-dev \
60+
pkg-config \
61+
xz-utils \
62+
zlib1g-dev \
63+
cmake \
64+
libfontconfig-dev \
65+
libx11-xcb-dev \
66+
libxcursor-dev \
67+
libxi-dev \
68+
libxinerama-dev \
69+
libxrandr-dev && \
70+
rm -rf /var/lib/apt/lists/*
71+
72+
COPY --from=llvm-builder /opt/llvm-7 /opt/llvm-7
73+
RUN ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config && \
74+
ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config-7
6875

6976
# Get Rust
7077
RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y
@@ -79,4 +86,3 @@ RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/Rust-CUDA/rust-too
7986
ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}"
8087
ENV LLVM_LINK_STATIC=1
8188
ENV RUST_LOG=info
82-

0 commit comments

Comments
 (0)