From efa21b120ba1dfc51fc5e211cf2b5978f39b55b1 Mon Sep 17 00:00:00 2001 From: pangyoki Date: Sat, 7 May 2022 15:05:58 +0800 Subject: [PATCH] =?UTF-8?q?[dockerfile]=20add=20cuda11.6=E3=80=81cuda11.5?= =?UTF-8?q?=E3=80=81cuda11.4=E3=80=81cuda11.3=20manylinux=20docker=20(#412?= =?UTF-8?q?51)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add cuda11.5 manylinux docker * build.sh * fix * fix * support cu113 and cu114 * add --no-check-certificate when wget sqlite-autoconf-3250300 * change cuda11.4.2 to cuda11.4.3 * add cu116 --- tools/dockerfile/Dockerfile.centos | 2 +- tools/dockerfile/build_scripts/build.sh | 2 +- tools/dockerfile/build_scripts/build_utils.sh | 2 +- .../dockerfile/build_scripts/install_nccl2.sh | 2 +- tools/dockerfile/centos7_manylinux.sh | 32 +++++++++++++++++++ 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/tools/dockerfile/Dockerfile.centos b/tools/dockerfile/Dockerfile.centos index 900ca9b7a97..e5b1137090f 100644 --- a/tools/dockerfile/Dockerfile.centos +++ b/tools/dockerfile/Dockerfile.centos @@ -65,7 +65,7 @@ RUN LD_LIBRARY_PATH=/opt/_internal/cpython-3.6.0/lib/:${LD_LIBRARY_PATH} /opt/_i LD_LIBRARY_PATH=/opt/_internal/cpython-3.8.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.8.0/bin/pip3 install pre-commit 'ipython==5.3.0' && \ LD_LIBRARY_PATH=/opt/_internal/cpython-3.9.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.9.0/bin/pip3 install pre-commit 'ipython==5.3.0' -RUN wget -O /opt/swig-2.0.12.tar.gz https://sourceforge.net/projects/swig/files/swig/swig-2.0.12/swig-2.0.12.tar.gz/download && \ +RUN wget -O /opt/swig-2.0.12.tar.gz --no-check-certificate https://sourceforge.net/projects/swig/files/swig/swig-2.0.12/swig-2.0.12.tar.gz/download && \ cd /opt && tar xzf swig-2.0.12.tar.gz && cd /opt/swig-2.0.12 && ./configure && make && make install && cd /opt && rm swig-2.0.12.tar.gz # ccache 3.7.9 diff --git a/tools/dockerfile/build_scripts/build.sh b/tools/dockerfile/build_scripts/build.sh index 393bd045fb7..92d1c12d2bc 100644 --- a/tools/dockerfile/build_scripts/build.sh +++ b/tools/dockerfile/build_scripts/build.sh @@ -149,7 +149,7 @@ LD_LIBRARY_PATH="${ORIGINAL_LD_LIBRARY_PATH}" # According to ar issues: https://lists.gnu.org/archive/html/bug-binutils/2016-05/msg00211.html # we should install new version ar with 64-bit supported here -wget https://ftp.gnu.org/gnu/binutils/binutils-2.27.tar.gz +wget --no-check-certificate https://ftp.gnu.org/gnu/binutils/binutils-2.27.tar.gz tar xzf binutils-2.27.tar.gz && cd binutils-2.27 ./configure --prefix=/opt/rh/devtoolset-2/root/usr/ --enable-64-bit-archive && make -j `nproc` && make install cd .. && rm binutils-2.27.tar.gz && rm -rf binutils-2.27 diff --git a/tools/dockerfile/build_scripts/build_utils.sh b/tools/dockerfile/build_scripts/build_utils.sh index 18dda5be460..a714fd11ad4 100755 --- a/tools/dockerfile/build_scripts/build_utils.sh +++ b/tools/dockerfile/build_scripts/build_utils.sh @@ -66,7 +66,7 @@ function do_cpython_build { # -Wformat added for https://bugs.python.org/issue17547 on Python 2.6 if [ $(lex_pyver $py_ver) -ge $(lex_pyver 3.6) ]; then - wget -q https://www.sqlite.org/2018/sqlite-autoconf-3250300.tar.gz + wget -q --no-check-certificate https://www.sqlite.org/2018/sqlite-autoconf-3250300.tar.gz tar -zxf sqlite-autoconf-3250300.tar.gz cd sqlite-autoconf-3250300 ./configure --prefix=/usr/local diff --git a/tools/dockerfile/build_scripts/install_nccl2.sh b/tools/dockerfile/build_scripts/install_nccl2.sh index 07f186f3d4e..6d44dbb9054 100644 --- a/tools/dockerfile/build_scripts/install_nccl2.sh +++ b/tools/dockerfile/build_scripts/install_nccl2.sh @@ -17,7 +17,7 @@ VERSION=$(nvcc --version | grep release | grep -oEi "release ([0-9]+)\.([0-9])"| sed "s/release //") if [ "$VERSION" == "10.0" ]; then DEB="nccl-repo-ubuntu1604-2.4.7-ga-cuda10.0_1-1_amd64.deb" -elif [ "$VERSION" == "10.2" ] || [ "$VERSION" == "10.1" ] || [ "$VERSION" == "11.0" ] || [ "$VERSION" == "11.2" ]; then +elif [ "$VERSION" == "10.2" ] || [ "$VERSION" == "10.1" ] || [ "$VERSION" == "11.0" ] || [ "$VERSION" == "11.2" ] || [ "$VERSION" == "11.3" ] || [ "$VERSION" == "11.4" ] || [ "$VERSION" == "11.5" ] || [ "$VERSION" == "11.6" ]; then if [ -f "/etc/redhat-release" ];then rm -f /usr/local/lib/libnccl.so wget --no-check-certificate -q https://nccl2-deb.cdn.bcebos.com/libnccl-2.7.8-1+cuda10.2.x86_64.rpm diff --git a/tools/dockerfile/centos7_manylinux.sh b/tools/dockerfile/centos7_manylinux.sh index 6038e464097..47f64ec340b 100755 --- a/tools/dockerfile/centos7_manylinux.sh +++ b/tools/dockerfile/centos7_manylinux.sh @@ -100,6 +100,26 @@ function make_cuda112cudnn821trt8034gcc54() { sed -i '/CMD/iRUN ldconfig' Dockerfile.tmp } +function make_cuda113cudnn8() { + sed 's//11.3.1-cudnn8-devel-centos7/g' Dockerfile.centos >Dockerfile.tmp + sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_gcc.sh gcc82 \nRUN mv /usr/bin/cc /usr/bin/cc.bak \&\& ln -s /usr/local/gcc-8.2/bin/gcc /usr/bin/cc \nENV PATH=/usr/local/gcc-8.2/bin:\$PATH \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp +} + +function make_cuda114cudnn8() { + sed 's//11.4.3-cudnn8-devel-centos7/g' Dockerfile.centos >Dockerfile.tmp + sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_gcc.sh gcc82 \nRUN mv /usr/bin/cc /usr/bin/cc.bak \&\& ln -s /usr/local/gcc-8.2/bin/gcc /usr/bin/cc \nENV PATH=/usr/local/gcc-8.2/bin:\$PATH \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp +} + +function make_cuda115cudnn8() { + sed 's//11.5.1-cudnn8-devel-centos7/g' Dockerfile.centos >Dockerfile.tmp + sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_gcc.sh gcc82 \nRUN mv /usr/bin/cc /usr/bin/cc.bak \&\& ln -s /usr/local/gcc-8.2/bin/gcc /usr/bin/cc \nENV PATH=/usr/local/gcc-8.2/bin:\$PATH \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp +} + +function make_cuda116cudnn8() { + sed 's//11.6.2-cudnn8-devel-centos7/g' Dockerfile.centos >Dockerfile.tmp + sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_gcc.sh gcc82 \nRUN mv /usr/bin/cc /usr/bin/cc.bak \&\& ln -s /usr/local/gcc-8.2/bin/gcc /usr/bin/cc \nENV PATH=/usr/local/gcc-8.2/bin:\$PATH \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp +} + function main() { local CMD=$1 case $CMD in @@ -145,6 +165,18 @@ function main() { cuda112cudnn821trt8034gcc54) make_cuda112cudnn821trt8034gcc54 ;; + cuda113cudnn8) + make_cuda113cudnn8 + ;; + cuda114cudnn8) + make_cuda114cudnn8 + ;; + cuda115cudnn8) + make_cuda115cudnn8 + ;; + cuda116cudnn8) + make_cuda116cudnn8 + ;; *) echo "Make dockerfile error, Without this paramet." exit 1 -- GitLab