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.

45 lines
1.9 KiB

2 years ago
  1. ARG BASE=python:3.8
  2. FROM ${BASE}
  3. ENV CUDA_VERSION 10.1.243
  4. ENV CUDA_PKG_VERSION 10-1=$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.1 brand=tesla,driver>=396,driver<397 brand=tesla,driver>=410,driver<411 brand=tesla,driver>=418,driver<419"
  10. ENV CUDNN_VERSION 7.6.5.32
  11. ENV NCCL_VERSION 2.7.8
  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-1 \
  28. && ln -s cuda-10.1 /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-libraries-$CUDA_PKG_VERSION \
  33. cuda-npp-$CUDA_PKG_VERSION \
  34. cuda-nvtx-$CUDA_PKG_VERSION \
  35. libcublas10=10.2.1.243-1 \
  36. libcudnn7=$CUDNN_VERSION-1+cuda10.1 \
  37. libnccl2=$NCCL_VERSION-1+cuda10.1 \
  38. && apt-mark hold libnccl2 \
  39. && apt-mark hold libcudnn7 \
  40. && apt-mark hold libcublas10 \
  41. && rm -rf /var/lib/apt/lists/*