Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. # Start with cuDNN base image
  2. FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
  3.  
  4. ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
  5. ENV PATH /opt/conda/bin:$PATH
  6.  
  7. RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificates \
  8. libglib2.0-0 libxext6 libsm6 libxrender1 \
  9. git mercurial subversion \
  10. gfortran \
  11. git \
  12. wget \
  13. liblapack-dev \
  14. libopenblas-dev \
  15. vim
  16.  
  17. RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
  18. /bin/bash ~/miniconda.sh -b -p /opt/conda && \
  19. rm ~/miniconda.sh && \
  20. ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
  21. echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
  22. echo "conda activate base" >> ~/.bashrc
  23.  
  24. RUN conda install numpy scipy mkl-service mkl ujson pandas matplotlib seaborn scikit-learn
  25.  
  26. # Set CUDA_ROOT
  27. ENV CUDA_ROOT /usr/local/cuda/bin
  28.  
  29. # Install CMake 3
  30. RUN cd /root && wget http://www.cmake.org/files/v3.8/cmake-3.8.1.tar.gz && \
  31. tar -xf cmake-3.8.1.tar.gz && cd cmake-3.8.1 && \
  32. ./configure && \
  33. make -j "$(nproc)" && \
  34. make install
  35.  
  36. # Install Cython
  37. RUN pip install Cython nose
  38.  
  39. # Clone libgpuarray repo and move into it
  40. RUN cd /root && git clone https://github.com/Theano/libgpuarray.git && cd libgpuarray && \
  41. # Make and move into build directory
  42. mkdir Build && cd Build && \
  43. # CMake
  44. cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr && \
  45. # Make
  46. make -j"$(nproc)" && \
  47. make install
  48. # Install pygpu
  49. RUN cd /root/libgpuarray && \
  50. python setup.py build_ext -L /usr/lib -I /usr/include && \
  51. python setup.py install
  52.  
  53. # Install bleeding-edge Theano
  54. RUN pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
  55. # Set up .theanorc for CUDA
  56. #RUN echo "[global]\ndevice=cuda\nfloatX=float32\noptimizer_including=cudnn\n[lib]\ncnmem=0.1\n[nvcc]\nfastmath=True" > /root/.theanorc
  57. RUN echo "[global]\nfloatX=float32\noptimizer_including=cudnn\n[lib]\ncnmem=0.1\n[nvcc]\nfastmath=True" > /root/.theanorc
  58.  
  59. RUN pip install git+https://github.com/pymc-devs/pymc3
  60. RUN pip install arviz
  61.  
  62. RUN echo "export CPLUS_INCLUDE_PATH=/usr/local/cuda/include" >> /root/.bashrc
  63.  
  64. RUN conda install jupyter
  65.  
  66. RUN wget -q -O - https://deb.nodesource.com/setup_12.x | bash -
  67. RUN apt-get install -y nodejs
  68.  
  69. RUN conda install -c conda-forge jupyterlab
  70. RUN jupyter labextension install jupyterlab_vim
  71.  
  72. RUN conda install pytorch torchvision cudatoolkit=10.0 -c pytorch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement