@@ -97,6 +97,27 @@ function install_116 {
9797 ldconfig
9898}
9999
100+ function install_117 {
101+ echo " Installing CUDA 11.7 and CuDNN 8.3"
102+ rm -rf /usr/local/cuda-11.7 /usr/local/cuda
103+ # install CUDA 11.7.0 in the same container
104+ wget -q https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_515.43.04_linux.run
105+ chmod +x cuda_11.7.0_515.43.04_linux.run
106+ ./cuda_11.7.0_515.43.04_linux.run --toolkit --silent
107+ rm -f cuda_11.7.0_515.43.04_linux.run
108+ rm -f /usr/local/cuda && ln -s /usr/local/cuda-11.7 /usr/local/cuda
109+
110+ # cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
111+ mkdir tmp_cudnn && cd tmp_cudnn
112+ wget -q https://developer.download.nvidia.com/compute/redist/cudnn/v8.3.2/local_installers/11.5/cudnn-linux-x86_64-8.3.2.44_cuda11.5-archive.tar.xz -O cudnn-linux-x86_64-8.3.2.44_cuda11.5-archive.tar.xz
113+ tar xf cudnn-linux-x86_64-8.3.2.44_cuda11.5-archive.tar.xz
114+ cp -a cudnn-linux-x86_64-8.3.2.44_cuda11.5-archive/include/* /usr/local/cuda/include/
115+ cp -a cudnn-linux-x86_64-8.3.2.44_cuda11.5-archive/lib/* /usr/local/cuda/lib64/
116+ cd ..
117+ rm -rf tmp_cudnn
118+ ldconfig
119+ }
120+
100121function prune_102 {
101122 echo " Pruning CUDA 10.2 and CuDNN"
102123 # ####################################################################################
@@ -221,7 +242,38 @@ function prune_116 {
221242 # ####################################################################################
222243 export CUDA_BASE=" /usr/local/cuda-11.6/"
223244 rm -rf $CUDA_BASE /libnvvp $CUDA_BASE /nsightee_plugins $CUDA_BASE /nsight-compute-2022.1.1 $CUDA_BASE /nsight-systems-2021.5.2
224- }
245+ }
246+
247+ function prune_117 {
248+ echo " Pruning CUDA 11.7 and CuDNN"
249+ # ####################################################################################
250+ # CUDA 11.7 prune static libs
251+ # ####################################################################################
252+ export NVPRUNE=" /usr/local/cuda-11.7/bin/nvprune"
253+ export CUDA_LIB_DIR=" /usr/local/cuda-11.7/lib64"
254+
255+ export GENCODE=" -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86"
256+ export GENCODE_CUDNN=" -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86"
257+
258+ if [[ -n " $OVERRIDE_GENCODE " ]]; then
259+ export GENCODE=$OVERRIDE_GENCODE
260+ fi
261+
262+ # all CUDA libs except CuDNN and CuBLAS (cudnn and cublas need arch 3.7 included)
263+ ls $CUDA_LIB_DIR / | grep " \.a" | grep -v " culibos" | grep -v " cudart" | grep -v " cudnn" | grep -v " cublas" | grep -v " metis" \
264+ | xargs -I {} bash -c \
265+ " echo {} && $NVPRUNE $GENCODE $CUDA_LIB_DIR /{} -o $CUDA_LIB_DIR /{}"
266+
267+ # prune CuDNN and CuBLAS
268+ $NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR /libcublas_static.a -o $CUDA_LIB_DIR /libcublas_static.a
269+ $NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR /libcublasLt_static.a -o $CUDA_LIB_DIR /libcublasLt_static.a
270+
271+ # ####################################################################################
272+ # CUDA 11.6 prune visual tools
273+ # ####################################################################################
274+ export CUDA_BASE=" /usr/local/cuda-11.7/"
275+ rm -rf $CUDA_BASE /libnvvp $CUDA_BASE /nsightee_plugins $CUDA_BASE /nsight-compute-2022.2.0 $CUDA_BASE /nsight-systems-2022.1.3
276+ }
225277
226278# idiomatic parameter and option handling in sh
227279while test $# -gt 0
235287 ;;
236288 11.6) install_116; prune_116
237289 ;;
290+ 11.7) install_117; prune_117
291+ ;;
238292 * ) echo " bad argument $1 " ; exit 1
239293 ;;
240294 esac
0 commit comments