forked from StatCan/aaw-kubeflow-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_CUDA-12.0.1.Dockerfile
110 lines (77 loc) · 4.84 KB
/
1_CUDA-12.0.1.Dockerfile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Cuda stuff for v12.0.1
## https://gitlab.com/nvidia/container-images/cuda/-/raw/3de25bfd98973fe22f46aff678d7db3d2466389b/dist/12.0.1/ubuntu1804/base/Dockerfile
###########################
### Base
###########################
ENV NVARCH x86_64
ENV NVIDIA_REQUIRE_CUDA "cuda>=12.0 brand=tesla,driver>=450,driver<451 brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 brand=tesla,driver>=510,driver<511 brand=unknown,driver>=510,driver<511 brand=nvidia,driver>=510,driver<511 brand=nvidiartx,driver>=510,driver<511 brand=geforce,driver>=510,driver<511 brand=geforcertx,driver>=510,driver<511 brand=quadro,driver>=510,driver<511 brand=quadrortx,driver>=510,driver<511 brand=titan,driver>=510,driver<511 brand=titanrtx,driver>=510,driver<511 brand=tesla,driver>=515,driver<516 brand=unknown,driver>=515,driver<516 brand=nvidia,driver>=515,driver<516 brand=nvidiartx,driver>=515,driver<516 brand=geforce,driver>=515,driver<516 brand=geforcertx,driver>=515,driver<516 brand=quadro,driver>=515,driver<516 brand=quadrortx,driver>=515,driver<516 brand=titan,driver>=515,driver<516 brand=titanrtx,driver>=515,driver<516"
ENV NV_CUDA_CUDART_VERSION 12.0.146-1
ENV NV_CUDA_COMPAT_PACKAGE cuda-compat-12-0
ENV OS_VER ubuntu2204
ARG TARGETARCH
RUN apt-get update && apt-get install -y --no-install-recommends \
gnupg2 curl ca-certificates && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/${OS_VER}/${NVARCH}/3bf863cc.pub | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/nvidia.gpg && \
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/${OS_VER}/${NVARCH} /" > /etc/apt/sources.list.d/cuda.list && \
apt-get purge --autoremove -y curl \
&& rm -rf /var/lib/apt/lists/*
ENV CUDA_VERSION 12.0.1
# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
RUN apt-get update && apt-get install -y --no-install-recommends \
cuda-cudart-12-0=${NV_CUDA_CUDART_VERSION} \
${NV_CUDA_COMPAT_PACKAGE} \
&& rm -rf /var/lib/apt/lists/*
# Required for nvidia-docker v1
RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf \
&& echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf
ENV CUDA_DIR "/usr/local/cuda"
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64:$CUDA_DIR/lib64
ENV XLA_FLAGS "--xla_gpu_cuda_data_dir=$CUDA_DIR"
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
# ###########################
# ### Devel
# ###########################
# # https://gitlab.com/nvidia/container-images/cuda/-/raw/3de25bfd98973fe22f46aff678d7db3d2466389b/dist/12.0.1/ubuntu1804/devel/Dockerfile
#
# $(curl -s https://gitlab.com/nvidia/container-images/cuda/-/raw/3de25bfd98973fe22f46aff678d7db3d2466389b/dist/12.0.1/ubuntu1804/devel/Dockerfile)
###########################
### Runtime
###########################
# https://gitlab.com/nvidia/container-images/cuda/-/raw/3de25bfd98973fe22f46aff678d7db3d2466389b/dist/12.0.1/ubuntu1804/runtime/Dockerfile
ENV NV_CUDA_LIB_VERSION 12.0.1-1
ENV NV_NVTX_VERSION 12.0.140-1
ENV NV_LIBNPP_VERSION 12.0.1.104-1
ENV NV_LIBNPP_PACKAGE libnpp-12-0=${NV_LIBNPP_VERSION}
ENV NV_LIBCUSPARSE_VERSION 12.0.1.140-1
ENV NV_LIBCUBLAS_PACKAGE_NAME libcublas-12-0
ENV NV_LIBCUBLAS_VERSION 12.0.2.224-1
ENV NV_LIBCUBLAS_PACKAGE ${NV_LIBCUBLAS_PACKAGE_NAME}=${NV_LIBCUBLAS_VERSION}
ARG TARGETARCH
RUN apt-get update && apt-get install -y --no-install-recommends \
cuda-libraries-12-0=${NV_CUDA_LIB_VERSION} \
cuda-toolkit-12-0 \
${NV_LIBNPP_PACKAGE} \
cuda-nvtx-12-0=${NV_NVTX_VERSION} \
libcusparse-12-0=${NV_LIBCUSPARSE_VERSION} \
${NV_LIBCUBLAS_PACKAGE} \
&& rm -rf /var/lib/apt/lists/*
# Keep apt from auto upgrading the cublas and nccl packages. See https://gitlab.com/nvidia/container-images/cuda/-/issues/88
RUN apt-mark hold ${NV_LIBCUBLAS_PACKAGE_NAME}
# Add entrypoint items
ENV NVIDIA_PRODUCT_NAME="CUDA"
###########################
### CudNN
###########################
# https://gitlab.com/nvidia/container-images/cuda/-/raw/3de25bfd98973fe22f46aff678d7db3d2466389b/dist/12.0.1/ubuntu1804/runtime/cudnn8/Dockerfile
ENV NV_CUDNN_VERSION 8.8.0.121
ENV NV_CUDNN_PACKAGE_NAME "libcudnn8"
ENV NV_CUDNN_PACKAGE "libcudnn8=$NV_CUDNN_VERSION-1+cuda12.0"
ARG TARGETARCH
LABEL com.nvidia.cudnn.version="${NV_CUDNN_VERSION}"
RUN apt-get update && apt-get install -y --no-install-recommends \
${NV_CUDNN_PACKAGE} \
&& apt-mark hold ${NV_CUDNN_PACKAGE_NAME} \
&& rm -rf /var/lib/apt/lists/*