"Fossies" - the Fresh Open Source Software Archive

Member "pytorch-1.8.2/docker/pytorch/Dockerfile" (23 Jul 2021, 1363 Bytes) of package /linux/misc/pytorch-1.8.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04
    2 ARG PYTHON_VERSION=3.8
    3 ARG WITH_TORCHVISION=1
    4 RUN apt-get update && apt-get install -y --no-install-recommends \
    5          build-essential \
    6          cmake \
    7          git \
    8          curl \
    9          ca-certificates \
   10          libjpeg-dev \
   11          libpng-dev && \
   12      rm -rf /var/lib/apt/lists/*
   13 
   14 
   15 RUN curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
   16      chmod +x ~/miniconda.sh && \
   17      ~/miniconda.sh -b -p /opt/conda && \
   18      rm ~/miniconda.sh && \
   19      /opt/conda/bin/conda install -y python=$PYTHON_VERSION numpy pyyaml scipy ipython mkl mkl-include ninja cython typing && \
   20      /opt/conda/bin/conda install -y -c pytorch magma-cuda100 && \
   21      /opt/conda/bin/conda clean -ya
   22 ENV PATH /opt/conda/bin:$PATH
   23 # This must be done before pip so that requirements.txt is available
   24 WORKDIR /opt/pytorch
   25 COPY . .
   26 
   27 RUN git submodule sync && git submodule update --init --recursive
   28 RUN TORCH_CUDA_ARCH_LIST="3.5 5.2 6.0 6.1 7.0+PTX" TORCH_NVCC_FLAGS="-Xfatbin -compress-all" \
   29     CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" \
   30     pip install -v .
   31 
   32 RUN if [ "$WITH_TORCHVISION" = "1" ] ; then git clone https://github.com/pytorch/vision.git && cd vision && pip install -v . ; else echo "building without torchvision" ; fi
   33 
   34 WORKDIR /workspace
   35 RUN chmod -R a+w .