@@ -98,7 +98,7 @@ function install_116 {
98
98
}
99
99
100
100
function install_117 {
101
- echo " Installing CUDA 11.7 and CuDNN 8.3 "
101
+ echo " Installing CUDA 11.7 and CuDNN 8.5 "
102
102
rm -rf /usr/local/cuda-11.7 /usr/local/cuda
103
103
# install CUDA 11.7.0 in the same container
104
104
wget -q https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_515.43.04_linux.run
@@ -118,6 +118,27 @@ function install_117 {
118
118
ldconfig
119
119
}
120
120
121
+ function install_118 {
122
+ echo " Installing CUDA 11.8 and cuDNN 8.5"
123
+ rm -rf /usr/local/cuda-11.8 /usr/local/cuda
124
+ # install CUDA 11.8.0 in the same container
125
+ wget -q https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
126
+ chmod +x cuda_11.8.0_520.61.05_linux.run
127
+ ./cuda_11.8.0_520.61.05_linux.run --toolkit --silent
128
+ rm -f cuda_11.8.0_520.61.05_linux.run
129
+ rm -f /usr/local/cuda && ln -s /usr/local/cuda-11.8 /usr/local/cuda
130
+
131
+ # cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
132
+ mkdir tmp_cudnn && cd tmp_cudnn
133
+ wget -q https://ossci-linux.s3.amazonaws.com/cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar.xz -O cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar.xz
134
+ tar xf cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar.xz
135
+ cp -a cudnn-linux-x86_64-8.5.0.96_cuda11-archive/include/* /usr/local/cuda/include/
136
+ cp -a cudnn-linux-x86_64-8.5.0.96_cuda11-archive/lib/* /usr/local/cuda/lib64/
137
+ cd ..
138
+ rm -rf tmp_cudnn
139
+ ldconfig
140
+ }
141
+
121
142
function prune_102 {
122
143
echo " Pruning CUDA 10.2 and CuDNN"
123
144
# ####################################################################################
@@ -275,6 +296,37 @@ function prune_117 {
275
296
rm -rf $CUDA_BASE /libnvvp $CUDA_BASE /nsightee_plugins $CUDA_BASE /nsight-compute-2022.2.0 $CUDA_BASE /nsight-systems-2022.1.3
276
297
}
277
298
299
+ function prune_118 {
300
+ echo " Pruning CUDA 11.8 and cuDNN"
301
+ # ####################################################################################
302
+ # CUDA 11.8 prune static libs
303
+ # ####################################################################################
304
+ export NVPRUNE=" /usr/local/cuda-11.8/bin/nvprune"
305
+ export CUDA_LIB_DIR=" /usr/local/cuda-11.8/lib64"
306
+
307
+ 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"
308
+ 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"
309
+
310
+ if [[ -n " $OVERRIDE_GENCODE " ]]; then
311
+ export GENCODE=$OVERRIDE_GENCODE
312
+ fi
313
+
314
+ # all CUDA libs except CuDNN and CuBLAS (cudnn and cublas need arch 3.7 included)
315
+ ls $CUDA_LIB_DIR / | grep " \.a" | grep -v " culibos" | grep -v " cudart" | grep -v " cudnn" | grep -v " cublas" | grep -v " metis" \
316
+ | xargs -I {} bash -c \
317
+ " echo {} && $NVPRUNE $GENCODE $CUDA_LIB_DIR /{} -o $CUDA_LIB_DIR /{}"
318
+
319
+ # prune CuDNN and CuBLAS
320
+ $NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR /libcublas_static.a -o $CUDA_LIB_DIR /libcublas_static.a
321
+ $NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR /libcublasLt_static.a -o $CUDA_LIB_DIR /libcublasLt_static.a
322
+
323
+ # ####################################################################################
324
+ # CUDA 11.8 prune visual tools
325
+ # ####################################################################################
326
+ export CUDA_BASE=" /usr/local/cuda-11.8/"
327
+ rm -rf $CUDA_BASE /libnvvp $CUDA_BASE /nsightee_plugins $CUDA_BASE /nsight-compute-2022.3.0 $CUDA_BASE /nsight-systems-2022.4.2/
328
+ }
329
+
278
330
# idiomatic parameter and option handling in sh
279
331
while test $# -gt 0
280
332
do
289
341
;;
290
342
11.7) install_117; prune_117
291
343
;;
344
+ 11.8) install_118; prune_118
345
+ ;;
292
346
* ) echo " bad argument $1 " ; exit 1
293
347
;;
294
348
esac
0 commit comments