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.

57 lines
2.4 KiB

2 years ago
  1. ARG BASE=python:3.7
  2. FROM ${BASE}
  3. # FROM 9.2-base-ubuntu18.04
  4. # https://gitlab.com/nvidia/container-images/cuda/blob/ubuntu18.04/9.2/base/Dockerfile
  5. RUN apt-get update && apt-get install -y --no-install-recommends gnupg2 curl ca-certificates \
  6. && curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1710/x86_64/7fa2af80.pub | apt-key add - \
  7. && echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1710/x86_64 /" > /etc/apt/sources.list.d/cuda.list \
  8. && echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list \
  9. && apt-get purge --autoremove -y curl \
  10. && rm -rf /var/lib/apt/lists/*
  11. ENV CUDA_VERSION 9.2.148
  12. ENV CUDA_PKG_VERSION 9-2=$CUDA_VERSION-1
  13. RUN apt-get update \
  14. && apt-get install -y --no-install-recommends \
  15. cuda-cudart-$CUDA_PKG_VERSION \
  16. && ln -s cuda-9.2 /usr/local/cuda \
  17. && rm -rf /var/lib/apt/lists/*
  18. LABEL com.nvidia.volumes.needed="nvidia_driver"
  19. LABEL com.nvidia.cuda.version="${CUDA_VERSION}"
  20. RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf \
  21. && echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf
  22. ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
  23. ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
  24. ENV NVIDIA_VISIBLE_DEVICES all
  25. ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
  26. ENV NVIDIA_REQUIRE_CUDA "cuda>=9.2"
  27. # FROM 9.2-runtime-ubuntu18.04
  28. # https://gitlab.com/nvidia/container-images/cuda/blob/ubuntu18.04/9.2/runtime/Dockerfile
  29. ENV NCCL_VERSION 2.3.7
  30. RUN apt-get update \
  31. && apt-get install -y --no-install-recommends \
  32. cuda-libraries-$CUDA_PKG_VERSION \
  33. cuda-nvtx-$CUDA_PKG_VERSION \
  34. libnccl2=$NCCL_VERSION-1+cuda9.2 \
  35. && apt-mark hold libnccl2 \
  36. && rm -rf /var/lib/apt/lists/*
  37. # FROM 9.2-runtime-cudnn7-ubuntu18.04
  38. # https://gitlab.com/nvidia/container-images/cuda/blob/ubuntu18.04/9.2/runtime/cudnn7/Dockerfile
  39. ENV CUDNN_VERSION 7.5.0.56
  40. LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
  41. RUN apt-get update \
  42. && apt-get install -y --no-install-recommends libcudnn7=$CUDNN_VERSION-1+cuda9.2 \
  43. && apt-mark hold libcudnn7 \
  44. && rm -rf /var/lib/apt/lists/*
  45. RUN mkdir -p /model
  46. ENV MODEL_PATH /model
  47. COPY audio_example.mp3 .
  48. # Spleeter installation.
  49. RUN apt-get update && apt-get install -y ffmpeg libsndfile1
  50. RUN pip install musdb museval
  51. RUN pip install spleeter-gpu==1.4.9
  52. ENTRYPOINT ["spleeter"]