Last active
January 6, 2021 19:33
Dockerfile combining SubT virtual testbed images with CUDA support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM osrf/subt-virtual-testbed:cloudsim_bridge_latest | |
RUN curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | sudo apt-key add - && echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list && echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" | sudo tee /etc/apt/sources.list.d/nvidia-ml.list && sudo apt-get -yy update | |
ARG cuda_maj=10 | |
ARG cuda_min=0 | |
ARG cuda=$cuda_maj-$cuda_min | |
ARG cudnn=7 | |
RUN sudo apt-get install -y --no-install-recommends cuda-cudart-$cuda cuda-compat-$cuda cuda-libraries-$cuda cuda-npp-$cuda cuda-nvtx-$cuda cuda-cublas-$cuda libnccl2="*+cuda$cuda_maj.$cuda_min" libcudnn$cudnn="$cudnn.*+cuda$cuda_maj.$cuda_min" && sudo apt-get clean && sudo apt-mark hold libnccl2 && sudo apt-mark hold libcudnn$cudnn && sudo ln -s cuda-$cuda /usr/local/cuda && echo "/usr/local/nvidia/lib" | sudo tee /etc/ld.so.conf.d/nvidia.conf && echo "/usr/local/nvidia/lib64" | sudo tee -a /etc/ld.so.conf.d/nvidia.conf | |
ENV NVIDIA_VISIBLE_DEVICES=all | |
# or just compute,utility if you don't need OpenGL, NVENC and other goodies | |
ENV NVIDIA_DRIVER_CAPABILITIES=all | |
ENV NVIDIA_REQUIRE_CUDA="cuda>=$cuda_maj.$cuda_min" | |
# Install Tensorflow 1.15 for Python 2 | |
#RUN sudo apt-get -yy update && sudo apt-get -yy install python-pip python-numpy && sudo -H pip install --no-cache-dir --upgrade pip && sudo -H pip install --no-cache-dir 'tensorflow-gpu<2' && yes y | sudo -H pip uninstall pip && sudo apt-get -yy install --reinstall python-pip && sudo apt-get clean | |
# Install Pytorch for Python 2 | |
#RUN sudo apt-get -yy update && sudo apt-get -yy install python-pip python-numpy python-future && sudo -H pip install --no-cache-dir torch && sudo apt-get clean | |
ENTRYPOINT [] | |
CMD ["/bin/bash"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment