Skip to content

Commit 736bac6

Browse files
authored
add 11.8 workflow for docker image build (#1186)
1 parent 98f8be0 commit 736bac6

File tree

4 files changed

+62
-3
lines changed

4 files changed

+62
-3
lines changed

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

+1-1
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", "11.7", "cpu"]
29+
cuda_version: ["10.2", "11.3", "11.5", "11.6", "11.7", "11.8", "cpu"]
3030
env:
3131
CUDA_VERSION: ${{ matrix.cuda_version }}
3232
steps:

common/install_cuda.sh

+55-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function install_116 {
9898
}
9999

100100
function install_117 {
101-
echo "Installing CUDA 11.7 and CuDNN 8.3"
101+
echo "Installing CUDA 11.7 and CuDNN 8.5"
102102
rm -rf /usr/local/cuda-11.7 /usr/local/cuda
103103
# install CUDA 11.7.0 in the same container
104104
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 {
118118
ldconfig
119119
}
120120

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+
121142
function prune_102 {
122143
echo "Pruning CUDA 10.2 and CuDNN"
123144
#####################################################################################
@@ -275,6 +296,37 @@ function prune_117 {
275296
rm -rf $CUDA_BASE/libnvvp $CUDA_BASE/nsightee_plugins $CUDA_BASE/nsight-compute-2022.2.0 $CUDA_BASE/nsight-systems-2022.1.3
276297
}
277298

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+
278330
# idiomatic parameter and option handling in sh
279331
while test $# -gt 0
280332
do
@@ -289,6 +341,8 @@ do
289341
;;
290342
11.7) install_117; prune_117
291343
;;
344+
11.8) install_118; prune_118
345+
;;
292346
*) echo "bad argument $1"; exit 1
293347
;;
294348
esac

conda/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ FROM cuda as cuda11.7
6464
RUN bash ./install_cuda.sh 11.7
6565
ENV DESIRED_CUDA=11.7
6666

67+
FROM cuda as cuda11.8
68+
RUN bash ./install_cuda.sh 11.8
69+
ENV DESIRED_CUDA=11.8
70+
6771
# Install MNIST test data
6872
FROM base as mnist
6973
ADD ./common/install_mnist.sh install_mnist.sh
@@ -75,6 +79,7 @@ COPY --from=cuda11.3 /usr/local/cuda-11.3 /usr/local/cuda-11.3
7579
COPY --from=cuda11.5 /usr/local/cuda-11.5 /usr/local/cuda-11.5
7680
COPY --from=cuda11.6 /usr/local/cuda-11.6 /usr/local/cuda-11.6
7781
COPY --from=cuda11.7 /usr/local/cuda-11.7 /usr/local/cuda-11.7
82+
COPY --from=cuda11.8 /usr/local/cuda-11.8 /usr/local/cuda-11.8
7883

7984
FROM ${BASE_TARGET} as final
8085
# Install LLVM

conda/build_all_docker.sh

+1-1
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.7 11.6 11.5 11.3 10.2 cpu; do
7+
for CUDA_VERSION in 11.8 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)