@@ -38,32 +38,30 @@ ARG VERSION="unknown"
3838ARG GIT_COMMIT="unknown"
3939RUN make cmds
4040
41- FROM nvcr.io/nvidia/cuda:13.0.1-base- ubi9 AS cuda-base
41+ FROM registry.access.redhat.com/ ubi9/ubi:latest AS sample-builder
4242
43- RUN dnf install -y --allowerasing \
44- curl \
45- && \
46- dnf clean all
43+ ARG CUDA_COMPAT_VERSION=12-9
4744
48- WORKDIR /workspace
49-
50- FROM nvcr.io/nvidia/cuda:12.9.1-base-ubi9 AS sample-builder
45+ RUN ARCH=$(uname -m) && OS_ARCH=${ARCH/amd64/x86_64} && OS_ARCH=${ARCH/aarch64/sbsa} && OS_ARCH=${ARCH/arm64/sbsa} \
46+ dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/$OS_ARCH/cuda-rhel9.repo
5147
5248RUN dnf install -y --allowerasing \
5349 cmake \
54- cuda-cudart-devel-12-9 \
55- cuda-nvcc-12-9 \
50+ cuda-cudart-devel-${CUDA_COMPAT_VERSION} \
51+ cuda-compat-${CUDA_COMPAT_VERSION} \
52+ cuda-nvcc-${CUDA_COMPAT_VERSION} \
5653 g++ \
5754 curl \
5855 && \
5956 dnf clean all
6057
58+ ENV PATH=/usr/local/cuda/bin:${PATH}
59+
6160WORKDIR /build
6261
6362ARG SAMPLE_NAME=vectorAdd
6463
65- ARG CUDA_SAMPLES_VERSION=v12.9
66- RUN curl -L https://codeload.github.com/NVIDIA/cuda-samples/tar.gz/refs/tags/${CUDA_SAMPLES_VERSION} | \
64+ RUN curl -L https://codeload.github.com/NVIDIA/cuda-samples/tar.gz/refs/tags/v${CUDA_COMPAT_VERSION/-/.} | \
6765 tar -xzvf - --strip-components=1 --wildcards */${SAMPLE_NAME}/* --wildcards */Common/* && \
6866 cd $(find /build/Samples -iname "${SAMPLE_NAME}" ) && \
6967 cmake . && \
@@ -93,10 +91,7 @@ COPY --from=builder /workspace/gpu-operator /usr/bin/
9391COPY --from=builder /workspace/manage-crds /usr/bin/
9492COPY --from=builder /workspace/nvidia-validator /usr/bin/
9593COPY --from=sample-builder /build/vectorAdd /usr/bin/vectorAdd
96- # TODO: Copy the compat libs from the 'sample-builder' image instead.
97- # The current 'sample-builder' image does not contain the compat libs in the ARM variant.
98- # Once new sample images are published that contain the compat libs, we can update the below.
99- COPY --from=cuda-base /usr/local/cuda/compat /usr/local/cuda/compat
94+ COPY --from=sample-builder /usr/local/cuda-${CUDA_COMPAT_VERSION/-/.}/compat /usr/local/cuda/compat
10095
10196COPY assets /opt/gpu-operator/
10297COPY manifests /opt/gpu-operator/manifests
0 commit comments