mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
37 lines
1.3 KiB
Docker
37 lines
1.3 KiB
Docker
FROM nvidia/cuda:8.0-cudnn6-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
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
cmake \
|
|
git \
|
|
curl \
|
|
vim \
|
|
ca-certificates \
|
|
libjpeg-dev \
|
|
libpng-dev &&\
|
|
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 && \
|
|
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 pyyaml 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 TORCH_CUDA_ARCH_LIST="3.5 5.2 6.0 6.1+PTX" TORCH_NVCC_FLAGS="-Xfatbin -compress-all" \
|
|
CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" \
|
|
pip install -v .
|
|
|
|
RUN git clone https://github.com/pytorch/vision.git && cd vision && pip install -v .
|
|
|
|
WORKDIR /workspace
|
|
RUN chmod -R a+w /workspace
|