Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] ADD 11.6 workflow for docker image build #992

Merged
merged 5 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-conda-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: linux.2xlarge
strategy:
matrix:
cuda_version: ["10.2", "11.3", "11.5", "cpu"]
cuda_version: ["10.2", "11.3", "11.5", "11.6", "cpu"]
env:
CUDA_VERSION: ${{ matrix.cuda_version }}
steps:
Expand Down
54 changes: 54 additions & 0 deletions common/install_cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,27 @@ function install_115 {
ldconfig
}

function install_116 {
echo "Installing CUDA 11.6 and CuDNN 8.3"
rm -rf /usr/local/cuda-11.6 /usr/local/cuda
# install CUDA 11.6.0 in the same container
wget -q https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run
chmod +x cuda_11.6.0_510.39.01_linux.run
./cuda_11.6.0_510.39.01_linux.run --toolkit --silent
rm -f cuda_11.6.0_510.39.01_linux.run
rm -f /usr/local/cuda && ln -s /usr/local/cuda-11.6 /usr/local/cuda

# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
mkdir tmp_cudnn && cd tmp_cudnn
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
tar xf cudnn-linux-x86_64-8.3.2.44_cuda11.5-archive.tar.xz
cp -a cudnn-linux-x86_64-8.3.2.44_cuda11.5-archive/include/* /usr/local/cuda/include/
cp -a cudnn-linux-x86_64-8.3.2.44_cuda11.5-archive/lib/* /usr/local/cuda/lib64/
cd ..
rm -rf tmp_cudnn
ldconfig
}

function prune_102 {
echo "Pruning CUDA 10.2 and CuDNN"
#####################################################################################
Expand Down Expand Up @@ -172,6 +193,37 @@ function prune_115 {
rm -rf $CUDA_BASE/libnvvp $CUDA_BASE/nsightee_plugins $CUDA_BASE/nsight-compute-2021.3.0 $CUDA_BASE/nsight-systems-2021.3.3
}

function prune_116 {
echo "Pruning CUDA 11.6 and CuDNN"
#####################################################################################
# CUDA 11.6 prune static libs
#####################################################################################
export NVPRUNE="/usr/local/cuda-11.6/bin/nvprune"
export CUDA_LIB_DIR="/usr/local/cuda-11.6/lib64"

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"
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"

if [[ -n "$OVERRIDE_GENCODE" ]]; then
export GENCODE=$OVERRIDE_GENCODE
fi

# all CUDA libs except CuDNN and CuBLAS (cudnn and cublas need arch 3.7 included)
ls $CUDA_LIB_DIR/ | grep "\.a" | grep -v "culibos" | grep -v "cudart" | grep -v "cudnn" | grep -v "cublas" | grep -v "metis" \
| xargs -I {} bash -c \
"echo {} && $NVPRUNE $GENCODE $CUDA_LIB_DIR/{} -o $CUDA_LIB_DIR/{}"

# prune CuDNN and CuBLAS
$NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublas_static.a -o $CUDA_LIB_DIR/libcublas_static.a
$NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublasLt_static.a -o $CUDA_LIB_DIR/libcublasLt_static.a

#####################################################################################
# CUDA 11.6 prune visual tools
#####################################################################################
export CUDA_BASE="/usr/local/cuda-11.6/"
rm -rf $CUDA_BASE/libnvvp $CUDA_BASE/nsightee_plugins $CUDA_BASE/nsight-compute-2022.1.1 $CUDA_BASE/nsight-systems-2021.5.2
}

# idiomatic parameter and option handling in sh
while test $# -gt 0
do
Expand All @@ -182,6 +234,8 @@ do
;;
11.5) install_115; prune_115
;;
11.6) install_116; prune_116
;;
*) echo "bad argument $1"; exit 1
;;
esac
Expand Down
5 changes: 5 additions & 0 deletions conda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ FROM cuda as cuda11.5
RUN bash ./install_cuda.sh 11.5
ENV DESIRED_CUDA=11.5

FROM cuda as cuda11.6
RUN bash ./install_cuda.sh 11.6
ENV DESIRED_CUDA=11.6

# Install MNIST test data
FROM base as mnist
ADD ./common/install_mnist.sh install_mnist.sh
Expand All @@ -64,6 +68,7 @@ FROM base as all_cuda
COPY --from=cuda10.2 /usr/local/cuda-10.2 /usr/local/cuda-10.2
COPY --from=cuda11.3 /usr/local/cuda-11.3 /usr/local/cuda-11.3
COPY --from=cuda11.5 /usr/local/cuda-11.5 /usr/local/cuda-11.5
COPY --from=cuda11.6 /usr/local/cuda-11.6 /usr/local/cuda-11.6

FROM ${BASE_TARGET} as final
# Install LLVM
Expand Down
2 changes: 1 addition & 1 deletion conda/build_all_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -eou pipefail

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

for CUDA_VERSION in 11.5 11.3 10.2 cpu; do
for CUDA_VERSION in 11.6 11.5 11.3 10.2 cpu; do
CUDA_VERSION="${CUDA_VERSION}" conda/build_docker.sh
done