@@ -137,6 +137,39 @@ function install_124 {
137137 ldconfig
138138}
139139
140+ function install_126 {
141+ echo " Installing CUDA 12.6.2 and cuDNN ${CUDNN_VERSION} and NCCL ${NCCL_VERSION} and cuSparseLt-0.6.2"
142+ rm -rf /usr/local/cuda-12.6 /usr/local/cuda
143+ # install CUDA 12.6.2 in the same container
144+ wget -q https://developer.download.nvidia.com/compute/cuda/12.6.2/local_installers/cuda_12.6.2_560.35.03_linux.run
145+ chmod +x cuda_12.6.2_560.35.03_linux.run
146+ ./cuda_12.6.2_560.35.03_linux.run --toolkit --silent
147+ rm -f cuda_12.6.2_560.35.03_linux.run
148+ rm -f /usr/local/cuda && ln -s /usr/local/cuda-12.6 /usr/local/cuda
149+
150+ # cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
151+ mkdir tmp_cudnn && cd tmp_cudnn
152+ wget -q https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-${CUDNN_VERSION} _cuda12-archive.tar.xz -O cudnn-linux-x86_64-${CUDNN_VERSION} _cuda12-archive.tar.xz
153+ tar xf cudnn-linux-x86_64-${CUDNN_VERSION} _cuda12-archive.tar.xz
154+ cp -a cudnn-linux-x86_64-${CUDNN_VERSION} _cuda12-archive/include/* /usr/local/cuda/include/
155+ cp -a cudnn-linux-x86_64-${CUDNN_VERSION} _cuda12-archive/lib/* /usr/local/cuda/lib64/
156+ cd ..
157+ rm -rf tmp_cudnn
158+
159+ # NCCL license: https://docs.nvidia.com/deeplearning/nccl/#licenses
160+ # Follow build: https://github.com/NVIDIA/nccl/tree/master?tab=readme-ov-file#build
161+ git clone -b $NCCL_VERSION --depth 1 https://github.com/NVIDIA/nccl.git
162+ cd nccl && make -j src.build
163+ cp -a build/include/* /usr/local/cuda/include/
164+ cp -a build/lib/* /usr/local/cuda/lib64/
165+ cd ..
166+ rm -rf nccl
167+
168+ install_cusparselt_062
169+
170+ ldconfig
171+ }
172+
140173function prune_118 {
141174 echo " Pruning CUDA 11.8 and cuDNN"
142175 # ####################################################################################
@@ -227,12 +260,46 @@ function prune_124 {
227260 $NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR /libcublasLt_static.a -o $CUDA_LIB_DIR /libcublasLt_static.a
228261
229262 # ####################################################################################
230- # CUDA 12.1 prune visual tools
263+ # CUDA 12.4 prune visual tools
231264 # ####################################################################################
232265 export CUDA_BASE=" /usr/local/cuda-12.4/"
233266 rm -rf $CUDA_BASE /libnvvp $CUDA_BASE /nsightee_plugins $CUDA_BASE /nsight-compute-2024.1.0 $CUDA_BASE /nsight-systems-2023.4.4/
234267}
235268
269+ function prune_126 {
270+ echo " Pruning CUDA 12.6"
271+ # ####################################################################################
272+ # CUDA 12.6 prune static libs
273+ # ####################################################################################
274+ export NVPRUNE=" /usr/local/cuda-12.6/bin/nvprune"
275+ export CUDA_LIB_DIR=" /usr/local/cuda-12.6/lib64"
276+
277+ export GENCODE=" -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 -gencode arch=compute_90,code=sm_90"
278+ export GENCODE_CUDNN=" -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 -gencode arch=compute_90,code=sm_90"
279+
280+ if [[ -n " $OVERRIDE_GENCODE " ]]; then
281+ export GENCODE=$OVERRIDE_GENCODE
282+ fi
283+ if [[ -n " $OVERRIDE_GENCODE_CUDNN " ]]; then
284+ export GENCODE_CUDNN=$OVERRIDE_GENCODE_CUDNN
285+ fi
286+
287+ # all CUDA libs except CuDNN and CuBLAS
288+ ls $CUDA_LIB_DIR / | grep " \.a" | grep -v " culibos" | grep -v " cudart" | grep -v " cudnn" | grep -v " cublas" | grep -v " metis" \
289+ | xargs -I {} bash -c \
290+ " echo {} && $NVPRUNE $GENCODE $CUDA_LIB_DIR /{} -o $CUDA_LIB_DIR /{}"
291+
292+ # prune CuDNN and CuBLAS
293+ $NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR /libcublas_static.a -o $CUDA_LIB_DIR /libcublas_static.a
294+ $NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR /libcublasLt_static.a -o $CUDA_LIB_DIR /libcublasLt_static.a
295+
296+ # ####################################################################################
297+ # CUDA 12.6 prune visual tools
298+ # ####################################################################################
299+ export CUDA_BASE=" /usr/local/cuda-12.6/"
300+ rm -rf $CUDA_BASE /libnvvp $CUDA_BASE /nsightee_plugins $CUDA_BASE /nsight-compute-2024.3.2 $CUDA_BASE /nsight-systems-2024.5.1/
301+ }
302+
236303# idiomatic parameter and option handling in sh
237304while test $# -gt 0
238305do
243310 ;;
244311 12.4) install_124; prune_124
245312 ;;
313+ 12.6) install_126; prune_126
314+ ;;
246315 * ) echo " bad argument $1 " ; exit 1
247316 ;;
248317 esac
0 commit comments