You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.8 KiB

2 years ago
  1. ARG BASE=python:3.7
  2. FROM ${BASE}
  3. ENV CUDA_VERSION 10.0.130
  4. ENV CUDA_PKG_VERSION 10-0=$CUDA_VERSION-1
  5. ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
  6. ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
  7. ENV NVIDIA_VISIBLE_DEVICES=all
  8. ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
  9. ENV NVIDIA_REQUIRE_CUDA "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411"
  10. ENV NCCL_VERSION 2.4.2
  11. ENV CUDNN_VERSION 7.6.0.64
  12. LABEL com.nvidia.cuda.version="${CUDA_VERSION}"
  13. LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
  14. LABEL com.nvidia.volumes.needed="nvidia_driver"
  15. RUN apt-get update \
  16. && apt-get install -y --no-install-recommends \
  17. gnupg2 \
  18. curl \
  19. ca-certificates \
  20. && curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | apt-key add - \
  21. && echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list \
  22. && echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list \
  23. && apt-get purge --autoremove -y curl \
  24. && apt-get update \
  25. && apt-get install -y --no-install-recommends \
  26. cuda-cudart-$CUDA_PKG_VERSION \
  27. cuda-compat-10-0 \
  28. && ln -s cuda-10.0 /usr/local/cuda \
  29. && echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf \
  30. && echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf \
  31. && apt-get install -y --no-install-recommends \
  32. cuda-toolkit-10-0 \
  33. cuda-libraries-$CUDA_PKG_VERSION \
  34. cuda-nvtx-$CUDA_PKG_VERSION \
  35. libnccl2=$NCCL_VERSION-1+cuda10.0 \
  36. libcudnn7=$CUDNN_VERSION-1+cuda10.0 \
  37. && apt-mark hold libnccl2 \
  38. && apt-mark hold libcudnn7 \
  39. && rm -rf /var/lib/apt/lists/*