Skip to content

Instantly share code, notes, and snippets.

@sinkingsugar
Created February 20, 2019 08:51
Show Gist options
  • Save sinkingsugar/81a42c6104bf01efd00e1d4ff9358c9b to your computer and use it in GitHub Desktop.
Save sinkingsugar/81a42c6104bf01efd00e1d4ff9358c9b to your computer and use it in GitHub Desktop.
Pytorch build
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
RUN apt-get update && apt-get install -y build-essential git cmake python3-pip libmpfr-dev libgmp-dev wget curl
RUN pip3 install pyyaml
RUN pip3 install typing
RUN cd && \
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN cd && \
chmod +x Miniconda3-latest-Linux-x86_64.sh && \
./Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda3
RUN /root/miniconda3/bin/conda install conda-build anaconda-client
SHELL ["/bin/bash", "-c"]
ENV PATH /root/miniconda3/bin:$PATH
ARG PYTORCH_COMMIT
RUN cd && \
git clone -b fragcolor-devel https://github.com/fragcolor-xyz/pytorch.git && \
cd pytorch && \
git reset --hard ${PYTORCH_COMMIT}
RUN cd && \
cd pytorch && \
git submodule update --init --recursive
RUN conda install mkl mkl-include intel-openmp numpy
# download magma 2.4.0 pre built using same docker images - dynamic version
RUN cd && curl -L -o magmalib.tar.gz "https://drive.google.com/uc?export=download&id=1ABrWQxC9FxVSxa9tBx340jhsfg-4etjJ" && tar xzf magmalib.tar.gz
ENV PYTORCH_PYTHON=python3
ENV MAGMA_HOME=/root/output
ENV NO_MKLDNN=1
ENV NO_TEST=1
ENV USE_NUMPY=1
ENV USE_CUDA=1
ENV USE_FBGEMM=1
ENV MAX_JOBS=6
ENV CMAKE_INCLUDE_PATH=/root/miniconda3/include
ENV CMAKE_LIBRARY_PATH=/root/miniconda3/lib
RUN cd && \
cd pytorch && \
python setup.py develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment