From 8c6715e4e5f6d99858503ca5c8f9a7346140ced8 Mon Sep 17 00:00:00 2001 From: Minh-Thuc <46375464+minhthuc2502@users.noreply.github.com> Date: Wed, 7 Feb 2024 10:43:06 +0100 Subject: [PATCH] update cuda 11.2 to cuda 12.2 (#1590) * update cuda-11 to cuda 12 --------- Co-authored-by: thucpham --- docker/Dockerfile | 10 +++++----- docker/build_all.sh | 2 +- python/tools/prepare_build_environment_linux.sh | 16 +++++++--------- .../tools/prepare_build_environment_windows.sh | 16 +++++++++------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a14084680..bfc7dfcbf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04 as builder +FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu20.04 as builder RUN apt-get update && \ apt-get install -y --no-install-recommends \ @@ -66,18 +66,18 @@ RUN cd python && \ python3 -m pip --no-cache-dir install -r install_requirements.txt && \ python3 setup.py bdist_wheel --dist-dir $CTRANSLATE2_ROOT -FROM nvidia/cuda:11.2.2-base-ubuntu20.04 +FROM nvidia/cuda:12.2.2-base-ubuntu20.04 # We remove the cuda-compat package because it conflicts with the CUDA Enhanced Compatibility. # See e.g. https://github.com/NVIDIA/nvidia-docker/issues/1515 RUN apt-get update && \ apt-get install -y --no-install-recommends \ - libcublas-11-2 \ - libcudnn8=8.1.1.33-1+cuda11.2 \ + libcublas-12-2 \ + libcudnn8=8.9.7.29-1+cuda12.2 \ libgomp1 \ python3-pip \ && \ - apt-get purge -y cuda-compat-11-2 && \ + apt-get purge -y cuda-compat-12-2 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/docker/build_all.sh b/docker/build_all.sh index ce789c923..a84faac9e 100755 --- a/docker/build_all.sh +++ b/docker/build_all.sh @@ -42,4 +42,4 @@ build() fi } -build Dockerfile ubuntu20.04-cuda11.2 +build Dockerfile ubuntu20.04-cuda12.2 diff --git a/python/tools/prepare_build_environment_linux.sh b/python/tools/prepare_build_environment_linux.sh index a4009e566..0350e01e7 100755 --- a/python/tools/prepare_build_environment_linux.sh +++ b/python/tools/prepare_build_environment_linux.sh @@ -20,17 +20,15 @@ if [ "$CIBW_ARCHS" == "aarch64" ]; then else - # Install CUDA 11.2, see: - # * https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.2.2/centos7-x86_64/base/Dockerfile - # * https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.2.2/centos7-x86_64/devel/Dockerfile + # Install CUDA 12.2: yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo yum install --setopt=obsoletes=0 -y \ - cuda-nvcc-11-2-11.2.152-1 \ - cuda-cudart-devel-11-2-11.2.152-1 \ - libcurand-devel-11-2-10.2.3.152-1 \ - libcudnn8-devel-8.1.1.33-1.cuda11.2 \ - libcublas-devel-11-2-11.4.1.1043-1 - ln -s cuda-11.2 /usr/local/cuda + cuda-nvcc-12-2-12.2.140-1 \ + cuda-cudart-devel-12-2-12.2.140-1 \ + libcurand-devel-12-2-10.3.3.141-1 \ + libcudnn8-devel-8.9.7.29-1.cuda12.2 \ + libcublas-devel-12-2-12.2.5.6-1 + ln -s cuda-12.2 /usr/local/cuda ONEAPI_VERSION=2023.2.0 yum-config-manager --add-repo https://yum.repos.intel.com/oneapi diff --git a/python/tools/prepare_build_environment_windows.sh b/python/tools/prepare_build_environment_windows.sh index 0d8e409bc..b5fe03ecc 100755 --- a/python/tools/prepare_build_environment_windows.sh +++ b/python/tools/prepare_build_environment_windows.sh @@ -3,15 +3,17 @@ set -e set -x -CUDA_ROOT="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2" -curl -L -nv -o cuda.exe https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_461.33_win10.exe -./cuda.exe -s nvcc_11.2 cudart_11.2 cublas_dev_11.2 curand_dev_11.2 +CUDA_ROOT="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.2" +curl -L -nv -o cuda.exe https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_537.13_windows.exe +./cuda.exe -s nvcc_12.2 cudart_12.2 cublas_dev_12.2 curand_dev_12.2 rm cuda.exe -curl -L -nv -o cudnn.zip https://developer.download.nvidia.com/compute/redist/cudnn/v8.1.1/cudnn-11.2-windows-x64-v8.1.1.33.zip -unzip cudnn.zip && rm cudnn.zip -cp -r cuda/* "$CUDA_ROOT" -rm -r cuda/ +CUDNN_ROOT="C:/Program Files/NVIDIA/CUDNN/v8.8" +curl -L -nv -o cudnn.exe https://developer.download.nvidia.com/compute/redist/cudnn/v8.8.0/local_installers/12.0/cudnn_8.8.0.121_windows.exe +./cudnn.exe -s +sleep 10 +cp -r "$CUDNN_ROOT"/* "$CUDA_ROOT" +rm cudnn.exe # See https://github.com/oneapi-src/oneapi-ci for installer URLs curl -L -nv -o webimage.exe https://registrationcenter-download.intel.com/akdlm/irc_nas/19078/w_BaseKit_p_2023.0.0.25940_offline.exe