-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathDockerfile.runtime
More file actions
33 lines (29 loc) · 1.28 KB
/
Dockerfile.runtime
File metadata and controls
33 lines (29 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# All base-image functionality is inherited from our non-nvidia base image.
ARG BASE_IMAGE=robatvastai/base-image:stock-ubuntu24.04-py312-date
FROM ${BASE_IMAGE}
ENV NVIDIA_DRIVER_CAPABILITIES=all
# Space-separated list of CUDA versions (e.g., "12-9 13-2" or "12.9 13.2")
ARG CUDA_VERSIONS="12-9"
RUN \
set -euo pipefail && \
[ -n "${CUDA_VERSIONS// }" ] || { echo "CUDA_VERSIONS must not be empty" >&2; exit 1; } && \
apt-get update && \
PACKAGES="" && \
lowest_dotver="" && \
for ver in ${CUDA_VERSIONS}; do \
dashver="${ver//./-}" && \
dotver="${ver//-/.}" && \
PACKAGES="$PACKAGES cuda-compat-${dashver} cuda-nvcc-${dashver} cuda-cccl-${dashver} cuda-nvrtc-${dashver} libnpp-${dashver} libnvjpeg-${dashver} libcufft-${dashver}" && \
if [ -z "$lowest_dotver" ] || [ "$(printf '%s\n%s\n' "$dotver" "$lowest_dotver" | sort -V | head -n1)" = "$dotver" ]; then \
lowest_dotver="$dotver"; \
fi; \
done && \
PACKAGES="$PACKAGES libnccl2=*+cuda${lowest_dotver}" && \
set -f && \
apt-get install -y --no-install-recommends $PACKAGES && \
set +f && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Defend against environment clashes when syncing to volume
RUN \
set -euo pipefail && \
env-hash > /.env_hash