Skip to content

Commit f5f34e2

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

6 files changed

Lines changed: 177 additions & 145 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: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,27 @@
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

3-
RUN dnf -y update && \
4-
dnf -y install \
3+
RUN dnf -y install \
4+
--allowerasing \
5+
--setopt=install_weak_deps=False \
56
clang \
67
openssl-devel \
78
pkgconfig \
89
redhat-rpm-config \
910
which \
1011
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 \
12+
zlib-devel \
3013
libffi-devel \
3114
ncurses-devel \
3215
libxml2-devel \
3316
libedit-devel \
3417
python3 \
35-
make && \
18+
make \
19+
cmake && \
3620
dnf clean all
3721

38-
# Download and build LLVM 7.1.0 for all architectures
22+
WORKDIR /data/llvm7
23+
24+
# Download and build LLVM 7.1.0 for all architectures.
3925
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
4026
tar -xf llvm-7.1.0.src.tar.xz && \
4127
cd llvm-7.1.0.src && \
@@ -58,15 +44,38 @@ RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmo
5844
-DLLVM_INCLUDE_BENCHMARKS=OFF \
5945
-DLLVM_ENABLE_ZLIB=ON \
6046
-DLLVM_ENABLE_TERMINFO=ON \
61-
-DCMAKE_INSTALL_PREFIX=/usr \
47+
-DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
6248
.. && \
6349
make -j$(nproc) && \
6450
make install && \
6551
cd ../.. && \
6652
rm -rf llvm-7.1.0.src* && \
67-
ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7 && \
6853
dnf clean all
6954

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

container/ubuntu22-cuda11/Dockerfile

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,26 @@
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+
cmake \
14+
ninja-build \
915
pkg-config \
16+
python3 \
1017
xz-utils \
1118
zlib1g-dev && \
1219
rm -rf /var/lib/apt/lists/*
1320

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
2621
WORKDIR /data/llvm7
2722

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
23+
# Download and build LLVM 7.1.0 for all architectures.
3924
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
4025
tar -xf llvm-7.1.0.src.tar.xz && \
4126
cd llvm-7.1.0.src && \
@@ -58,13 +43,36 @@ RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmo
5843
-DLLVM_INCLUDE_BENCHMARKS=OFF \
5944
-DLLVM_ENABLE_ZLIB=ON \
6045
-DLLVM_ENABLE_TERMINFO=ON \
61-
-DCMAKE_INSTALL_PREFIX=/usr \
46+
-DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
6247
.. && \
6348
ninja -j$(nproc) && \
6449
ninja install && \
6550
cd ../.. && \
66-
rm -rf llvm-7.1.0.src* && \
67-
ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7
51+
rm -rf llvm-7.1.0.src*
52+
53+
FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.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
6876

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

container/ubuntu22-cuda12/Dockerfile

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,26 @@
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+
cmake \
14+
ninja-build \
915
pkg-config \
16+
python3 \
1017
xz-utils \
1118
zlib1g-dev && \
1219
rm -rf /var/lib/apt/lists/*
1320

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
2621
WORKDIR /data/llvm7
2722

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
23+
# Download and build LLVM 7.1.0 for all architectures.
3924
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
4025
tar -xf llvm-7.1.0.src.tar.xz && \
4126
cd llvm-7.1.0.src && \
@@ -58,13 +43,36 @@ RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmo
5843
-DLLVM_INCLUDE_BENCHMARKS=OFF \
5944
-DLLVM_ENABLE_ZLIB=ON \
6045
-DLLVM_ENABLE_TERMINFO=ON \
61-
-DCMAKE_INSTALL_PREFIX=/usr \
46+
-DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
6247
.. && \
6348
ninja -j$(nproc) && \
6449
ninja install && \
6550
cd ../.. && \
66-
rm -rf llvm-7.1.0.src* && \
67-
ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7
51+
rm -rf llvm-7.1.0.src*
52+
53+
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.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
6876

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

container/ubuntu24-cuda12-llvmdebug/Dockerfile

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,26 @@
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+
cmake \
14+
ninja-build \
915
pkg-config \
16+
python3 \
1017
xz-utils \
1118
zlib1g-dev && \
1219
rm -rf /var/lib/apt/lists/*
1320

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
2621
WORKDIR /data/llvm7
2722

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
23+
# Download and build LLVM 7.1.0 for all architectures.
3924
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
4025
tar -xf llvm-7.1.0.src.tar.xz && \
4126
cd llvm-7.1.0.src && \
@@ -58,13 +43,36 @@ RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmo
5843
-DLLVM_INCLUDE_BENCHMARKS=OFF \
5944
-DLLVM_ENABLE_ZLIB=ON \
6045
-DLLVM_ENABLE_TERMINFO=ON \
61-
-DCMAKE_INSTALL_PREFIX=/usr \
46+
-DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
6247
.. && \
6348
ninja -j$(nproc) && \
6449
ninja install && \
6550
cd ../.. && \
66-
rm -rf llvm-7.1.0.src* && \
67-
ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7
51+
rm -rf llvm-7.1.0.src*
52+
53+
FROM nvcr.io/nvidia/cuda:12.8.1-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
6876

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

0 commit comments

Comments
 (0)