forked from martin-sicho/genui-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-base-cuda
29 lines (23 loc) · 1.01 KB
/
Dockerfile-base-cuda
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
# first stage -- install CUDA
ARG GENUI_DOCKER_IMAGE_TAG=latest
ARG GENUI_DOCKER_IMAGE_PREFIX=sichom
FROM ${GENUI_DOCKER_IMAGE_PREFIX}/genui-base:${GENUI_DOCKER_IMAGE_TAG} as installer
# copy the runfile
ARG NVIDIA_CUDA_RUNFILE=./cuda_install.run
COPY ./${NVIDIA_CUDA_RUNFILE} ./cuda_install.run
# install compilers
RUN apt-get install -y --no-install-recommends gcc
# install the cuda toolkit
RUN mkdir /opt/cuda/ && sh ./cuda_install.run --silent --toolkit --toolkitpath=/opt/cuda/ && rm cuda_install.run
# second stage -- move installation to the final image
ARG GENUI_DOCKER_IMAGE_TAG=latest
ARG GENUI_DOCKER_IMAGE_PREFIX=sichom
FROM ${GENUI_DOCKER_IMAGE_PREFIX}/genui-base:${GENUI_DOCKER_IMAGE_TAG} AS final
# COPY stuff from previous stage
COPY --from=installer /opt/cuda /opt/cuda
# set the environment variables
ENV PATH /opt/cuda/bin/:$PATH
ENV LD_LIBRARY_PATH /opt/cuda/lib:/opt/cuda/lib64
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
LABEL com.nvidia.volumes.needed="nvidia_driver"