This is an automated email from the ASF dual-hosted git repository.

jevans pushed a commit to branch v1.9.x
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/v1.9.x by this push:
     new 71dab74cf5 Refactor CD to support newer cuda versions (11.0-11.7) 
(#21123)
71dab74cf5 is described below

commit 71dab74cf5838163be941fd86cd8382fff5315e3
Author: Joe Evans <[email protected]>
AuthorDate: Thu Aug 18 14:53:07 2022 -0700

    Refactor CD to support newer cuda versions (11.0-11.7) (#21123)
    
    * WIP to add cuda build versions.
    
    * WIP to add cuda build versions.
    
    * Remove sudo install, moved to CD specific dockerfile.
    
    * Allow passing of linker flags for Distribution build type.
    
    * Update distribution cmake configs, add new configs for newer cuda 
versions.
    
    * Update cuda versions to build in CD.
    
    * Update base images for GPU, add new Cuda 11.6 container.
    
    * Correctly set LD_LIBRARY_PATH.
    
    * Provide cmake hints in dependency install scripts.
    
    * Refactor Cuda dependency installation to simplify and support newer 
versions.
    
    * Add new Dockerfile for CD builds.
    
    * Use new CD-specific container for building MXNet static library.
    
    * Add Cuda verions.
    
    * Upgrade to Python 3.8 in CentOS 7 containers.
    
    * Update base images.
    
    * Install requirements only if file exists.
    
    * Clean up dockerfile
    
    * Do not pin Cython, relax scipy version.
    
    * Install all build dependencies.
    
    * Add documentation.
    
    * Add documentation.
    
    * Set LD_LIBRARY_PATH to include stubs.
    
    * Build cmake from source for portability.
    
    * Install hdf5 headers during python install, as it is required for h5py 
module.
    
    * Install any dependencies via yum for cmake build.
    
    * Update libtiff to version that builds on aarch64.
    
    * Build libtiff and protobuf from source so we can statically link mxnet on 
aarch64.
    
    * Change centos7_aarch64_cpu container to install software using common 
scripts for consistency. Remove installing protobuf and other depedency 
libraries so we properly statically link to them.
    
    * Install pre-built cmake packages.
    
    * Use common method to install cmake.
    
    * Update pipelines to use supported cuda versions for static build tests.
    
    * Ensure required build tools are installed.
    
    * Install required headers for building all R packages.
    
    * Add/update make configs for newer Cuda versions.
    
    * Install gfortran as build dependency in CD image.
    
    * Use ldd to find actual path of dynamically linked libraries instead of 
guessing.
    
    * Add additional Cuda versions for CI testing.
    
    * Set minimum OSX version to support via C/CXXFLAGS to match what we build 
MXNet for.
    
    * Don't specify minimum OS version when building MXNet for OSX.
    
    * Turns out we can set target OSX version, but recently libtiff introduced 
zstd support, which doesn't link properly. Disabling support via --disable-zstd 
works.
    
    * Disable zlib, as it was previously.
    
    * Disable webp support in libtiff (present only in newer version)
---
 CMakeLists.txt                                     |   4 +-
 cd/Jenkinsfile_cd_pipeline                         |   2 +-
 cd/Jenkinsfile_release_job                         |   2 +-
 cd/mxnet_lib/Jenkins_pipeline.groovy               |   4 +-
 cd/utils/mxnet_base_image.sh                       |  22 +-
 ci/docker/Dockerfile.build.centos7                 |   1 +
 ci/docker/Dockerfile.build.centos7_aarch64_cpu     |  52 +---
 ci/docker/Dockerfile.build.centos7_cd              |  49 ++++
 ci/docker/Dockerfile.build.jetson                  |   9 +-
 ci/docker/docker-compose.yml                       |  44 ++-
 .../lz4.sh => ci/docker/install/centos7_cmake.sh   |  34 +--
 ci/docker/install/centos7_python.sh                |  23 +-
 ci/docker/install/requirements                     |   4 +-
 .../lz4.sh => ci/docker/install/ubuntu_cmake.sh    |  37 +--
 ci/docker/install/ubuntu_r.sh                      |   4 +-
 ci/docker/runtime_functions.sh                     |   8 +-
 ci/jenkins/Jenkins_steps.groovy                    |  18 +-
 config/distribution/linux_cu110.cmake              |   3 +-
 .../{linux_cu112.cmake => linux_cu111.cmake}       |   3 +-
 config/distribution/linux_cu112.cmake              |   3 +-
 .../{linux_cu112.cmake => linux_cu113.cmake}       |   3 +-
 .../{linux_cu112.cmake => linux_cu114.cmake}       |   3 +-
 .../{linux_cu112.cmake => linux_cu115.cmake}       |   3 +-
 .../{linux_cu112.cmake => linux_cu116.cmake}       |   3 +-
 .../{linux_cu112.cmake => linux_cu117.cmake}       |   3 +-
 make/staticbuild/linux_cpu.mk                      |   2 +-
 make/staticbuild/linux_cu110.mk                    |   2 +-
 .../staticbuild/{linux_cu112.mk => linux_cu111.mk} |   4 +-
 make/staticbuild/linux_cu112.mk                    |   2 +-
 .../staticbuild/{linux_cu112.mk => linux_cu113.mk} |   4 +-
 .../staticbuild/{linux_cu112.mk => linux_cu114.mk} |   4 +-
 .../staticbuild/{linux_cu112.mk => linux_cu115.mk} |   4 +-
 .../staticbuild/{linux_cu112.mk => linux_cu116.mk} |   4 +-
 .../staticbuild/{linux_cu112.mk => linux_cu117.mk} |   4 +-
 tools/dependencies/cityhash.sh                     |   1 +
 tools/dependencies/curl.sh                         |   1 +
 tools/dependencies/eigen.sh                        |   1 +
 tools/dependencies/libpng.sh                       |   5 +-
 tools/dependencies/libtiff.sh                      |   5 +-
 tools/dependencies/libturbojpeg.sh                 |   3 +-
 tools/dependencies/libz.sh                         |   1 +
 tools/dependencies/lz4.sh                          |   1 +
 tools/dependencies/make_shared_dependencies.sh     |   8 +-
 tools/dependencies/openblas.sh                     |   2 +
 tools/dependencies/opencv.sh                       |   2 +
 tools/dependencies/openssl.sh                      |   4 +-
 tools/dependencies/protobuf.sh                     |   1 +
 tools/dependencies/zmq.sh                          |   3 +-
 .../{CU112_ADDITIONAL.md => CU111_ADDITIONAL.md}   |   5 +-
 tools/pip/doc/CU112_ADDITIONAL.md                  |   1 +
 .../{CU112_ADDITIONAL.md => CU113_ADDITIONAL.md}   |   7 +-
 .../{CU112_ADDITIONAL.md => CU114_ADDITIONAL.md}   |   8 +-
 .../{CU112_ADDITIONAL.md => CU115_ADDITIONAL.md}   |   9 +-
 .../{CU112_ADDITIONAL.md => CU116_ADDITIONAL.md}   |  10 +-
 .../{CU112_ADDITIONAL.md => CU117_ADDITIONAL.md}   |  11 +-
 tools/setup_gpu_build_tools.sh                     | 296 ++++++---------------
 tools/staticbuild/build.sh                         |   1 +
 tools/staticbuild/build_lib.sh                     |  12 +-
 tools/staticbuild/build_lib_cmake.sh               |   2 +-
 59 files changed, 366 insertions(+), 405 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b5a126102..098ae34ab1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -147,8 +147,8 @@ if(CMAKE_BUILD_TYPE STREQUAL "Distribution" AND UNIX AND 
NOT APPLE)
   set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
   set(CMAKE_INSTALL_RPATH $\{ORIGIN\})
   # Enforce DT_PATH instead of DT_RUNPATH
-  set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--disable-new-dtags")
-  set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} 
-Wl,--disable-new-dtags")
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} 
-Wl,--disable-new-dtags")
   set(Protobuf_USE_STATIC_LIBS ON)
 endif()
 
diff --git a/cd/Jenkinsfile_cd_pipeline b/cd/Jenkinsfile_cd_pipeline
index c3f33a7f3a..f8b216572f 100644
--- a/cd/Jenkinsfile_cd_pipeline
+++ b/cd/Jenkinsfile_cd_pipeline
@@ -36,7 +36,7 @@ pipeline {
 
   parameters {
     // Release parameters
-    string(defaultValue: 
"cpu,native,cu100,cu101,cu102,cu110,cu112,aarch64_cpu", description: "Comma 
separated list of variants", name: "MXNET_VARIANTS")
+    string(defaultValue: 
"cpu,native,cu110,cu111,cu112,cu113,cu114,cu115,cu116,cu117,aarch64_cpu", 
description: "Comma separated list of variants", name: "MXNET_VARIANTS")
     booleanParam(defaultValue: false, description: 'Whether this is a release 
build or not', name: "RELEASE_BUILD")
   }
 
diff --git a/cd/Jenkinsfile_release_job b/cd/Jenkinsfile_release_job
index 309e66bcb6..49ff90a7c0 100644
--- a/cd/Jenkinsfile_release_job
+++ b/cd/Jenkinsfile_release_job
@@ -43,7 +43,7 @@ pipeline {
     // any disruption caused by different COMMIT_ID values chaning the job 
parameter configuration on
     // Jenkins.
     string(defaultValue: "mxnet_lib", description: "Pipeline to build", name: 
"RELEASE_JOB_TYPE")
-    string(defaultValue: 
"cpu,native,cu100,cu101,cu102,cu110,cu112,aarch64_cpu", description: "Comma 
separated list of variants", name: "MXNET_VARIANTS")
+    string(defaultValue: 
"cpu,native,cu110,cu111,cu112,cu113,cu114,cu115,cu116,cu117,aarch64_cpu", 
description: "Comma separated list of variants", name: "MXNET_VARIANTS")
     booleanParam(defaultValue: false, description: 'Whether this is a release 
build or not', name: "RELEASE_BUILD")
     string(defaultValue: "nightly_v1.x", description: "String used for naming 
docker images", name: "VERSION")
   }
diff --git a/cd/mxnet_lib/Jenkins_pipeline.groovy 
b/cd/mxnet_lib/Jenkins_pipeline.groovy
index 31da48928c..ed2eff173b 100644
--- a/cd/mxnet_lib/Jenkins_pipeline.groovy
+++ b/cd/mxnet_lib/Jenkins_pipeline.groovy
@@ -55,9 +55,7 @@ def build(mxnet_variant) {
     node(NODE_LINUX_CPU) {
       ws("workspace/mxnet_${libtype}/${mxnet_variant}/${env.BUILD_NUMBER}") {
         ci_utils.init_git()
-        // Compiling in Ubuntu14.04 due to glibc issues.
-        // This should be updates once we have clarity on this issue.
-        ci_utils.docker_run('centos7_cpu', "build_static_libmxnet 
${mxnet_variant}", false)
+        ci_utils.docker_run('centos7_cd', "build_static_libmxnet 
${mxnet_variant}", false)
         ci_utils.pack_lib("mxnet_${mxnet_variant}", 
libmxnet_pipeline.get_stash(mxnet_variant))
       }
     }
diff --git a/cd/utils/mxnet_base_image.sh b/cd/utils/mxnet_base_image.sh
index 7233321430..c5be64fc6b 100755
--- a/cd/utils/mxnet_base_image.sh
+++ b/cd/utils/mxnet_base_image.sh
@@ -31,10 +31,28 @@ case ${mxnet_variant} in
     echo "nvidia/cuda:10.2-cudnn8-runtime-ubuntu18.04"
     ;;
     cu110*)
-    echo "nvidia/cuda:11.0-cudnn8-runtime-ubuntu18.04"
+    echo "nvidia/cuda:11.0.3-cudnn8-runtime-ubuntu18.04"
+    ;;
+    cu111*)
+    echo "nvidia/cuda:11.1.1-cudnn8-runtime-ubuntu18.04"
     ;;
     cu112*)
-    echo "nvidia/cuda:11.2.1-cudnn8-runtime-ubuntu18.04"
+    echo "nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu18.04"
+    ;;
+    cu113*)
+    echo "nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu18.04"
+    ;;
+    cu114*)
+    echo "nvidia/cuda:11.4.3-cudnn8-runtime-ubuntu18.04"
+    ;;
+    cu115*)
+    echo "nvidia/cuda:11.5.2-cudnn8-runtime-ubuntu18.04"
+    ;;
+    cu116*)
+    echo "nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu18.04"
+    ;;
+    cu117*)
+    echo "nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu18.04"
     ;;
     cpu)
     echo "ubuntu:18.04"
diff --git a/ci/docker/Dockerfile.build.centos7 
b/ci/docker/Dockerfile.build.centos7
index 0114e9ba5b..8c0df1d91f 100644
--- a/ci/docker/Dockerfile.build.centos7
+++ b/ci/docker/Dockerfile.build.centos7
@@ -40,6 +40,7 @@ RUN /work/centos7_core.sh
 COPY install/centos7_ccache.sh /work/
 RUN /work/centos7_ccache.sh
 COPY install/centos7_python.sh /work/
+COPY install/requirements /work/
 RUN /work/centos7_python.sh
 COPY install/centos7_scala.sh /work/
 RUN /work/centos7_scala.sh
diff --git a/ci/docker/Dockerfile.build.centos7_aarch64_cpu 
b/ci/docker/Dockerfile.build.centos7_aarch64_cpu
index be9104250b..46c3e253dd 100644
--- a/ci/docker/Dockerfile.build.centos7_aarch64_cpu
+++ b/ci/docker/Dockerfile.build.centos7_aarch64_cpu
@@ -19,7 +19,7 @@
 # Dockerfile for CentOS 7 AArch64 CPU build.
 # Via the CentOS 7 Dockerfiles, we ensure MXNet continues to run fine on older 
systems.
 
-FROM arm64v8/centos:7
+FROM centos:7
 
 WORKDIR /work/deps
 
@@ -39,47 +39,29 @@ RUN yum -y check-update || true && \
         automake \
         autoconf \
         libtool \
-        protobuf-compiler \
-        protobuf-devel \
         # CentOS Software Collections https://www.softwarecollections.org
         devtoolset-10 \
         devtoolset-10-gcc \
         devtoolset-10-gcc-c++ \
         devtoolset-10-gcc-gfortran \
-        rh-python38 \
-        rh-python38-python-numpy \
-        rh-python38-python-scipy \
         # Libraries
-        opencv-devel \
-        openssl-devel \
-        zeromq-devel \
-        # Build-dependencies for ccache 3.7.9
-        gperf \
-        libb2-devel \
-        libzstd-devel && \
+        hdf5-devel && \
     yum clean all
 
-# Make Red Hat Developer Toolset 10.0 and Python 3.8 Software Collections 
available by default
+# Make Red Hat Developer Toolset 10.0 Software Collection available by default
 # during the following build steps in this Dockerfile
-SHELL [ "/usr/bin/scl", "enable", "devtoolset-10", "rh-python38" ]
+SHELL [ "/usr/bin/scl", "enable", "devtoolset-10" ]
 
-# Install minimum required cmake version
-RUN cd /usr/local/src && \
-    wget -nv https://cmake.org/files/v3.20/cmake-3.20.5-linux-aarch64.sh && \
-    sh cmake-3.20.5-linux-aarch64.sh --prefix=/usr/local --skip-license && \
-    rm cmake-3.20.5-linux-aarch64.sh
+# Fix the en_DK.UTF-8 locale to test locale invariance
+RUN localedef -i en_DK -f UTF-8 en_DK.UTF-8
 
-# ccache 3.7.9 has fixes for caching nvcc outputs
-RUN cd /usr/local/src && \
-    git clone --recursive https://github.com/ccache/ccache.git && \
-    cd ccache && \
-    git checkout v3.7.9 && \
-    ./autogen.sh && \
-    ./configure --disable-man && \
-    make -j$(nproc) && \
-    make install && \
-    cd /usr/local/src && \
-    rm -rf ccache
+# Install Python and dependency packages
+COPY install/centos7_python.sh /work/
+COPY install/requirements /work/
+RUN /work/centos7_python.sh
+
+COPY install/centos7_cmake.sh /work/
+RUN /work/centos7_cmake.sh
 
 # Arm Performance Libraries 21.0
 RUN cd /usr/local/src && \
@@ -89,14 +71,6 @@ RUN cd /usr/local/src && \
     rm -rf arm-performance-libraries_21.0_RHEL-7_gcc-8.2.tar 
arm-performance-libraries_21.0_RHEL-7_gcc-8.2
 ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.0_gcc-8.2/lib
 
-# Fix the en_DK.UTF-8 locale to test locale invariance
-RUN localedef -i en_DK -f UTF-8 en_DK.UTF-8
-
-# Python dependencies
-RUN python3 -m pip install --upgrade pip
-COPY install/requirements_aarch64 /work/
-RUN python3 -m pip install -r /work/requirements_aarch64
-
 ARG USER_ID=0
 COPY install/centos7_adduser.sh /work/
 RUN /work/centos7_adduser.sh
diff --git a/ci/docker/Dockerfile.build.centos7_cd 
b/ci/docker/Dockerfile.build.centos7_cd
new file mode 100644
index 0000000000..02bd695e7e
--- /dev/null
+++ b/ci/docker/Dockerfile.build.centos7_cd
@@ -0,0 +1,49 @@
+# -*- mode: dockerfile -*-
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# Dockerfile to build and run MXNet on CentOS 7 for CPU
+
+FROM centos:7
+
+WORKDIR /work/deps
+
+COPY install/centos7_base.sh /work/
+RUN /work/centos7_base.sh
+
+COPY install/centos7_python.sh /work/
+COPY install/requirements /work/
+RUN /work/centos7_python.sh
+
+ARG USER_ID=0
+COPY install/centos7_adduser.sh /work/
+RUN /work/centos7_adduser.sh
+
+# Install tools for static dependency builds
+RUN yum install -y sudo patchelf nasm automake libtool file gcc-c++ gcc 
gcc-gfortran
+
+# Allow jenkins user to use sudo for installing cuda libraries
+RUN echo "jenkins_slave ALL=(root) NOPASSWD: /usr/bin/yum, 
/usr/bin/yum-config-manager" >> /etc/sudoers.d/10_jenkins_slave
+
+# Install cmake
+COPY install/centos7_cmake.sh /work/
+RUN /work/centos7_cmake.sh
+
+ENV PYTHONPATH=./python/
+WORKDIR /work/mxnet
+
+COPY runtime_functions.sh /work/
diff --git a/ci/docker/Dockerfile.build.jetson 
b/ci/docker/Dockerfile.build.jetson
index 432c4c3fe6..287900f258 100644
--- a/ci/docker/Dockerfile.build.jetson
+++ b/ci/docker/Dockerfile.build.jetson
@@ -43,12 +43,9 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get 
install -y \
     crossbuild-essential-arm64 \
  && rm -rf /var/lib/apt/lists/*
 
-# cmake on Ubuntu 18.04 is too old
-RUN python3 -m pip install cmake
-
-# ccache on Ubuntu 18.04 is too old to support Cuda correctly
-COPY install/deb_ubuntu_ccache.sh /work/
-RUN /work/deb_ubuntu_ccache.sh
+# Install cmake
+COPY install/ubuntu_cmake.sh /work/
+RUN /work/ubuntu_cmake.sh
 
 COPY toolchains/aarch64-linux-gnu-toolchain.cmake /usr
 ENV CMAKE_TOOLCHAIN_FILE=/usr/aarch64-linux-gnu-toolchain.cmake
diff --git a/ci/docker/docker-compose.yml b/ci/docker/docker-compose.yml
index 07d538fb59..f5f49a2460 100644
--- a/ci/docker/docker-compose.yml
+++ b/ci/docker/docker-compose.yml
@@ -79,7 +79,7 @@ services:
       dockerfile: Dockerfile.build.centos7
       target: base
       args:
-        BASE_IMAGE: nvidia/cuda:11.0-cudnn8-devel-centos7
+        BASE_IMAGE: nvidia/cuda:11.0.3-cudnn8-devel-centos7
       cache_from:
         - ${DOCKER_CACHE_REGISTRY}:build.centos7_gpu_cu110
   centos7_gpu_cu112:
@@ -89,6 +89,46 @@ services:
       dockerfile: Dockerfile.build.centos7
       target: base
       args:
-        BASE_IMAGE: nvidia/cuda:11.2.1-cudnn8-devel-centos7
+        BASE_IMAGE: nvidia/cuda:11.2.2-cudnn8-devel-centos7
       cache_from:
         - ${DOCKER_CACHE_REGISTRY}:build.centos7_gpu_cu112
+  centos7_gpu_cu114:
+    image: ${DOCKER_CACHE_REGISTRY}:build.centos7_gpu_cu114
+    build:
+      context: .
+      dockerfile: Dockerfile.build.centos7
+      target: base
+      args:
+        BASE_IMAGE: nvidia/cuda:11.4.3-cudnn8-devel-centos7
+      cache_from:
+        - ${DOCKER_CACHE_REGISTRY}:build.centos7_gpu_cu114
+  centos7_gpu_cu115:
+    image: ${DOCKER_CACHE_REGISTRY}:build.centos7_gpu_cu115
+    build:
+      context: .
+      dockerfile: Dockerfile.build.centos7
+      target: base
+      args:
+        BASE_IMAGE: nvidia/cuda:11.5.2-cudnn8-devel-centos7
+      cache_from:
+        - ${DOCKER_CACHE_REGISTRY}:build.centos7_gpu_cu115
+  centos7_gpu_cu116:
+    image: ${DOCKER_CACHE_REGISTRY}:build.centos7_gpu_cu116
+    build:
+      context: .
+      dockerfile: Dockerfile.build.centos7
+      target: base
+      args:
+        BASE_IMAGE: nvidia/cuda:11.6.2-cudnn8-devel-centos7
+      cache_from:
+        - ${DOCKER_CACHE_REGISTRY}:build.centos7_gpu_cu116
+  centos7_gpu_cu117:
+    image: ${DOCKER_CACHE_REGISTRY}:build.centos7_gpu_cu117
+    build:
+      context: .
+      dockerfile: Dockerfile.build.centos7
+      target: base
+      args:
+        BASE_IMAGE: nvidia/cuda:11.7.1-cudnn8-devel-centos7
+      cache_from:
+        - ${DOCKER_CACHE_REGISTRY}:build.centos7_gpu_cu117
diff --git a/tools/dependencies/lz4.sh b/ci/docker/install/centos7_cmake.sh
similarity index 63%
copy from tools/dependencies/lz4.sh
copy to ci/docker/install/centos7_cmake.sh
index ce72908fdc..71f9a61cd5 100755
--- a/tools/dependencies/lz4.sh
+++ b/ci/docker/install/centos7_cmake.sh
@@ -17,19 +17,23 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# This script builds the static library of lz4 that can be used as dependency 
of mxnet.
 set -ex
-LZ4_VERSION=r130
-if [[ ! -f $DEPS_PATH/lib/liblz4.a ]]; then
-    # Download and build lz4
-    >&2 echo "Building lz4..."
-    download \
-        https://github.com/lz4/lz4/archive/${LZ4_VERSION}.zip \
-        ${DEPS_PATH}/lz4.zip
-    unzip -q $DEPS_PATH/lz4.zip -d $DEPS_PATH
-    pushd .
-    cd $DEPS_PATH/lz4-$LZ4_VERSION
-    $MAKE
-    $MAKE PREFIX=$DEPS_PATH install
-    popd
-fi
+
+pushd .
+
+yum install -y wget
+
+mkdir -p /work/deps/cmake
+cd /work/deps/cmake
+
+CMAKE_VERSION=3.24.0
+CMAKE_MAJOR=$(echo $CMAKE_VERSION | cut -d. -f1,2)
+CMAKE_ARCH=$(uname -m)
+wget -q 
https://cmake.org/files/v$CMAKE_MAJOR/cmake-$CMAKE_VERSION-linux-$CMAKE_ARCH.sh
+sh cmake-$CMAKE_VERSION-linux-$CMAKE_ARCH.sh --prefix=/usr/local --skip-license
+
+cd /work/deps
+rm -rf /work/deps/cmake
+
+popd
+
diff --git a/ci/docker/install/centos7_python.sh 
b/ci/docker/install/centos7_python.sh
index a90e2f6d82..edaff09537 100755
--- a/ci/docker/install/centos7_python.sh
+++ b/ci/docker/install/centos7_python.sh
@@ -22,12 +22,19 @@
 
 set -ex
 
- # Python 2.7 is installed by default, install 3.6 on top
-yum -y install https://repo.ius.io/ius-release-el7.rpm
-yum -y install python36u
+yum -y install gcc make wget openssl-devel bzip2-devel libffi-devel \
+    hdf5-devel xz-devel
 
-# Install PIP
-curl "https://bootstrap.pypa.io/pip/3.6/get-pip.py"; -o "get-pip.py"
-python3.6 get-pip.py
-# Allow numpy version as advanced as 1.19.5 to avoid CVE-2021-41495 and 
CVE-2021-41496 affecting <1.19.1.
-python3.6 -m pip install nose pylint 'numpy>=1.16.0,<1.20.0' nose-timer 
requests 'h5py<3' scipy==1.2.3 packaging
+PYTHON_VERSION=3.8.12
+wget -q 
https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz
+tar -xzf Python-$PYTHON_VERSION.tgz
+cd Python-$PYTHON_VERSION
+./configure --prefix=/usr/local
+make -j $(nproc)
+make install
+cd ..
+rm -rf Python-$PYTHON_VERSION*
+pip3 install --upgrade pip setuptools wheel
+if [[ -f /work/requirements ]]; then
+    pip3 install -r /work/requirements
+fi
diff --git a/ci/docker/install/requirements b/ci/docker/install/requirements
index 3068b9f3c8..468a7bb456 100644
--- a/ci/docker/install/requirements
+++ b/ci/docker/install/requirements
@@ -20,7 +20,7 @@
 
 boto3==1.9.229
 cpplint==1.3.0
-Cython==0.29.24
+Cython
 decorator==4.4.0
 h5py<3
 mock==2.0.0
@@ -31,7 +31,7 @@ numpy>=1.16.0,<1.20.0
 pylint==2.3.1  # pylint and astroid need to be aligned
 astroid==2.3.3  # pylint and astroid need to be aligned
 requests<2.19.0,>=2.18.4
-scipy==1.2.1
+scipy<1.7.0 # Restrict scipy version due to 
https://github.com/apache/incubator-mxnet/issues/20389
 setuptools
 coverage
 packaging
diff --git a/tools/dependencies/lz4.sh b/ci/docker/install/ubuntu_cmake.sh
similarity index 63%
copy from tools/dependencies/lz4.sh
copy to ci/docker/install/ubuntu_cmake.sh
index ce72908fdc..5c5e2ecacc 100755
--- a/tools/dependencies/lz4.sh
+++ b/ci/docker/install/ubuntu_cmake.sh
@@ -17,19 +17,26 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# This script builds the static library of lz4 that can be used as dependency 
of mxnet.
+# Script to build ccache for centos7 based images
+
 set -ex
-LZ4_VERSION=r130
-if [[ ! -f $DEPS_PATH/lib/liblz4.a ]]; then
-    # Download and build lz4
-    >&2 echo "Building lz4..."
-    download \
-        https://github.com/lz4/lz4/archive/${LZ4_VERSION}.zip \
-        ${DEPS_PATH}/lz4.zip
-    unzip -q $DEPS_PATH/lz4.zip -d $DEPS_PATH
-    pushd .
-    cd $DEPS_PATH/lz4-$LZ4_VERSION
-    $MAKE
-    $MAKE PREFIX=$DEPS_PATH install
-    popd
-fi
+
+pushd .
+
+apt update
+apt install -y wget
+
+mkdir -p /work/deps/cmake
+cd /work/deps/cmake
+
+CMAKE_VERSION=3.24.0
+CMAKE_MAJOR=$(echo $CMAKE_VERSION | cut -d. -f1,2)
+CMAKE_ARCH=$(uname -m)
+wget -q 
https://cmake.org/files/v$CMAKE_MAJOR/cmake-$CMAKE_VERSION-linux-$CMAKE_ARCH.sh
+sh cmake-$CMAKE_VERSION-linux-$CMAKE_ARCH.sh --prefix=/usr/local --skip-license
+
+cd /work/deps
+rm -rf /work/deps/cmake
+
+popd
+
diff --git a/ci/docker/install/ubuntu_r.sh b/ci/docker/install/ubuntu_r.sh
index 44c0357d1c..6d170ac26b 100755
--- a/ci/docker/install/ubuntu_r.sh
+++ b/ci/docker/install/ubuntu_r.sh
@@ -36,7 +36,9 @@ add-apt-repository ppa:cran/libgit2
 apt-get update || true
 apt-get install -y --allow-unauthenticated \
     libcairo2-dev \
+    libfribidi-dev \
     libgit2-dev \
+    libharfbuzz-dev \
     libssh2-1-dev \
     libssl-dev \
     libxml2-dev \
@@ -45,4 +47,4 @@ apt-get install -y --allow-unauthenticated \
     r-base-dev \
     texinfo \
     texlive \
-    texlive-fonts-extra 
+    texlive-fonts-extra
diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index 1bd28849e7..006c0a31a7 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -2093,10 +2093,10 @@ build_static_python_cpu() {
     popd
 }
 
-build_static_python_cu101() {
+build_static_python_gpu() {
     set -ex
     pushd .
-    export mxnet_variant=cu101
+    export mxnet_variant=cu112
     ./ci/publish/python/build.sh
     popd
 }
@@ -2110,10 +2110,10 @@ build_static_python_cpu_cmake() {
     popd
 }
 
-build_static_python_cu101_cmake() {
+build_static_python_gpu_cmake() {
     set -ex
     pushd .
-    export mxnet_variant=cu101
+    export mxnet_variant=cu112
     export CMAKE_STATICBUILD=1
     ./ci/publish/python/build.sh
     popd
diff --git a/ci/jenkins/Jenkins_steps.groovy b/ci/jenkins/Jenkins_steps.groovy
index b37520e509..42e52a3c17 100644
--- a/ci/jenkins/Jenkins_steps.groovy
+++ b/ci/jenkins/Jenkins_steps.groovy
@@ -637,7 +637,7 @@ def compile_windows_gpu_mkldnn() {
 }
 
 def test_static_scala_cpu() {
-  return ['Static build CPU 14.04 Scala' : {
+  return ['Static build CPU Scala' : {
     node(NODE_LINUX_CPU) {
         ws('workspace/ut-publish-scala-cpu') {
           timeout(time: max_time, unit: 'MINUTES') {
@@ -650,12 +650,12 @@ def test_static_scala_cpu() {
 }
 
 def test_static_python_cpu() {
-  return ['Static build CPU 14.04 Python' : {
+  return ['Static build CPU Python' : {
     node(NODE_LINUX_CPU) {
         ws('workspace/ut-publish-python-cpu') {
           timeout(time: max_time, unit: 'MINUTES') {
             utils.init_git()
-            utils.docker_run('publish.ubuntu1404_cpu', 
'build_static_python_cpu', false)
+            utils.docker_run('centos7_cd', 'build_static_python_cpu', false)
           }
         }
     }
@@ -663,12 +663,12 @@ def test_static_python_cpu() {
 }
 
 def test_static_python_cpu_cmake() {
-    return ['Static build CPU 14.04 Python with CMake' : {
+    return ['Static build CPU Python with CMake' : {
         node(NODE_LINUX_CPU) {
             ws('workspace/ut-publish-python-cpu') {
                 timeout(time: max_time, unit: 'MINUTES') {
                     utils.init_git()
-                    utils.docker_run('publish.ubuntu1404_cpu', 
'build_static_python_cpu_cmake', false)
+                    utils.docker_run('centos7_cd', 
'build_static_python_cpu_cmake', false)
                 }
             }
         }
@@ -676,12 +676,12 @@ def test_static_python_cpu_cmake() {
 }
 
 def test_static_python_gpu() {
-  return ['Static build GPU 14.04 Python' : {
+  return ['Static build GPU Python' : {
     node(NODE_LINUX_GPU) {
         ws('workspace/ut-publish-python-gpu') {
           timeout(time: max_time, unit: 'MINUTES') {
             utils.init_git()
-            utils.docker_run('publish.ubuntu1404_gpu', 
'build_static_python_cu101', true)
+            utils.docker_run('centos7_cd', 'build_static_python_gpu', true)
           }
         }
     }
@@ -689,12 +689,12 @@ def test_static_python_gpu() {
 }
 
 def test_static_python_gpu_cmake() {
-    return ['Static build GPU 14.04 Python' : {
+    return ['Static build GPU Python' : {
         node(NODE_LINUX_GPU) {
             ws('workspace/ut-publish-python-gpu') {
                 timeout(time: max_time, unit: 'MINUTES') {
                     utils.init_git()
-                    utils.docker_run('publish.ubuntu1404_gpu', 
'build_static_python_cu101_cmake', true)
+                    utils.docker_run('centos7_cd', 
'build_static_python_gpu_cmake', true)
                 }
             }
         }
diff --git a/config/distribution/linux_cu110.cmake 
b/config/distribution/linux_cu110.cmake
index c58ec9ddab..0fd9d92d3a 100644
--- a/config/distribution/linux_cu110.cmake
+++ b/config/distribution/linux_cu110.cmake
@@ -18,7 +18,6 @@
 set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type")
 set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS")
 set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS")
-
 set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
 set(USE_CUDNN ON CACHE BOOL "Build with CUDA support")
 set(USE_NCCL ON CACHE BOOL "Build with NCCL support")
@@ -32,5 +31,5 @@ set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction 
support")
 set(USE_F16C OFF CACHE BOOL "Build with x86 F16C instruction support")
 set(USE_LIBJPEG_TURBO ON CACHE BOOL "Build with libjpeg-turbo")
 set(USE_DIST_KVSTORE ON CACHE BOOL "Build with DIST_KVSTORE support")
-set(CUDACXX "/usr/local/cuda-11.0/bin/nvcc" CACHE STRING "Cuda compiler")
 set(MXNET_CUDA_ARCH "5.0;6.0;7.0;8.0" CACHE STRING "Cuda architectures")
+set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.0/bin/nvcc" CACHE STRING "Cuda 
compiler")
diff --git a/config/distribution/linux_cu112.cmake 
b/config/distribution/linux_cu111.cmake
similarity index 95%
copy from config/distribution/linux_cu112.cmake
copy to config/distribution/linux_cu111.cmake
index b0d3d86b67..2e6492a5bc 100644
--- a/config/distribution/linux_cu112.cmake
+++ b/config/distribution/linux_cu111.cmake
@@ -18,7 +18,6 @@
 set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type")
 set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS")
 set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS")
-
 set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
 set(USE_CUDNN ON CACHE BOOL "Build with CUDA support")
 set(USE_NCCL ON CACHE BOOL "Build with NCCL support")
@@ -32,5 +31,5 @@ set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction 
support")
 set(USE_F16C OFF CACHE BOOL "Build with x86 F16C instruction support")
 set(USE_LIBJPEG_TURBO ON CACHE BOOL "Build with libjpeg-turbo")
 set(USE_DIST_KVSTORE ON CACHE BOOL "Build with DIST_KVSTORE support")
-set(CUDACXX "/usr/local/cuda-11.2/bin/nvcc" CACHE STRING "Cuda compiler")
 set(MXNET_CUDA_ARCH "5.0;6.0;7.0;8.0;8.6" CACHE STRING "Cuda architectures")
+set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.1/bin/nvcc" CACHE STRING "Cuda 
compiler")
diff --git a/config/distribution/linux_cu112.cmake 
b/config/distribution/linux_cu112.cmake
index b0d3d86b67..a154a8384f 100644
--- a/config/distribution/linux_cu112.cmake
+++ b/config/distribution/linux_cu112.cmake
@@ -18,7 +18,6 @@
 set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type")
 set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS")
 set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS")
-
 set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
 set(USE_CUDNN ON CACHE BOOL "Build with CUDA support")
 set(USE_NCCL ON CACHE BOOL "Build with NCCL support")
@@ -32,5 +31,5 @@ set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction 
support")
 set(USE_F16C OFF CACHE BOOL "Build with x86 F16C instruction support")
 set(USE_LIBJPEG_TURBO ON CACHE BOOL "Build with libjpeg-turbo")
 set(USE_DIST_KVSTORE ON CACHE BOOL "Build with DIST_KVSTORE support")
-set(CUDACXX "/usr/local/cuda-11.2/bin/nvcc" CACHE STRING "Cuda compiler")
 set(MXNET_CUDA_ARCH "5.0;6.0;7.0;8.0;8.6" CACHE STRING "Cuda architectures")
+set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.2/bin/nvcc" CACHE STRING "Cuda 
compiler")
diff --git a/config/distribution/linux_cu112.cmake 
b/config/distribution/linux_cu113.cmake
similarity index 95%
copy from config/distribution/linux_cu112.cmake
copy to config/distribution/linux_cu113.cmake
index b0d3d86b67..8ef4f00aa0 100644
--- a/config/distribution/linux_cu112.cmake
+++ b/config/distribution/linux_cu113.cmake
@@ -18,7 +18,6 @@
 set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type")
 set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS")
 set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS")
-
 set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
 set(USE_CUDNN ON CACHE BOOL "Build with CUDA support")
 set(USE_NCCL ON CACHE BOOL "Build with NCCL support")
@@ -32,5 +31,5 @@ set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction 
support")
 set(USE_F16C OFF CACHE BOOL "Build with x86 F16C instruction support")
 set(USE_LIBJPEG_TURBO ON CACHE BOOL "Build with libjpeg-turbo")
 set(USE_DIST_KVSTORE ON CACHE BOOL "Build with DIST_KVSTORE support")
-set(CUDACXX "/usr/local/cuda-11.2/bin/nvcc" CACHE STRING "Cuda compiler")
 set(MXNET_CUDA_ARCH "5.0;6.0;7.0;8.0;8.6" CACHE STRING "Cuda architectures")
+set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.3/bin/nvcc" CACHE STRING "Cuda 
compiler")
diff --git a/config/distribution/linux_cu112.cmake 
b/config/distribution/linux_cu114.cmake
similarity index 95%
copy from config/distribution/linux_cu112.cmake
copy to config/distribution/linux_cu114.cmake
index b0d3d86b67..d81c55df92 100644
--- a/config/distribution/linux_cu112.cmake
+++ b/config/distribution/linux_cu114.cmake
@@ -18,7 +18,6 @@
 set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type")
 set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS")
 set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS")
-
 set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
 set(USE_CUDNN ON CACHE BOOL "Build with CUDA support")
 set(USE_NCCL ON CACHE BOOL "Build with NCCL support")
@@ -32,5 +31,5 @@ set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction 
support")
 set(USE_F16C OFF CACHE BOOL "Build with x86 F16C instruction support")
 set(USE_LIBJPEG_TURBO ON CACHE BOOL "Build with libjpeg-turbo")
 set(USE_DIST_KVSTORE ON CACHE BOOL "Build with DIST_KVSTORE support")
-set(CUDACXX "/usr/local/cuda-11.2/bin/nvcc" CACHE STRING "Cuda compiler")
 set(MXNET_CUDA_ARCH "5.0;6.0;7.0;8.0;8.6" CACHE STRING "Cuda architectures")
+set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.4/bin/nvcc" CACHE STRING "Cuda 
compiler")
diff --git a/config/distribution/linux_cu112.cmake 
b/config/distribution/linux_cu115.cmake
similarity index 95%
copy from config/distribution/linux_cu112.cmake
copy to config/distribution/linux_cu115.cmake
index b0d3d86b67..09533c45ea 100644
--- a/config/distribution/linux_cu112.cmake
+++ b/config/distribution/linux_cu115.cmake
@@ -18,7 +18,6 @@
 set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type")
 set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS")
 set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS")
-
 set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
 set(USE_CUDNN ON CACHE BOOL "Build with CUDA support")
 set(USE_NCCL ON CACHE BOOL "Build with NCCL support")
@@ -32,5 +31,5 @@ set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction 
support")
 set(USE_F16C OFF CACHE BOOL "Build with x86 F16C instruction support")
 set(USE_LIBJPEG_TURBO ON CACHE BOOL "Build with libjpeg-turbo")
 set(USE_DIST_KVSTORE ON CACHE BOOL "Build with DIST_KVSTORE support")
-set(CUDACXX "/usr/local/cuda-11.2/bin/nvcc" CACHE STRING "Cuda compiler")
 set(MXNET_CUDA_ARCH "5.0;6.0;7.0;8.0;8.6" CACHE STRING "Cuda architectures")
+set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.5/bin/nvcc" CACHE STRING "Cuda 
compiler")
diff --git a/config/distribution/linux_cu112.cmake 
b/config/distribution/linux_cu116.cmake
similarity index 95%
copy from config/distribution/linux_cu112.cmake
copy to config/distribution/linux_cu116.cmake
index b0d3d86b67..b49be40a02 100644
--- a/config/distribution/linux_cu112.cmake
+++ b/config/distribution/linux_cu116.cmake
@@ -18,7 +18,6 @@
 set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type")
 set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS")
 set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS")
-
 set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
 set(USE_CUDNN ON CACHE BOOL "Build with CUDA support")
 set(USE_NCCL ON CACHE BOOL "Build with NCCL support")
@@ -32,5 +31,5 @@ set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction 
support")
 set(USE_F16C OFF CACHE BOOL "Build with x86 F16C instruction support")
 set(USE_LIBJPEG_TURBO ON CACHE BOOL "Build with libjpeg-turbo")
 set(USE_DIST_KVSTORE ON CACHE BOOL "Build with DIST_KVSTORE support")
-set(CUDACXX "/usr/local/cuda-11.2/bin/nvcc" CACHE STRING "Cuda compiler")
 set(MXNET_CUDA_ARCH "5.0;6.0;7.0;8.0;8.6" CACHE STRING "Cuda architectures")
+set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.6/bin/nvcc" CACHE STRING "Cuda 
compiler")
diff --git a/config/distribution/linux_cu112.cmake 
b/config/distribution/linux_cu117.cmake
similarity index 95%
copy from config/distribution/linux_cu112.cmake
copy to config/distribution/linux_cu117.cmake
index b0d3d86b67..18201e6f7b 100644
--- a/config/distribution/linux_cu112.cmake
+++ b/config/distribution/linux_cu117.cmake
@@ -18,7 +18,6 @@
 set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type")
 set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS")
 set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS")
-
 set(USE_CUDA ON CACHE BOOL "Build with CUDA support")
 set(USE_CUDNN ON CACHE BOOL "Build with CUDA support")
 set(USE_NCCL ON CACHE BOOL "Build with NCCL support")
@@ -32,5 +31,5 @@ set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction 
support")
 set(USE_F16C OFF CACHE BOOL "Build with x86 F16C instruction support")
 set(USE_LIBJPEG_TURBO ON CACHE BOOL "Build with libjpeg-turbo")
 set(USE_DIST_KVSTORE ON CACHE BOOL "Build with DIST_KVSTORE support")
-set(CUDACXX "/usr/local/cuda-11.2/bin/nvcc" CACHE STRING "Cuda compiler")
 set(MXNET_CUDA_ARCH "5.0;6.0;7.0;8.0;8.6" CACHE STRING "Cuda architectures")
+set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.7/bin/nvcc" CACHE STRING "Cuda 
compiler")
diff --git a/make/staticbuild/linux_cpu.mk b/make/staticbuild/linux_cpu.mk
index 1cf389ae4a..6d923f7403 100644
--- a/make/staticbuild/linux_cpu.mk
+++ b/make/staticbuild/linux_cpu.mk
@@ -37,7 +37,7 @@ DEBUG = 0
 USE_SIGNAL_HANDLER = 1
 
 # the additional link flags you want to add
-ADD_LDFLAGS += -L$(DEPS_PATH)/lib -lpng -ltiff -ljpeg -lz -lgfortran -ldl  
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
+ADD_LDFLAGS += -L$(DEPS_PATH)/lib -L$(DEPS_PATH)/lib64 -lpng -ltiff -ljpeg -lz 
-lgfortran -ldl  
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
 
 # the additional compile flags you want to add
 ADD_CFLAGS += -I$(DEPS_PATH)/include -ffunction-sections -fdata-sections
diff --git a/make/staticbuild/linux_cu110.mk b/make/staticbuild/linux_cu110.mk
index fda9130a5f..8929be9bee 100644
--- a/make/staticbuild/linux_cu110.mk
+++ b/make/staticbuild/linux_cu110.mk
@@ -37,7 +37,7 @@ DEBUG = 0
 USE_SIGNAL_HANDLER = 1
 
 # the additional link flags you want to add
-ADD_LDFLAGS += -L$(DEPS_PATH)/lib $(DEPS_PATH)/lib/libculibos.a -lpng -ltiff 
-ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
+ADD_LDFLAGS += -L$(DEPS_PATH)/lib -L$(DEPS_PATH)/lib64 
$(DEPS_PATH)/lib/libculibos.a -lpng -ltiff -ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
 
 # the additional compile flags you want to add
 ADD_CFLAGS += -I$(DEPS_PATH)/include -ffunction-sections -fdata-sections
diff --git a/make/staticbuild/linux_cu112.mk b/make/staticbuild/linux_cu111.mk
similarity index 95%
copy from make/staticbuild/linux_cu112.mk
copy to make/staticbuild/linux_cu111.mk
index 874e1576d3..c7f81e1ef7 100644
--- a/make/staticbuild/linux_cu112.mk
+++ b/make/staticbuild/linux_cu111.mk
@@ -37,7 +37,7 @@ DEBUG = 0
 USE_SIGNAL_HANDLER = 1
 
 # the additional link flags you want to add
-ADD_LDFLAGS += -L$(DEPS_PATH)/lib $(DEPS_PATH)/lib/libculibos.a -lpng -ltiff 
-ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
+ADD_LDFLAGS += -L$(DEPS_PATH)/lib -L$(DEPS_PATH)/lib64 
$(DEPS_PATH)/lib/libculibos.a -lpng -ltiff -ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
 
 # the additional compile flags you want to add
 ADD_CFLAGS += -I$(DEPS_PATH)/include -ffunction-sections -fdata-sections
@@ -66,7 +66,7 @@ USE_CUDA = 1
 # add the path to CUDA library to link and compile flag
 # if you have already add them to environment variable, leave it as NONE
 # USE_CUDA_PATH = /usr/local/cuda
-USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.2
+USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.1
 
 # whether to use CuDNN library
 USE_CUDNN = 1
diff --git a/make/staticbuild/linux_cu112.mk b/make/staticbuild/linux_cu112.mk
index 874e1576d3..b568518f1f 100644
--- a/make/staticbuild/linux_cu112.mk
+++ b/make/staticbuild/linux_cu112.mk
@@ -37,7 +37,7 @@ DEBUG = 0
 USE_SIGNAL_HANDLER = 1
 
 # the additional link flags you want to add
-ADD_LDFLAGS += -L$(DEPS_PATH)/lib $(DEPS_PATH)/lib/libculibos.a -lpng -ltiff 
-ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
+ADD_LDFLAGS += -L$(DEPS_PATH)/lib -L$(DEPS_PATH)/lib64 
$(DEPS_PATH)/lib/libculibos.a -lpng -ltiff -ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
 
 # the additional compile flags you want to add
 ADD_CFLAGS += -I$(DEPS_PATH)/include -ffunction-sections -fdata-sections
diff --git a/make/staticbuild/linux_cu112.mk b/make/staticbuild/linux_cu113.mk
similarity index 95%
copy from make/staticbuild/linux_cu112.mk
copy to make/staticbuild/linux_cu113.mk
index 874e1576d3..1142483349 100644
--- a/make/staticbuild/linux_cu112.mk
+++ b/make/staticbuild/linux_cu113.mk
@@ -37,7 +37,7 @@ DEBUG = 0
 USE_SIGNAL_HANDLER = 1
 
 # the additional link flags you want to add
-ADD_LDFLAGS += -L$(DEPS_PATH)/lib $(DEPS_PATH)/lib/libculibos.a -lpng -ltiff 
-ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
+ADD_LDFLAGS += -L$(DEPS_PATH)/lib -L$(DEPS_PATH)/lib64 
$(DEPS_PATH)/lib/libculibos.a -lpng -ltiff -ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
 
 # the additional compile flags you want to add
 ADD_CFLAGS += -I$(DEPS_PATH)/include -ffunction-sections -fdata-sections
@@ -66,7 +66,7 @@ USE_CUDA = 1
 # add the path to CUDA library to link and compile flag
 # if you have already add them to environment variable, leave it as NONE
 # USE_CUDA_PATH = /usr/local/cuda
-USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.2
+USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.3
 
 # whether to use CuDNN library
 USE_CUDNN = 1
diff --git a/make/staticbuild/linux_cu112.mk b/make/staticbuild/linux_cu114.mk
similarity index 95%
copy from make/staticbuild/linux_cu112.mk
copy to make/staticbuild/linux_cu114.mk
index 874e1576d3..04cebeb65a 100644
--- a/make/staticbuild/linux_cu112.mk
+++ b/make/staticbuild/linux_cu114.mk
@@ -37,7 +37,7 @@ DEBUG = 0
 USE_SIGNAL_HANDLER = 1
 
 # the additional link flags you want to add
-ADD_LDFLAGS += -L$(DEPS_PATH)/lib $(DEPS_PATH)/lib/libculibos.a -lpng -ltiff 
-ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
+ADD_LDFLAGS += -L$(DEPS_PATH)/lib -L$(DEPS_PATH)/lib64 
$(DEPS_PATH)/lib/libculibos.a -lpng -ltiff -ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
 
 # the additional compile flags you want to add
 ADD_CFLAGS += -I$(DEPS_PATH)/include -ffunction-sections -fdata-sections
@@ -66,7 +66,7 @@ USE_CUDA = 1
 # add the path to CUDA library to link and compile flag
 # if you have already add them to environment variable, leave it as NONE
 # USE_CUDA_PATH = /usr/local/cuda
-USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.2
+USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.4
 
 # whether to use CuDNN library
 USE_CUDNN = 1
diff --git a/make/staticbuild/linux_cu112.mk b/make/staticbuild/linux_cu115.mk
similarity index 95%
copy from make/staticbuild/linux_cu112.mk
copy to make/staticbuild/linux_cu115.mk
index 874e1576d3..c04549e4f0 100644
--- a/make/staticbuild/linux_cu112.mk
+++ b/make/staticbuild/linux_cu115.mk
@@ -37,7 +37,7 @@ DEBUG = 0
 USE_SIGNAL_HANDLER = 1
 
 # the additional link flags you want to add
-ADD_LDFLAGS += -L$(DEPS_PATH)/lib $(DEPS_PATH)/lib/libculibos.a -lpng -ltiff 
-ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
+ADD_LDFLAGS += -L$(DEPS_PATH)/lib -L$(DEPS_PATH)/lib64 
$(DEPS_PATH)/lib/libculibos.a -lpng -ltiff -ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
 
 # the additional compile flags you want to add
 ADD_CFLAGS += -I$(DEPS_PATH)/include -ffunction-sections -fdata-sections
@@ -66,7 +66,7 @@ USE_CUDA = 1
 # add the path to CUDA library to link and compile flag
 # if you have already add them to environment variable, leave it as NONE
 # USE_CUDA_PATH = /usr/local/cuda
-USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.2
+USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.5
 
 # whether to use CuDNN library
 USE_CUDNN = 1
diff --git a/make/staticbuild/linux_cu112.mk b/make/staticbuild/linux_cu116.mk
similarity index 95%
copy from make/staticbuild/linux_cu112.mk
copy to make/staticbuild/linux_cu116.mk
index 874e1576d3..a11cc5677f 100644
--- a/make/staticbuild/linux_cu112.mk
+++ b/make/staticbuild/linux_cu116.mk
@@ -37,7 +37,7 @@ DEBUG = 0
 USE_SIGNAL_HANDLER = 1
 
 # the additional link flags you want to add
-ADD_LDFLAGS += -L$(DEPS_PATH)/lib $(DEPS_PATH)/lib/libculibos.a -lpng -ltiff 
-ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
+ADD_LDFLAGS += -L$(DEPS_PATH)/lib -L$(DEPS_PATH)/lib64 
$(DEPS_PATH)/lib/libculibos.a -lpng -ltiff -ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
 
 # the additional compile flags you want to add
 ADD_CFLAGS += -I$(DEPS_PATH)/include -ffunction-sections -fdata-sections
@@ -66,7 +66,7 @@ USE_CUDA = 1
 # add the path to CUDA library to link and compile flag
 # if you have already add them to environment variable, leave it as NONE
 # USE_CUDA_PATH = /usr/local/cuda
-USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.2
+USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.6
 
 # whether to use CuDNN library
 USE_CUDNN = 1
diff --git a/make/staticbuild/linux_cu112.mk b/make/staticbuild/linux_cu117.mk
similarity index 95%
copy from make/staticbuild/linux_cu112.mk
copy to make/staticbuild/linux_cu117.mk
index 874e1576d3..84f267bd76 100644
--- a/make/staticbuild/linux_cu112.mk
+++ b/make/staticbuild/linux_cu117.mk
@@ -37,7 +37,7 @@ DEBUG = 0
 USE_SIGNAL_HANDLER = 1
 
 # the additional link flags you want to add
-ADD_LDFLAGS += -L$(DEPS_PATH)/lib $(DEPS_PATH)/lib/libculibos.a -lpng -ltiff 
-ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
+ADD_LDFLAGS += -L$(DEPS_PATH)/lib -L$(DEPS_PATH)/lib64 
$(DEPS_PATH)/lib/libculibos.a -lpng -ltiff -ljpeg -lz -ldl -lgfortran 
-Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections
 
 # the additional compile flags you want to add
 ADD_CFLAGS += -I$(DEPS_PATH)/include -ffunction-sections -fdata-sections
@@ -66,7 +66,7 @@ USE_CUDA = 1
 # add the path to CUDA library to link and compile flag
 # if you have already add them to environment variable, leave it as NONE
 # USE_CUDA_PATH = /usr/local/cuda
-USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.2
+USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-11.7
 
 # whether to use CuDNN library
 USE_CUDNN = 1
diff --git a/tools/dependencies/cityhash.sh b/tools/dependencies/cityhash.sh
index 6bc663e906..23b0d0a769 100755
--- a/tools/dependencies/cityhash.sh
+++ b/tools/dependencies/cityhash.sh
@@ -31,4 +31,5 @@ if [[ ! -f $DEPS_PATH/lib/libcityhash.a ]]; then
     $MAKE CXXFLAGS="-g -O3 -msse4.2"
     $MAKE install
     popd
+    rm -rf $DEPS_PATH/cityhash-$CITYHASH_VERSION
 fi
diff --git a/tools/dependencies/curl.sh b/tools/dependencies/curl.sh
index 948d4a2ae0..4d25084a51 100755
--- a/tools/dependencies/curl.sh
+++ b/tools/dependencies/curl.sh
@@ -65,4 +65,5 @@ if [[ ! -f $DEPS_PATH/lib/libcurl.a ]]; then
     $MAKE
     $MAKE install
     popd
+    rm -rf $DEPS_PATH/libcurl.zip $DEPS_PATH/curl-$LIBCURL_VERSION
 fi
diff --git a/tools/dependencies/eigen.sh b/tools/dependencies/eigen.sh
index 0dde3023d3..2187c91bb2 100755
--- a/tools/dependencies/eigen.sh
+++ b/tools/dependencies/eigen.sh
@@ -36,4 +36,5 @@ if [[ ! -d $DEPS_PATH/include/eigen3 ]]; then
           -D CMAKE_INSTALL_PREFIX=$DEPS_PATH ..
     $MAKE install
     popd
+    rm -rf $DEPS_PATH/eigen.zip $DEPS_PATH/eigen-git-mirror-$EIGEN_VERSION
 fi
diff --git a/tools/dependencies/libpng.sh b/tools/dependencies/libpng.sh
index 39fa24c87e..4a43626b70 100755
--- a/tools/dependencies/libpng.sh
+++ b/tools/dependencies/libpng.sh
@@ -20,7 +20,7 @@
 # This script builds the static library of libpng that can be used as 
dependency of mxnet/opencv.
 set -ex
 PNG_VERSION=1.6.35
-if [[ ! -f $DEPS_PATH/lib/libpng.a ]]; then
+if [[ ! -e $DEPS_PATH/lib/libpng.a ]] && [[ ! -e $DEPS_PATH/lib64/libpng.a ]]; 
then
     # download and build libpng
     >&2 echo "Building libpng..."
     download \
@@ -39,6 +39,7 @@ if [[ ! -f $DEPS_PATH/lib/libpng.a ]]; then
     $MAKE
     $MAKE install
     mkdir -p $DEPS_PATH/include/libpng
-    ln -s $DEPS_PATH/include/png.h $DEPS_PATH/include/libpng/png.h
+    ln -sf $DEPS_PATH/include/png.h $DEPS_PATH/include/libpng/png.h
     popd
+    rm -rf $DEPS_PATH/libpng.zip $DEPS_PATH/libpng-$PNG_VERSION
 fi
diff --git a/tools/dependencies/libtiff.sh b/tools/dependencies/libtiff.sh
index 968ffe4b86..8c687c67da 100755
--- a/tools/dependencies/libtiff.sh
+++ b/tools/dependencies/libtiff.sh
@@ -19,7 +19,7 @@
 
 # This script builds the static library of libtiff that can be used as 
dependency of mxnet/opencv.
 set -ex
-TIFF_VERSION="4.0.9"
+TIFF_VERSION="4.4.0"
 if [[ ! -f $DEPS_PATH/lib/libtiff.a ]]; then
     # download and build libtiff
     >&2 echo "Building libtiff..."
@@ -29,8 +29,9 @@ if [[ ! -f $DEPS_PATH/lib/libtiff.a ]]; then
     unzip -q $DEPS_PATH/libtiff.zip -d $DEPS_PATH
     pushd .
     cd $DEPS_PATH/tiff-$TIFF_VERSION
-    ./configure --quiet --disable-shared --disable-jpeg --disable-zlib 
--disable-jbig --disable-lzma --prefix=$DEPS_PATH
+    ./configure --quiet --disable-shared --disable-jpeg --disable-zstd 
--disable-zlib --disable-jbig --disable-lzma --disable-webp --prefix=$DEPS_PATH
     $MAKE
     $MAKE install
     popd
+    rm -rf $DEPS_PATH/libtiff.zip $DEPS_PATH/tiff-$TIFF_VERSION
 fi
diff --git a/tools/dependencies/libturbojpeg.sh 
b/tools/dependencies/libturbojpeg.sh
index 0c9eb97ba5..0a6b2a737e 100755
--- a/tools/dependencies/libturbojpeg.sh
+++ b/tools/dependencies/libturbojpeg.sh
@@ -25,7 +25,7 @@ if [[ $PLATFORM == 'darwin' ]]; then
     JPEG_NASM_OPTION="-D CMAKE_ASM_NASM_COMPILER=/usr/local/bin/nasm"
 fi
 
-if [[ ! -f $DEPS_PATH/lib/libjpeg.a ]] || [[ ! -f 
$DEPS_PATH/lib/libturbojpeg.a ]]; then
+if [[ ! -e $DEPS_PATH/lib/libjpeg.a ]] && [[ ! -e $DEPS_PATH/lib64/libjpeg.a 
]]; then
     # download and build libjpeg
     >&2 echo "Building libjpeg-turbo..."
     download \
@@ -48,4 +48,5 @@ if [[ ! -f $DEPS_PATH/lib/libjpeg.a ]] || [[ ! -f 
$DEPS_PATH/lib/libturbojpeg.a
     $MAKE
     $MAKE install
     popd
+    rm -rf $DEPS_PATH/libjpeg.zip $DEPS_PATH/libjpeg-turbo-$TURBO_JPEG_VERSION
 fi
diff --git a/tools/dependencies/libz.sh b/tools/dependencies/libz.sh
index 6fdf59fd2c..e2eb09dcc8 100755
--- a/tools/dependencies/libz.sh
+++ b/tools/dependencies/libz.sh
@@ -37,4 +37,5 @@ if [[ ! -f $DEPS_PATH/lib/libz.a ]]; then
     $MAKE
     $MAKE install
     popd
+    rm -rf $DEPS_PATH/zlib.zip $DEPS_PATH/zlib-$ZLIB_VERSION
 fi
diff --git a/tools/dependencies/lz4.sh b/tools/dependencies/lz4.sh
index ce72908fdc..65107dcc2f 100755
--- a/tools/dependencies/lz4.sh
+++ b/tools/dependencies/lz4.sh
@@ -32,4 +32,5 @@ if [[ ! -f $DEPS_PATH/lib/liblz4.a ]]; then
     $MAKE
     $MAKE PREFIX=$DEPS_PATH install
     popd
+    rm -rf $DEPS_PATH/lz4.zip $DEPS_PATH/lz4-$LZ4_VERSION
 fi
diff --git a/tools/dependencies/make_shared_dependencies.sh 
b/tools/dependencies/make_shared_dependencies.sh
index 6dfa4bf010..a4636a0588 100755
--- a/tools/dependencies/make_shared_dependencies.sh
+++ b/tools/dependencies/make_shared_dependencies.sh
@@ -55,18 +55,16 @@ fi
 source $DIR/libz.sh
 source $DIR/libturbojpeg.sh
 source $DIR/libpng.sh
-if [[ ! $ARCH == 'aarch64' ]]; then
-    source $DIR/libtiff.sh
-fi
+source $DIR/libtiff.sh
 source $DIR/openssl.sh
 source $DIR/curl.sh
 source $DIR/eigen.sh
 source $DIR/opencv.sh
+source $DIR/protobuf.sh
 if [[ ! $ARCH == 'aarch64' ]]; then
-    source $DIR/protobuf.sh
     source $DIR/cityhash.sh
 fi
 source $DIR/zmq.sh
 source $DIR/lz4.sh
 
-export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(dirname $(find $DEPS_PATH -type f 
-name 'libprotoc*' | grep protobuf | head -n 1)):$DEPS_PATH/lib
+export 
LD_LIBRARY_PATH=$DEPS_PATH/lib:$DEPS_PATH/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
diff --git a/tools/dependencies/openblas.sh b/tools/dependencies/openblas.sh
index 17714cebfb..62c326dc3f 100755
--- a/tools/dependencies/openblas.sh
+++ b/tools/dependencies/openblas.sh
@@ -56,4 +56,6 @@ if [[ ((! -e $DEPS_PATH/lib/libopenblas.a) && -z 
"$CMAKE_STATICBUILD") ||
         ln -s libopenblas.a $DEPS_PATH/lib/libcblas.a
         ln -s libopenblas.a $DEPS_PATH/lib/liblapack.a
     fi
+    rm -rf ${DEPS_PATH}/openblas.zip $DEPS_PATH/OpenBLAS-$OPENBLAS_VERSION
 fi
+export OpenBLAS_HOME=$DEPS_PATH
diff --git a/tools/dependencies/opencv.sh b/tools/dependencies/opencv.sh
index 139b68c5be..00638d695b 100755
--- a/tools/dependencies/opencv.sh
+++ b/tools/dependencies/opencv.sh
@@ -193,4 +193,6 @@ if [[ ! -f $DEPS_PATH/lib/libopencv_core.a ]] || [[ ! -f 
$DEPS_PATH/lib/libopenc
     popd
     # @szha: compatibility header
     cat $DEPS_PATH/include/opencv2/imgcodecs/imgcodecs_c.h >> 
$DEPS_PATH/include/opencv2/imgcodecs.hpp
+    rm -rf $DEPS_PATH/opencv.zip $DEPS_PATH/opencv-$OPENCV_VERSION
 fi
+export OpenCV_DIR=$DEPS_PATH/share/OpenCV
diff --git a/tools/dependencies/openssl.sh b/tools/dependencies/openssl.sh
index 697c735183..5c17aa5dde 100755
--- a/tools/dependencies/openssl.sh
+++ b/tools/dependencies/openssl.sh
@@ -20,7 +20,8 @@
 # This script builds the static library of openssl that can be used as 
dependency of mxnet.
 set -ex
 OPENSSL_VERSION=1.1.1k
-if [[ ! -f $DEPS_PATH/lib/libssl.a ]] || [[ ! -f $DEPS_PATH/lib/libcrypto.a 
]]; then
+if [[ ! -f $DEPS_PATH/lib/libssl.a ]] && [[ ! -f $DEPS_PATH/lib64/libssl.a ]] 
|| 
+      [[ ! -f $DEPS_PATH/lib/libcrypto.a ]] && [[ ! -f 
$DEPS_PATH/lib64/libcrypto.a ]]; then
     # download and build openssl
     >&2 echo "Building openssl..."
     OPENSSL_VERSION=$(echo $OPENSSL_VERSION | sed 's/\./_/g')
@@ -39,4 +40,5 @@ if [[ ! -f $DEPS_PATH/lib/libssl.a ]] || [[ ! -f 
$DEPS_PATH/lib/libcrypto.a ]];
     $MAKE
     $MAKE install
     popd
+    rm -rf $DEPS_PATH/openssl.zip $DEPS_PATH/openssl-OpenSSL_$OPENSSL_VERSION
 fi
diff --git a/tools/dependencies/protobuf.sh b/tools/dependencies/protobuf.sh
index 7da4c2537b..2ab378b970 100755
--- a/tools/dependencies/protobuf.sh
+++ b/tools/dependencies/protobuf.sh
@@ -42,5 +42,6 @@ if [[ ! -e $LIBPROTOBUF ]] || [[ ! -e $LIBPROTOC ]]; then
     $MAKE
     $MAKE install
     popd
+    rm -rf $DEPS_PATH/protobuf.zip $DEPS_PATH/protobuf-$PROTOBUF_VERSION
 fi
 
diff --git a/tools/dependencies/zmq.sh b/tools/dependencies/zmq.sh
index a0cba2e1d0..dfed096340 100755
--- a/tools/dependencies/zmq.sh
+++ b/tools/dependencies/zmq.sh
@@ -53,4 +53,5 @@ if [[ ! -f $DEPS_PATH/lib/libzmq.a ]]; then
     fi
 
     popd
-fi
\ No newline at end of file
+    rm -rf ${DEPS_PATH}/zeromq.zip $DEPS_PATH/libzmq-$ZEROMQ_VERSION
+fi
diff --git a/tools/pip/doc/CU112_ADDITIONAL.md 
b/tools/pip/doc/CU111_ADDITIONAL.md
similarity index 88%
copy from tools/pip/doc/CU112_ADDITIONAL.md
copy to tools/pip/doc/CU111_ADDITIONAL.md
index 6f859fccfe..1cf9eef4cb 100644
--- a/tools/pip/doc/CU112_ADDITIONAL.md
+++ b/tools/pip/doc/CU111_ADDITIONAL.md
@@ -20,9 +20,6 @@ Prerequisites
 This package supports Linux and Windows platforms. You may also want to check:
 
 - [mxnet-cu110](https://pypi.python.org/pypi/mxnet-cu110/) with CUDA-11.0 
support.
-- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 
support.
-- [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101/) with CUDA-10.1 
support.
-- [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100/) with CUDA-10.0 
support.
 - [mxnet](https://pypi.python.org/pypi/mxnet/).
 - [mxnet-native](https://pypi.python.org/pypi/mxnet-native/) CPU variant 
without MKLDNN.
 
@@ -42,5 +39,5 @@ Installation
 ------------
 To install:
 ```bash
-pip install mxnet-cu112
+pip install mxnet-cu111
 ```
diff --git a/tools/pip/doc/CU112_ADDITIONAL.md 
b/tools/pip/doc/CU112_ADDITIONAL.md
index 6f859fccfe..6166ecbe4d 100644
--- a/tools/pip/doc/CU112_ADDITIONAL.md
+++ b/tools/pip/doc/CU112_ADDITIONAL.md
@@ -19,6 +19,7 @@ Prerequisites
 -------------
 This package supports Linux and Windows platforms. You may also want to check:
 
+- [mxnet-cu111](https://pypi.python.org/pypi/mxnet-cu111/) with CUDA-11.1 
support.
 - [mxnet-cu110](https://pypi.python.org/pypi/mxnet-cu110/) with CUDA-11.0 
support.
 - [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 
support.
 - [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101/) with CUDA-10.1 
support.
diff --git a/tools/pip/doc/CU112_ADDITIONAL.md 
b/tools/pip/doc/CU113_ADDITIONAL.md
similarity index 88%
copy from tools/pip/doc/CU112_ADDITIONAL.md
copy to tools/pip/doc/CU113_ADDITIONAL.md
index 6f859fccfe..9174a03161 100644
--- a/tools/pip/doc/CU112_ADDITIONAL.md
+++ b/tools/pip/doc/CU113_ADDITIONAL.md
@@ -19,10 +19,9 @@ Prerequisites
 -------------
 This package supports Linux and Windows platforms. You may also want to check:
 
+- [mxnet-cu112](https://pypi.python.org/pypi/mxnet-cu112/) with CUDA-11.2 
support.
+- [mxnet-cu111](https://pypi.python.org/pypi/mxnet-cu111/) with CUDA-11.1 
support.
 - [mxnet-cu110](https://pypi.python.org/pypi/mxnet-cu110/) with CUDA-11.0 
support.
-- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 
support.
-- [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101/) with CUDA-10.1 
support.
-- [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100/) with CUDA-10.0 
support.
 - [mxnet](https://pypi.python.org/pypi/mxnet/).
 - [mxnet-native](https://pypi.python.org/pypi/mxnet-native/) CPU variant 
without MKLDNN.
 
@@ -42,5 +41,5 @@ Installation
 ------------
 To install:
 ```bash
-pip install mxnet-cu112
+pip install mxnet-cu113
 ```
diff --git a/tools/pip/doc/CU112_ADDITIONAL.md 
b/tools/pip/doc/CU114_ADDITIONAL.md
similarity index 88%
copy from tools/pip/doc/CU112_ADDITIONAL.md
copy to tools/pip/doc/CU114_ADDITIONAL.md
index 6f859fccfe..68b72bc7f0 100644
--- a/tools/pip/doc/CU112_ADDITIONAL.md
+++ b/tools/pip/doc/CU114_ADDITIONAL.md
@@ -19,10 +19,10 @@ Prerequisites
 -------------
 This package supports Linux and Windows platforms. You may also want to check:
 
+- [mxnet-cu113](https://pypi.python.org/pypi/mxnet-cu113/) with CUDA-11.3 
support.
+- [mxnet-cu112](https://pypi.python.org/pypi/mxnet-cu112/) with CUDA-11.2 
support.
+- [mxnet-cu111](https://pypi.python.org/pypi/mxnet-cu111/) with CUDA-11.1 
support.
 - [mxnet-cu110](https://pypi.python.org/pypi/mxnet-cu110/) with CUDA-11.0 
support.
-- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 
support.
-- [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101/) with CUDA-10.1 
support.
-- [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100/) with CUDA-10.0 
support.
 - [mxnet](https://pypi.python.org/pypi/mxnet/).
 - [mxnet-native](https://pypi.python.org/pypi/mxnet-native/) CPU variant 
without MKLDNN.
 
@@ -42,5 +42,5 @@ Installation
 ------------
 To install:
 ```bash
-pip install mxnet-cu112
+pip install mxnet-cu114
 ```
diff --git a/tools/pip/doc/CU112_ADDITIONAL.md 
b/tools/pip/doc/CU115_ADDITIONAL.md
similarity index 85%
copy from tools/pip/doc/CU112_ADDITIONAL.md
copy to tools/pip/doc/CU115_ADDITIONAL.md
index 6f859fccfe..87999658bc 100644
--- a/tools/pip/doc/CU112_ADDITIONAL.md
+++ b/tools/pip/doc/CU115_ADDITIONAL.md
@@ -19,10 +19,11 @@ Prerequisites
 -------------
 This package supports Linux and Windows platforms. You may also want to check:
 
+- [mxnet-cu114](https://pypi.python.org/pypi/mxnet-cu114/) with CUDA-11.4 
support.
+- [mxnet-cu113](https://pypi.python.org/pypi/mxnet-cu113/) with CUDA-11.3 
support.
+- [mxnet-cu112](https://pypi.python.org/pypi/mxnet-cu112/) with CUDA-11.2 
support.
+- [mxnet-cu111](https://pypi.python.org/pypi/mxnet-cu111/) with CUDA-11.1 
support.
 - [mxnet-cu110](https://pypi.python.org/pypi/mxnet-cu110/) with CUDA-11.0 
support.
-- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 
support.
-- [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101/) with CUDA-10.1 
support.
-- [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100/) with CUDA-10.0 
support.
 - [mxnet](https://pypi.python.org/pypi/mxnet/).
 - [mxnet-native](https://pypi.python.org/pypi/mxnet-native/) CPU variant 
without MKLDNN.
 
@@ -42,5 +43,5 @@ Installation
 ------------
 To install:
 ```bash
-pip install mxnet-cu112
+pip install mxnet-cu115
 ```
diff --git a/tools/pip/doc/CU112_ADDITIONAL.md 
b/tools/pip/doc/CU116_ADDITIONAL.md
similarity index 83%
copy from tools/pip/doc/CU112_ADDITIONAL.md
copy to tools/pip/doc/CU116_ADDITIONAL.md
index 6f859fccfe..c97c03aa02 100644
--- a/tools/pip/doc/CU112_ADDITIONAL.md
+++ b/tools/pip/doc/CU116_ADDITIONAL.md
@@ -19,10 +19,12 @@ Prerequisites
 -------------
 This package supports Linux and Windows platforms. You may also want to check:
 
+- [mxnet-cu115](https://pypi.python.org/pypi/mxnet-cu115/) with CUDA-11.5 
support.
+- [mxnet-cu114](https://pypi.python.org/pypi/mxnet-cu114/) with CUDA-11.4 
support.
+- [mxnet-cu113](https://pypi.python.org/pypi/mxnet-cu113/) with CUDA-11.3 
support.
+- [mxnet-cu112](https://pypi.python.org/pypi/mxnet-cu112/) with CUDA-11.2 
support.
+- [mxnet-cu111](https://pypi.python.org/pypi/mxnet-cu111/) with CUDA-11.1 
support.
 - [mxnet-cu110](https://pypi.python.org/pypi/mxnet-cu110/) with CUDA-11.0 
support.
-- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 
support.
-- [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101/) with CUDA-10.1 
support.
-- [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100/) with CUDA-10.0 
support.
 - [mxnet](https://pypi.python.org/pypi/mxnet/).
 - [mxnet-native](https://pypi.python.org/pypi/mxnet-native/) CPU variant 
without MKLDNN.
 
@@ -42,5 +44,5 @@ Installation
 ------------
 To install:
 ```bash
-pip install mxnet-cu112
+pip install mxnet-cu116
 ```
diff --git a/tools/pip/doc/CU112_ADDITIONAL.md 
b/tools/pip/doc/CU117_ADDITIONAL.md
similarity index 80%
copy from tools/pip/doc/CU112_ADDITIONAL.md
copy to tools/pip/doc/CU117_ADDITIONAL.md
index 6f859fccfe..051b27da32 100644
--- a/tools/pip/doc/CU112_ADDITIONAL.md
+++ b/tools/pip/doc/CU117_ADDITIONAL.md
@@ -19,10 +19,13 @@ Prerequisites
 -------------
 This package supports Linux and Windows platforms. You may also want to check:
 
+- [mxnet-cu116](https://pypi.python.org/pypi/mxnet-cu116/) with CUDA-11.6 
support.
+- [mxnet-cu115](https://pypi.python.org/pypi/mxnet-cu115/) with CUDA-11.5 
support.
+- [mxnet-cu114](https://pypi.python.org/pypi/mxnet-cu114/) with CUDA-11.4 
support.
+- [mxnet-cu113](https://pypi.python.org/pypi/mxnet-cu113/) with CUDA-11.3 
support.
+- [mxnet-cu112](https://pypi.python.org/pypi/mxnet-cu112/) with CUDA-11.2 
support.
+- [mxnet-cu111](https://pypi.python.org/pypi/mxnet-cu111/) with CUDA-11.1 
support.
 - [mxnet-cu110](https://pypi.python.org/pypi/mxnet-cu110/) with CUDA-11.0 
support.
-- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 
support.
-- [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101/) with CUDA-10.1 
support.
-- [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100/) with CUDA-10.0 
support.
 - [mxnet](https://pypi.python.org/pypi/mxnet/).
 - [mxnet-native](https://pypi.python.org/pypi/mxnet-native/) CPU variant 
without MKLDNN.
 
@@ -42,5 +45,5 @@ Installation
 ------------
 To install:
 ```bash
-pip install mxnet-cu112
+pip install mxnet-cu117
 ```
diff --git a/tools/setup_gpu_build_tools.sh b/tools/setup_gpu_build_tools.sh
index 297fefded6..9d717936af 100755
--- a/tools/setup_gpu_build_tools.sh
+++ b/tools/setup_gpu_build_tools.sh
@@ -17,242 +17,98 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# This script installs the tools and libraries for CUDA GPU on Ubuntu.
-# Usage: VARIANT=cu92mkl; DEPS_PATH=$HOME; setup_gpu_build_tools.sh $VARIANT 
$DEPS_PATH;
-# It installs the tools into DEPS_PATH as specified by the second argument, 
and will set
-# the following environment variables:
-# PATH, CPLUS_INCLUDE_PATH, C_INCLUDE_PATH, LIBRARY_PATH, LD_LIBRARY_PATH, NVCC
+# This script installs the Cuda build tools and libraries into
+# the standard system paths.
+# Usage: VARIANT=cu112; setup_gpu_build_tools.sh $VARIANT
 
 set -e
 
 VARIANT=$1
 DEPS_PATH=$2
 
+source /etc/os-release
+
 >&2 echo "Setting CUDA versions for $VARIANT"
-if [[ $VARIANT == cu112* ]]; then
-    CUDA_VERSION='11.2.67-1'
-    CUDA_PATCH_VERSION='11.4.1.1026-1'
-    CUDA_LIBS_VERSION='10.2.3.135-1'
-    CUDA_SOLVER_VERSION='11.1.0.135-1'
-    LIBCUDA_VERSION='460.32.03-0ubuntu1'
-    LIBCUDNN_VERSION='8.1.1.33-1+cuda11.2'
-    LIBNCCL_VERSION='2.8.3-1+cuda11.2'
-    LIBCUDART_VERSION='11.2.72-1'
-    LIBCUFFT_VERSION='10.4.0.135-1'
+if [[ $VARIANT == cu117* ]]; then
+    CUDA_VERSION='11.7'
+    LIBCUDNN_VERSION='8.5.0.96'
+elif [[ $VARIANT == cu116* ]]; then
+    CUDA_VERSION='11.6'
+    LIBCUDNN_VERSION='8.4.1.50'
+elif [[ $VARIANT == cu115* ]]; then
+    CUDA_VERSION='11.5'
+    LIBCUDNN_VERSION='8.3.3.40'
+elif [[ $VARIANT == cu114* ]]; then
+    CUDA_VERSION='11.4'
+    LIBCUDNN_VERSION='8.2.4.15'
+elif [[ $VARIANT == cu113* ]]; then
+    CUDA_VERSION='11.3'
+    LIBCUDNN_VERSION='8.2.1.32'
+elif [[ $VARIANT == cu112* ]]; then
+    CUDA_VERSION='11.2'
+    LIBCUDNN_VERSION='8.1.1.33'
+elif [[ $VARIANT == cu111* ]]; then
+    CUDA_VERSION='11.1'
+    LIBCUDNN_VERSION='8.0.5.39'
 elif [[ $VARIANT == cu110* ]]; then
-    CUDA_VERSION='11.0.221-1'
-    CUDA_PATCH_VERSION='11.2.0.252-1'
-    CUDA_LIBS_VERSION='10.2.1.245-1'
-    CUDA_SOLVER_VERSION='10.6.0.245-1'
-    CUDA_NVTX_VERSION='11.0.167-1'
-    LIBCUDA_VERSION='450.36.06-0ubuntu1'
-    LIBCUDNN_VERSION='8.0.4.30-1+cuda11.0'
-    LIBNCCL_VERSION='2.7.8-1+cuda11.0'
-elif [[ $VARIANT == cu102* ]]; then
-    CUDA_VERSION='10.2.89-1'
-    CUDA_PATCH_VERSION='10.2.2.89-1'
-    LIBCUDA_VERSION='440.33.01-0ubuntu1'
-    LIBCUDNN_VERSION='8.2.4.15-1+cuda10.2'
-    LIBNCCL_VERSION='2.11.4-1+cuda10.2'
-elif [[ $VARIANT == cu101* ]]; then
-    CUDA_VERSION='10.1.105-1'
-    CUDA_PATCH_VERSION='10.1.0.105-1'
-    LIBCUDA_VERSION='418.39-0ubuntu1'
-    LIBCUDNN_VERSION='7.6.5.32-1+cuda10.1'
-    LIBNCCL_VERSION='2.5.6-1+cuda10.1'
-elif [[ $VARIANT == cu100* ]]; then
-    CUDA_VERSION='10.0.130-1'
-    CUDA_PATCH_VERSION='10.0.130-1'
-    LIBCUDA_VERSION='410.48-0ubuntu1'
-    LIBCUDNN_VERSION='7.6.5.32-1+cuda10.0'
-    LIBNCCL_VERSION='2.5.6-1+cuda10.0'
+    CUDA_VERSION='11.0'
+    LIBCUDNN_VERSION='8.0.5.39'
+else
+    echo "Unsupported CUDA variant '$VARIANT'"
+    exit -1
 fi
-if [[ $VARIANT == cu* ]]; then
-    CUDA_MAJOR_VERSION=$(echo $CUDA_VERSION | tr '-' '.' | cut -d. -f1,2)
-    CUDA_MAJOR_DASH=$(echo $CUDA_VERSION | tr '-' '.' | cut -d. -f1,2 | tr '.' 
'-')
-    CUDA_PATCH_MAJOR_DASH=$(echo $CUDA_PATCH_VERSION | tr '-' '.' | cut -d. 
-f1,2 | tr '.' '-')
-    NVIDIA_MAJOR_VERSION=$(echo $LIBCUDA_VERSION | cut -d. -f1)
-    LIBCUDA_MAJOR=$(echo $LIBCUDA_VERSION | cut -d. -f1)
-    LIBCUDNN_MAJOR=$(echo $LIBCUDNN_VERSION | cut -d. -f1)
-    os_name=$(cat /etc/*release | grep '^ID=' | sed 's/^.*=//g')
-    os_version=$(cat /etc/*release | grep VERSION_ID | sed 
's/^.*"\([0-9]*\)\.\([0-9]*\)"/\1\2/g')
-    os_id="${os_name}${os_version}"
-    if [[ $CUDA_MAJOR_DASH == 9-* ]] || [[ $CUDA_MAJOR_DASH == 10-* ]] || [[ 
$CUDA_MAJOR_DASH == 11-* ]] ; then
-        os_id="ubuntu1604"
-    fi
-    export 
PATH=/usr/lib/binutils-2.26/bin/:${PATH}:$DEPS_PATH/usr/local/cuda-$CUDA_MAJOR_VERSION/bin
-    export 
CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}:$DEPS_PATH/usr/local/cuda-$CUDA_MAJOR_VERSION/include:$DEPS_PATH/usr/include
-    export 
C_INCLUDE_PATH=${C_INCLUDE_PATH}:$DEPS_PATH/usr/local/cuda-$CUDA_MAJOR_VERSION/include:$DEPS_PATH/usr/include
-    export 
LIBRARY_PATH=${LIBRARY_PATH}:$DEPS_PATH/usr/local/cuda-$CUDA_MAJOR_VERSION/lib64:$DEPS_PATH/usr/lib/x86_64-linux-gnu:$DEPS_PATH/usr/lib/nvidia-$NVIDIA_MAJOR_VERSION
-    export 
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$DEPS_PATH/usr/local/cuda-$CUDA_MAJOR_VERSION/lib64:$DEPS_PATH/usr/lib/x86_64-linux-gnu:$DEPS_PATH/usr/lib/nvidia-$NVIDIA_MAJOR_VERSION
-    export NVCC=$DEPS_PATH/usr/local/cuda-$CUDA_MAJOR_VERSION/bin/nvcc
+
+CUDA_MAJOR_VERSION=$(echo $CUDA_VERSION | tr '-' '.' | cut -d. -f1,2)
+CUDA_MAJOR_DASH=$(echo $CUDA_VERSION | tr '-' '.' | cut -d. -f1,2 | tr '.' '-')
+LIBCUDNN_MAJOR=$(echo $LIBCUDNN_VERSION | cut -d. -f1)
+
+if [[ "$ID" == "centos" ]]; then
+    distro="rhel${VERSION_ID}"
+    sudo yum-config-manager --add-repo 
https://developer.download.nvidia.com/compute/cuda/repos/$distro/$(uname 
-m)/cuda-$distro.repo
+elif [[ "$ID" == "ubuntu" ]]; then
+    distro=$(echo ${ID}${VERSION_ID} | sed 's/\.//g')
+    wget -O /tmp/cuda.deb 
https://developer.download.nvidia.com/compute/cuda/repos/$distro/$(uname 
-m)/cuda-keyring_1.0-1_all.deb
+    sudo dpkg -i /tmp/cuda.deb
 fi
 
-# list of debs to download from nvidia
-if [[ $VARIANT == cu112* ]]; then
-    cuda_files=( \
-      "libcublas-${CUDA_MAJOR_DASH}_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "libcublas-dev-${CUDA_MAJOR_DASH}_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "cuda-cudart-${CUDA_MAJOR_DASH}_${LIBCUDART_VERSION}_amd64.deb" \
-      "cuda-cudart-dev-${CUDA_MAJOR_DASH}_${LIBCUDART_VERSION}_amd64.deb" \
-      "libcurand-${CUDA_MAJOR_DASH}_${CUDA_LIBS_VERSION}_amd64.deb" \
-      "libcurand-dev-${CUDA_MAJOR_DASH}_${CUDA_LIBS_VERSION}_amd64.deb" \
-      "libcufft-${CUDA_MAJOR_DASH}_${LIBCUFFT_VERSION}_amd64.deb" \
-      "libcufft-dev-${CUDA_MAJOR_DASH}_${LIBCUFFT_VERSION}_amd64.deb" \
-      "cuda-nvrtc-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvrtc-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "libcusolver-${CUDA_MAJOR_DASH}_${CUDA_SOLVER_VERSION}_amd64.deb" \
-      "libcusolver-dev-${CUDA_MAJOR_DASH}_${CUDA_SOLVER_VERSION}_amd64.deb" \
-      "cuda-nvcc-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvtx-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "libcuda1-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \
-      "cuda-nvprof-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "nvidia-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \
-      "libcudnn${LIBCUDNN_MAJOR}-dev_${LIBCUDNN_VERSION}_amd64.deb" \
-      "libcudnn${LIBCUDNN_MAJOR}_${LIBCUDNN_VERSION}_amd64.deb" \
-    )
-    ml_files=( \
-      "libnccl-dev_${LIBNCCL_VERSION}_amd64.deb" \
-      "libnccl2_${LIBNCCL_VERSION}_amd64.deb" \
-    )
-elif [[ $VARIANT == cu110* ]]; then
-    cuda_files=( \
-      "libcublas-${CUDA_MAJOR_DASH}_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "libcublas-dev-${CUDA_MAJOR_DASH}_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "cuda-cudart-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cudart-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "libcurand-${CUDA_MAJOR_DASH}_${CUDA_LIBS_VERSION}_amd64.deb" \
-      "libcurand-dev-${CUDA_MAJOR_DASH}_${CUDA_LIBS_VERSION}_amd64.deb" \
-      "libcufft-${CUDA_MAJOR_DASH}_${CUDA_LIBS_VERSION}_amd64.deb" \
-      "libcufft-dev-${CUDA_MAJOR_DASH}_${CUDA_LIBS_VERSION}_amd64.deb" \
-      "cuda-nvrtc-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvrtc-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "libcusolver-${CUDA_MAJOR_DASH}_${CUDA_SOLVER_VERSION}_amd64.deb" \
-      "libcusolver-dev-${CUDA_MAJOR_DASH}_${CUDA_SOLVER_VERSION}_amd64.deb" \
-      "cuda-nvcc-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvtx-${CUDA_MAJOR_DASH}_${CUDA_NVTX_VERSION}_amd64.deb" \
-      "libcuda1-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \
-      "cuda-nvprof-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "nvidia-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \
-      "libcudnn${LIBCUDNN_MAJOR}-dev_${LIBCUDNN_VERSION}_amd64.deb" \
-      "libcudnn${LIBCUDNN_MAJOR}_${LIBCUDNN_VERSION}_amd64.deb" \
-      "libnccl-dev_${LIBNCCL_VERSION}_amd64.deb" \
-      "libnccl2_${LIBNCCL_VERSION}_amd64.deb" \
-    )
-elif [[ $VARIANT == cu102* ]]; then
-    cuda_files=( \
-      "cuda-core-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "libcublas10_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "libcublas-dev_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "cuda-cudart-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cudart-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-curand-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-curand-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cufft-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cufft-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvrtc-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvrtc-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cusolver-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cusolver-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-misc-headers-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvcc-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvtx-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "libcuda1-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \
-      "nvidia-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \
-      "libcudnn${LIBCUDNN_MAJOR}-dev_${LIBCUDNN_VERSION}_amd64.deb" \
-      "libcudnn${LIBCUDNN_MAJOR}_${LIBCUDNN_VERSION}_amd64.deb" \
-      "libnccl-dev_${LIBNCCL_VERSION}_amd64.deb" \
-      "libnccl2_${LIBNCCL_VERSION}_amd64.deb" \
+if [[ $ID == "centos" ]]; then
+    pkgs=(\
+        "cuda-libraries-${CUDA_MAJOR_DASH}" \
+        "cuda-libraries-devel-${CUDA_MAJOR_DASH}" \
+        "cuda-nvcc-$CUDA_MAJOR_DASH" \
+        "cuda-nvtx-$CUDA_MAJOR_DASH" \
+        "cuda-nvprof-${CUDA_MAJOR_DASH}" \
+        
"libcudnn${LIBCUDNN_MAJOR}-${LIBCUDNN_VERSION}-1.cuda${CUDA_MAJOR_VERSION}" \
+        
"libcudnn${LIBCUDNN_MAJOR}-devel-${LIBCUDNN_VERSION}-1.cuda${CUDA_MAJOR_VERSION}"
 \
+        "libnccl-devel" \
+        "libnccl2" \
     )
-elif [[ $VARIANT == cu101* ]]; then
-    cuda_files=( \
-      "cuda-core-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "libcublas10_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "libcublas-dev_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "cuda-cudart-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cudart-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-curand-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-curand-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cufft-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cufft-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvrtc-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvrtc-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cusolver-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cusolver-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-misc-headers-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvcc-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvtx-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "libcuda1-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \
-      "nvidia-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \
-    )
-    ml_files=( \
-      "libcudnn${LIBCUDNN_MAJOR}-dev_${LIBCUDNN_VERSION}_amd64.deb" \
-      "libcudnn${LIBCUDNN_MAJOR}_${LIBCUDNN_VERSION}_amd64.deb" \
-      "libnccl-dev_${LIBNCCL_VERSION}_amd64.deb" \
-      "libnccl2_${LIBNCCL_VERSION}_amd64.deb" \
-    )
-elif [[ $VARIANT == cu100* ]]; then
-    cuda_files=( \
-      "cuda-core-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cublas-${CUDA_MAJOR_DASH}_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "cuda-cublas-dev-${CUDA_MAJOR_DASH}_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "cuda-cudart-${CUDA_MAJOR_DASH}_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "cuda-cudart-dev-${CUDA_MAJOR_DASH}_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "cuda-curand-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-curand-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cufft-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cufft-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvrtc-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvrtc-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cusolver-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-cusolver-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-misc-headers-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "cuda-nvcc-${CUDA_MAJOR_DASH}_${CUDA_PATCH_VERSION}_amd64.deb" \
-      "cuda-nvtx-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \
-      "libcuda1-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \
-      "nvidia-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \
-    )
-    ml_files=( \
-      "libcudnn${LIBCUDNN_MAJOR}-dev_${LIBCUDNN_VERSION}_amd64.deb" \
-      "libcudnn${LIBCUDNN_MAJOR}_${LIBCUDNN_VERSION}_amd64.deb" \
-      "libnccl-dev_${LIBNCCL_VERSION}_amd64.deb" \
-      "libnccl2_${LIBNCCL_VERSION}_amd64.deb" \
+elif [[ $ID == "ubuntu" ]]; then
+    pkgs=(\
+        "cuda-libraries-${CUDA_MAJOR_DASH}" \
+        "cuda-libraries-dev-${CUDA_MAJOR_DASH}" \
+        "cuda-nvcc-$CUDA_MAJOR_DASH" \
+        "cuda-nvtx-$CUDA_MAJOR_DASH" \
+        "cuda-nvprof-$CUDA_MAJOR_DASH" \
+        
"libcudnn${LIBCUDNN_MAJOR}-${LIBCUDNN_VERSION}-1+cuda${CUDA_MAJOR_VERSION}" \
+        
"libcudnn${LIBCUDNN_MAJOR}-dev-${LIBCUDNN_VERSION}-1+cuda${CUDA_MAJOR_VERSION}" 
\
+        "libnccl-dev" \
+        "libnccl2" \
     )
 fi
 
+if [[ ! -d /usr/local/cuda-${CUDA_MAJOR_VERSION} ]]; then
 
-if [[ ! -d $DEPS_PATH/usr/local/cuda-${CUDA_MAJOR_VERSION} ]]; then
-    prefix=$DEPS_PATH
-
-    for item in ${cuda_files[*]}
-    do
-        echo "Installing $item"
-        curl -sL 
"http://developer.download.nvidia.com/compute/cuda/repos/${os_id}/x86_64/${item}";
 -o package.deb
-        dpkg -X package.deb ${prefix}
-        rm package.deb
-    done
-    for item in ${ml_files[*]}
-    do
-        echo "Installing $item"
-        if [[ $item == libnccl* ]] && [[ $VARIANT == cu112* ]] ; then
-            echo "variant ${VARIANT} and installing ${item}"
-            curl -sL 
"http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/${item}";
 -o package.deb
-        else
-            curl -sL 
"http://developer.download.nvidia.com/compute/machine-learning/repos/${os_id}/x86_64/${item}";
 -o package.deb
-        fi
-        dpkg -X package.deb ${prefix}
-        rm package.deb
-    done
-
-    mkdir -p ${prefix}/include ${prefix}/lib ${prefix}/usr/lib/x86_64-linux-gnu
-    if [[ $LIBCUDNN_MAJOR == 8 ]]; then
-        for h in ${prefix}/usr/include/x86_64-linux-gnu/cudnn_*_v8.h; do
-            newfile=$(basename $h | sed 's/_v8//')
-            cp $h ${prefix}/include/$newfile
-        done
+    if [[ "$ID" == "ubuntu" ]]; then
+        sudo apt install -y ${pkgs[*]}
+    elif [[ "$ID" == "centos" ]]; then
+        sudo yum install -y ${pkgs[*]}
     fi
-    cp -f ${prefix}/usr/include/x86_64-linux-gnu/cudnn_v${LIBCUDNN_MAJOR}.h 
${prefix}/include/cudnn.h
-    ln -sf ${prefix}/usr/lib/x86_64-linux-gnu/libcudnn.so.${LIBCUDNN_MAJOR} 
${prefix}/lib/libcudnn.so
-    cp -f ${prefix}/usr/include/nccl.h ${prefix}/include/nccl.h
+
 fi
 
+# allow linking against libcuda stubs if no driver is present
+export 
CMAKE_PARAMETERS="-DCMAKE_EXE_LINKER_FLAGS='-L/usr/local/cuda-${CUDA_MAJOR_VERSION}/lib64/stubs'
 \
+       
-DCMAKE_SHARED_LINKER_FLAGS='-L/usr/local/cuda-${CUDA_MAJOR_VERSION}/lib64/stubs'"
+
+export 
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}/usr/local/cuda-${CUDA_MAJOR_VERSION}/lib64/stubs
diff --git a/tools/staticbuild/build.sh b/tools/staticbuild/build.sh
index 5a35bf58d3..71812b1e96 100755
--- a/tools/staticbuild/build.sh
+++ b/tools/staticbuild/build.sh
@@ -58,6 +58,7 @@ else
     export CXX="g++ -fPIC -mno-avx"
     export 
PKG_CONFIG_PATH=$DEPS_PATH/lib/pkgconfig:$DEPS_PATH/lib64/pkgconfig:$DEPS_PATH/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH
 fi
+
 export FC="gfortran"
 if [[ $ARCH == 'aarch64' ]]; then
     export CPATH=/opt/arm/armpl_21.0_gcc-8.2/include_lp64_mp:$CPATH
diff --git a/tools/staticbuild/build_lib.sh b/tools/staticbuild/build_lib.sh
index 6cceced6f2..8a4717c031 100755
--- a/tools/staticbuild/build_lib.sh
+++ b/tools/staticbuild/build_lib.sh
@@ -40,14 +40,12 @@ $MAKE DEPS_PATH=$DEPS_PATH mkldnn
 $MAKE DEPS_PATH=$DEPS_PATH
 
 if [[ $PLATFORM == 'linux' ]]; then
-    if [[ -f /usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortran.so ]]; then
-        cp -L /usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortran.so 
lib/libgfortran.so.3
-    elif [[ -f /usr/lib/x86_64-linux-gnu/libgfortran.so.3 ]]; then
-        cp -L /usr/lib/x86_64-linux-gnu/libgfortran.so.3 lib/libgfortran.so.3
-    else
-        cp -L /usr/lib/x86_64-linux-gnu/libgfortran.so.4 lib/libgfortran.so.4
+    if ldd lib/libmxnet.so | grep -q libgfortran; then
+        cp -L $(ldd lib/libmxnet.so | grep libgfortran | awk '{print $3}') lib/
+    fi
+    if ldd lib/libmxnet.so | grep -q libquadmath; then
+        cp -L $(ldd lib/libmxnet.so | grep libquadmath | awk '{print $3}') lib/
     fi
-    cp -L /usr/lib/x86_64-linux-gnu/libquadmath.so.0 lib/libquadmath.so.0
 fi
 
 # Print the linked objects on libmxnet.so
diff --git a/tools/staticbuild/build_lib_cmake.sh 
b/tools/staticbuild/build_lib_cmake.sh
index e6c14e4bb7..5c1d39c995 100755
--- a/tools/staticbuild/build_lib_cmake.sh
+++ b/tools/staticbuild/build_lib_cmake.sh
@@ -31,7 +31,7 @@ git submodule update --init --recursive || true
 
 # Build libmxnet.so
 rm -rf build; mkdir build; cd build
-cmake -GNinja -C $cmake_config -DCMAKE_PREFIX_PATH=${DEPS_PATH} 
-DCMAKE_FIND_ROOT_PATH=${DEPS_PATH} ..
+cmake -GNinja -C $cmake_config $CMAKE_PARAMETERS 
-DCMAKE_PREFIX_PATH=${DEPS_PATH} -DCMAKE_FIND_ROOT_PATH=${DEPS_PATH} ..
 if [[ ! $ARCH == 'aarch64' ]]; then
     ninja
 else

Reply via email to