Skip to content
Permalink
Browse files

docker files for wheel

  • Loading branch information...
soumith committed Apr 20, 2018
1 parent 4119ed0 commit 44d9bfa607a7616c66fe6492fadd8f05f3578b93
Showing with 117 additions and 117 deletions.
  1. +26 −27 manywheel/Dockerfile_80
  2. +37 −23 manywheel/Dockerfile_90
  3. +42 −23 manywheel/Dockerfile_91
  4. +12 −44 manywheel/build.sh
@@ -1,32 +1,30 @@
FROM nvidia/cuda:8.0-devel-centos6
FROM nvidia/cuda:8.0-devel-centos7

# MKL
RUN mkdir -p /opt/intel/lib
COPY mkl_libs/libmkl_core.a /opt/intel/lib/libmkl_core.a
COPY mkl_libs/libmkl_gnu_thread.a /opt/intel/lib/libmkl_gnu_thread.a
COPY mkl_libs/libmkl_intel_lp64.a /opt/intel/lib/libmkl_intel_lp64.a

RUN yum install -y git wget curl util-linux xz perl


ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# get devtoolset-2
RUN yum install -y yum-utils
RUN yum install -y centos-release-scl
RUN yum install -y wget curl perl util-linux xz bzip2 git patch which perl
RUN yum install -y yum-utils centos-release-scl
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
RUN wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
RUN yum install -y devtoolset-2-gcc
RUN yum install -y devtoolset-2-gcc-c++
RUN yum install -y devtoolset-2-gcc-gfortran
RUN yum install -y devtoolset-2-binutils
ENV PATH=/opt/rh/devtoolset-2/root/usr/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/rh/devtoolset-2/root/usr/lib64:/opt/rh/devtoolset-2/root/usr/lib:$LD_LIBRARY_PATH
RUN yum install -y devtoolset-3-gcc devtoolset-3-gcc-c++ devtoolset-3-gcc-gfortran devtoolset-3-binutils
ENV PATH=/opt/rh/devtoolset-3/root/usr/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/rh/devtoolset-3/root/usr/lib64:/opt/rh/devtoolset-3/root/usr/lib:$LD_LIBRARY_PATH

# EPEL for cmake
RUN wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
rpm -ivh epel-release-latest-7.noarch.rpm && \
rm -f epel-release-latest-7.noarch.rpm

# cmake
RUN yum install -y cmake
RUN yum install -y cmake3 && \
ln -s /usr/bin/cmake3 /usr/bin/cmake

# build python
COPY build_scripts /build_scripts
@@ -40,27 +38,28 @@ RUN rm -rf /opt/python/cp26-cp26mu /opt/_internal/cpython-2.6.9-ucs4
RUN rm -rf /opt/python/cp33-cp33m /opt/_internal/cpython-3.3.6
RUN rm -rf /opt/python/cp34-cp34m /opt/_internal/cpython-3.4.6

# get latest cuda patch
RUN wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/patches/2/cuda_8.0.61.2_linux-run && \
RUN wget -q https://developer.nvidia.com/compute/cuda/8.0/Prod2/patches/2/cuda_8.0.61.2_linux-run && \
chmod +x cuda_8.0.61.2_linux-run && \
cp /usr/local/cuda/version.txt /tmp/ && \
./cuda_8.0.61.2_linux-run --silent --accept-eula --installdir=/tmp && \
yes | cp -P /tmp/lib64/* /usr/local/cuda/lib64/
yes | cp -P /tmp/lib64/* /usr/local/cuda/lib64/ && \
rm -rf /usr/local/cuda/lib64/lib*blas.so.8.0.61 && \
rm -r cuda_8.0.61.2_linux-run

# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
RUN curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v7.0.5/cudnn-8.0-linux-x64-v7.tgz -O && \
tar --no-same-owner -xzf cudnn-8.0-linux-x64-v7.tgz -C /usr/local && \
rm cudnn-8.0-linux-x64-v7.tgz && \
RUN curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v7.1.2/cudnn-8.0-linux-x64-v7.1.tgz -O && \
tar --no-same-owner -xzf cudnn-8.0-linux-x64-v7.1.tgz -C /usr/local && \
rm cudnn-8.0-linux-x64-v7.1.tgz && \
ldconfig

# NCCL2
RUN wget https://s3.amazonaws.com/pytorch/nccl_2.1.4-1%2Bcuda8.0_x86_64.txz && \
RUN wget -q https://s3.amazonaws.com/pytorch/nccl_2.1.15-1%2Bcuda8.0_x86_64.txz && \
ls && \
ls -alh nccl_2.1.4-1+cuda8.0_x86_64.txz && \
tar --no-same-owner -xvf nccl_2.1.4-1+cuda8.0_x86_64.txz && \
mv nccl_2.1.4-1+cuda8.0_x86_64/include/* /usr/local/cuda/include/ && \
cp -P nccl_2.1.4-1+cuda8.0_x86_64/lib/libnccl* /usr/local/cuda/lib64/ && \
rm -rf nccl_2.1.4-1+cuda8.0_x86_64* && \
ls -alh nccl_2.1.15-1+cuda8.0_x86_64.txz && \
tar --no-same-owner -xvf nccl_2.1.15-1+cuda8.0_x86_64.txz && \
mv nccl_2.1.15-1+cuda8.0_x86_64/include/* /usr/local/cuda/include/ && \
cp -P nccl_2.1.15-1+cuda8.0_x86_64/lib/libnccl* /usr/local/cuda/lib64/ && \
rm -rf nccl_2.1.15-1+cuda8.0_x86_64* && \
ldconfig

# magma
@@ -1,32 +1,30 @@
FROM nvidia/cuda:9.0-devel-centos6
FROM nvidia/cuda:8.0-devel-centos7

# MKL
RUN mkdir -p /opt/intel/lib
COPY mkl_libs/libmkl_core.a /opt/intel/lib/libmkl_core.a
COPY mkl_libs/libmkl_gnu_thread.a /opt/intel/lib/libmkl_gnu_thread.a
COPY mkl_libs/libmkl_intel_lp64.a /opt/intel/lib/libmkl_intel_lp64.a

RUN yum install -y git wget curl util-linux xz perl


ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# get devtoolset-2
RUN yum install -y yum-utils
RUN yum install -y centos-release-scl
RUN yum install -y wget curl perl util-linux xz bzip2 git patch which perl
RUN yum install -y yum-utils centos-release-scl
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
RUN wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
RUN yum install -y devtoolset-2-gcc
RUN yum install -y devtoolset-2-gcc-c++
RUN yum install -y devtoolset-2-gcc-gfortran
RUN yum install -y devtoolset-2-binutils
ENV PATH=/opt/rh/devtoolset-2/root/usr/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/rh/devtoolset-2/root/usr/lib64:/opt/rh/devtoolset-2/root/usr/lib:$LD_LIBRARY_PATH
RUN yum install -y devtoolset-3-gcc devtoolset-3-gcc-c++ devtoolset-3-gcc-gfortran devtoolset-3-binutils
ENV PATH=/opt/rh/devtoolset-3/root/usr/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/rh/devtoolset-3/root/usr/lib64:/opt/rh/devtoolset-3/root/usr/lib:$LD_LIBRARY_PATH

# EPEL for cmake
RUN wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
rpm -ivh epel-release-latest-7.noarch.rpm && \
rm -f epel-release-latest-7.noarch.rpm

# cmake
RUN yum install -y cmake
RUN yum install -y cmake3 && \
ln -s /usr/bin/cmake3 /usr/bin/cmake

# build python
COPY build_scripts /build_scripts
@@ -40,19 +38,35 @@ RUN rm -rf /opt/python/cp26-cp26mu /opt/_internal/cpython-2.6.9-ucs4
RUN rm -rf /opt/python/cp33-cp33m /opt/_internal/cpython-3.3.6
RUN rm -rf /opt/python/cp34-cp34m /opt/_internal/cpython-3.4.6

# install CUDA 9.0 in the same container
RUN wget -q https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run && \
chmod +x cuda_9.0.176_384.81_linux-run && \
./cuda_9.0.176_384.81_linux-run --silent --no-opengl-libs --toolkit && \
rm -f cuda_9.0.176_384.81_linux-run

# patch 1, patch2
RUN wget -q https://developer.nvidia.com/compute/cuda/9.0/Prod/patches/1/cuda_9.0.176.1_linux-run && \
chmod +x cuda_9.0.176.1_linux-run && \
./cuda_9.0.176.1_linux-run -s --accept-eula && \
rm -f cuda_9.0.176.1_linux-run
RUN wget -q https://developer.nvidia.com/compute/cuda/9.0/Prod/patches/2/cuda_9.0.176.2_linux-run && \
chmod +x cuda_9.0.176.2_linux-run && \
./cuda_9.0.176.2_linux-run -s --accept-eula && \
rm -f cuda_9.0.176.2_linux-run

# install CUDA 9.0 CuDNN
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
RUN curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v7.0.5/cudnn-9.0-linux-x64-v7.tgz -O && \
tar --no-same-owner -xzf cudnn-9.0-linux-x64-v7.tgz -C /usr/local && \
rm cudnn-9.0-linux-x64-v7.tgz && \
RUN curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v7.1.2/cudnn-9.0-linux-x64-v7.1.tgz -O && \
tar --no-same-owner -xzf cudnn-9.0-linux-x64-v7.1.tgz -C /usr/local && \
rm cudnn-9.0-linux-x64-v7.1.tgz && \
ldconfig

# NCCL2
RUN wget https://s3.amazonaws.com/pytorch/nccl_2.1.4-1%2Bcuda9.0_x86_64.txz && \
tar --no-same-owner -xvf nccl_2.1.4-1+cuda9.0_x86_64.txz && \
mv nccl_2.1.4-1+cuda9.0_x86_64/include/* /usr/local/cuda/include/ && \
cp -P nccl_2.1.4-1+cuda9.0_x86_64/lib/libnccl* /usr/local/cuda/lib64/ && \
rm -rf nccl_2.1.4-1+cuda9.0_x86_64* && \
RUN wget -q https://s3.amazonaws.com/pytorch/nccl_2.1.15-1%2Bcuda9.0_x86_64.txz && \
tar --no-same-owner -xvf nccl_2.1.15-1+cuda9.0_x86_64.txz && \
mv nccl_2.1.15-1+cuda9.0_x86_64/include/* /usr/local/cuda/include/ && \
cp -P nccl_2.1.15-1+cuda9.0_x86_64/lib/libnccl* /usr/local/cuda/lib64/ && \
rm -rf nccl_2.1.15-1+cuda9.0_x86_64* && \
ldconfig

# magma
@@ -1,32 +1,30 @@
FROM nvidia/cuda:9.1-devel-centos6
FROM nvidia/cuda:8.0-devel-centos7

# MKL
RUN mkdir -p /opt/intel/lib
COPY mkl_libs/libmkl_core.a /opt/intel/lib/libmkl_core.a
COPY mkl_libs/libmkl_gnu_thread.a /opt/intel/lib/libmkl_gnu_thread.a
COPY mkl_libs/libmkl_intel_lp64.a /opt/intel/lib/libmkl_intel_lp64.a

RUN yum install -y git wget curl util-linux xz perl


ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# get devtoolset-2
RUN yum install -y yum-utils
RUN yum install -y centos-release-scl
RUN yum install -y wget curl perl util-linux xz bzip2 git patch which perl
RUN yum install -y yum-utils centos-release-scl
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
RUN wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
RUN yum install -y devtoolset-2-gcc
RUN yum install -y devtoolset-2-gcc-c++
RUN yum install -y devtoolset-2-gcc-gfortran
RUN yum install -y devtoolset-2-binutils
ENV PATH=/opt/rh/devtoolset-2/root/usr/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/rh/devtoolset-2/root/usr/lib64:/opt/rh/devtoolset-2/root/usr/lib:$LD_LIBRARY_PATH
RUN yum install -y devtoolset-3-gcc devtoolset-3-gcc-c++ devtoolset-3-gcc-gfortran devtoolset-3-binutils
ENV PATH=/opt/rh/devtoolset-3/root/usr/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/rh/devtoolset-3/root/usr/lib64:/opt/rh/devtoolset-3/root/usr/lib:$LD_LIBRARY_PATH

# EPEL for cmake
RUN wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
rpm -ivh epel-release-latest-7.noarch.rpm && \
rm -f epel-release-latest-7.noarch.rpm

# cmake
RUN yum install -y cmake
RUN yum install -y cmake3 && \
ln -s /usr/bin/cmake3 /usr/bin/cmake

# build python
COPY build_scripts /build_scripts
@@ -40,19 +38,40 @@ RUN rm -rf /opt/python/cp26-cp26mu /opt/_internal/cpython-2.6.9-ucs4
RUN rm -rf /opt/python/cp33-cp33m /opt/_internal/cpython-3.3.6
RUN rm -rf /opt/python/cp34-cp34m /opt/_internal/cpython-3.4.6

# install CUDA 9.1 in the same container
RUN wget -q https://developer.nvidia.com/compute/cuda/9.1/Prod/local_installers/cuda_9.1.85_387.26_linux && \
chmod +x cuda_9.1.85_387.26_linux && \
./cuda_9.1.85_387.26_linux --silent --no-opengl-libs --toolkit && \
rm -f cuda_9.1.85_387.26_linux

# patch 1, patch2, patch3
RUN wget -q https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/1/cuda_9.1.85.1_linux && \
chmod +x cuda_9.1.85.1_linux && \
./cuda_9.1.85.1_linux -s --accept-eula && \
rm -f cuda_9.1.85.1_linux
RUN wget -q https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/2/cuda_9.1.85.2_linux && \
chmod +x cuda_9.1.85.2_linux && \
./cuda_9.1.85.2_linux -s --accept-eula && \
rm -f cuda_9.1.85.2_linux
RUN wget -q https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/3/cuda_9.1.85.3_linux && \
chmod +x cuda_9.1.85.3_linux && \
./cuda_9.1.85.3_linux -s --accept-eula && \
rm -f cuda_9.1.85.3_linux


# install CUDA 9.1 CuDNN
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
RUN curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v7.0.5/cudnn-9.1-linux-x64-v7.tgz -O && \
tar --no-same-owner -xzf cudnn-9.1-linux-x64-v7.tgz -C /usr/local && \
rm cudnn-9.1-linux-x64-v7.tgz && \
RUN curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v7.1.2/cudnn-9.1-linux-x64-v7.1.tgz -O && \
tar --no-same-owner -xzf cudnn-9.1-linux-x64-v7.1.tgz -C /usr/local && \
rm cudnn-9.1-linux-x64-v7.1.tgz && \
ldconfig

# NCCL2
RUN wget https://s3.amazonaws.com/pytorch/nccl_2.1.4-1%2Bcuda9.1_x86_64.txz && \
tar --no-same-owner -xvf nccl_2.1.4-1+cuda9.1_x86_64.txz && \
mv nccl_2.1.4-1+cuda9.1_x86_64/include/* /usr/local/cuda/include/ && \
cp -P nccl_2.1.4-1+cuda9.1_x86_64/lib/libnccl* /usr/local/cuda/lib64/ && \
rm -rf nccl_2.1.4-1+cuda9.1_x86_64* && \
RUN wget -q https://s3.amazonaws.com/pytorch/nccl_2.1.15-1%2Bcuda9.1_x86_64.txz && \
tar --no-same-owner -xvf nccl_2.1.15-1+cuda9.1_x86_64.txz && \
mv nccl_2.1.15-1+cuda9.1_x86_64/include/* /usr/local/cuda/include/ && \
cp -P nccl_2.1.15-1+cuda9.1_x86_64/lib/libnccl* /usr/local/cuda/lib64/ && \
rm -rf nccl_2.1.15-1+cuda9.1_x86_64* && \
ldconfig

# magma
Oops, something went wrong.

0 comments on commit 44d9bfa

Please sign in to comment.
You can’t perform that action at this time.