Skip to content

Commit 874e4b7

Browse files
authored
add CUDA 11.7.0 workflow for docker image build (#1048)
Co-authored-by: pbialecki <[email protected]>
1 parent 65218d4 commit 874e4b7

File tree

4 files changed

+62
-3
lines changed

4 files changed

+62
-3
lines changed

.github/workflows/build-conda-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: linux.2xlarge
2727
strategy:
2828
matrix:
29-
cuda_version: ["10.2", "11.3", "11.5", "11.6", "cpu"]
29+
cuda_version: ["10.2", "11.3", "11.5", "11.6", "11.7", "cpu"]
3030
env:
3131
CUDA_VERSION: ${{ matrix.cuda_version }}
3232
steps:

common/install_cuda.sh

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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+
100121
function 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
227279
while test $# -gt 0
@@ -235,6 +287,8 @@ do
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

conda/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ FROM cuda as cuda11.6
6060
RUN bash ./install_cuda.sh 11.6
6161
ENV DESIRED_CUDA=11.6
6262

63+
FROM cuda as cuda11.7
64+
RUN bash ./install_cuda.sh 11.7
65+
ENV DESIRED_CUDA=11.7
66+
6367
# Install MNIST test data
6468
FROM base as mnist
6569
ADD ./common/install_mnist.sh install_mnist.sh
@@ -70,6 +74,7 @@ COPY --from=cuda10.2 /usr/local/cuda-10.2 /usr/local/cuda-10.2
7074
COPY --from=cuda11.3 /usr/local/cuda-11.3 /usr/local/cuda-11.3
7175
COPY --from=cuda11.5 /usr/local/cuda-11.5 /usr/local/cuda-11.5
7276
COPY --from=cuda11.6 /usr/local/cuda-11.6 /usr/local/cuda-11.6
77+
COPY --from=cuda11.7 /usr/local/cuda-11.7 /usr/local/cuda-11.7
7378

7479
FROM ${BASE_TARGET} as final
7580
# Install LLVM

conda/build_all_docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ set -eou pipefail
44

55
TOPDIR=$(git rev-parse --show-toplevel)
66

7-
for CUDA_VERSION in 11.6 11.5 11.3 10.2 cpu; do
7+
for CUDA_VERSION in 11.7 11.6 11.5 11.3 10.2 cpu; do
88
CUDA_VERSION="${CUDA_VERSION}" conda/build_docker.sh
99
done

0 commit comments

Comments
 (0)