mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Change dockerfile to support for cudnn v6 (#1135)
This commit is contained in:
parent
dc7695a47a
commit
215813d7ac
|
|
@ -1,5 +1,8 @@
|
||||||
FROM nvidia/cuda:8.0-cudnn5-devel-ubuntu14.04
|
FROM nvidia/cuda:8.0-devel-ubuntu16.04
|
||||||
|
|
||||||
|
RUN echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list
|
||||||
|
|
||||||
|
ENV CUDNN_VERSION 6.0.20
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
build-essential \
|
build-essential \
|
||||||
cmake \
|
cmake \
|
||||||
|
|
@ -7,7 +10,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
libjpeg-dev \
|
libjpeg-dev \
|
||||||
libpng-dev &&\
|
libpng-dev \
|
||||||
|
libcudnn6=$CUDNN_VERSION-1+cuda8.0 \
|
||||||
|
libcudnn6-dev=$CUDNN_VERSION-1+cuda8.0 && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh && \
|
RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh && \
|
||||||
|
|
|
||||||
10
README.md
10
README.md
|
|
@ -190,15 +190,11 @@ python setup.py install
|
||||||
|
|
||||||
### Docker image
|
### Docker image
|
||||||
|
|
||||||
Dockerfiles are supplied to build images with cuda support and cudnn v5 and cudnn v6 RC. Build them as usual
|
Dockerfile is supplied to build images with cuda support and cudnn v6. Build as usual
|
||||||
```
|
```
|
||||||
docker build -t pytorch-cudnnv5 .
|
docker build -t pytorch-cudnnv6 .
|
||||||
```
|
```
|
||||||
or
|
and run with nvidia-docker:
|
||||||
```
|
|
||||||
docker build -t pytorch-cudnnv6 -f tools/docker/Dockerfile-v6 .
|
|
||||||
```
|
|
||||||
and run them with nvidia-docker:
|
|
||||||
```
|
```
|
||||||
nvidia-docker run --rm -ti --ipc=host pytorch-cudnnv5
|
nvidia-docker run --rm -ti --ipc=host pytorch-cudnnv5
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
FROM nvidia/cuda:8.0-devel-ubuntu14.04
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
build-essential \
|
|
||||||
cmake \
|
|
||||||
git \
|
|
||||||
curl \
|
|
||||||
ca-certificates \
|
|
||||||
libjpeg-dev \
|
|
||||||
libpng-dev &&\
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
|
|
||||||
RUN curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v6.0/cudnn-8.0-linux-x64-v6.0-rc.tgz -O && \
|
|
||||||
tar -xzf cudnn-8.0-linux-x64-v6.0-rc.tgz -C /usr/local && \
|
|
||||||
rm cudnn-8.0-linux-x64-v6.0-rc.tgz && \
|
|
||||||
ldconfig
|
|
||||||
RUN ln -s /usr/local/cuda/lib64/libcudnn.so.6.0.5 /usr/lib/x86_64-linux-gnu/libcudnn.so.6.0.5
|
|
||||||
|
|
||||||
RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh && \
|
|
||||||
chmod +x ~/miniconda.sh && \
|
|
||||||
~/miniconda.sh -b -p /opt/conda && \
|
|
||||||
rm ~/miniconda.sh && \
|
|
||||||
/opt/conda/bin/conda install conda-build && \
|
|
||||||
/opt/conda/bin/conda create -y --name pytorch-py35 python=3.5.2 numpy scipy ipython mkl&& \
|
|
||||||
/opt/conda/bin/conda clean -ya
|
|
||||||
ENV PATH /opt/conda/envs/pytorch-py35/bin:$PATH
|
|
||||||
RUN conda install --name pytorch-py35 -c soumith magma-cuda80
|
|
||||||
# This must be done before pip so that requirements.txt is available
|
|
||||||
WORKDIR /opt/pytorch
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN cat requirements.txt | xargs -n1 pip install --no-cache-dir && \
|
|
||||||
TORCH_CUDA_ARCH_LIST="3.5 5.2 6.0 6.1+PTX" TORCH_NVCC_FLAGS="-Xfatbin -compress-all" \
|
|
||||||
CMAKE_LIBRARY_PATH=/opt/conda/envs/pytorch-py35/lib \
|
|
||||||
CMAKE_INCLUDE_PATH=/opt/conda/envs/pytorch-py35/include \
|
|
||||||
pip install -v .
|
|
||||||
|
|
||||||
WORKDIR /workspace
|
|
||||||
RUN chmod -R a+w /workspace
|
|
||||||
Loading…
Reference in New Issue
Block a user