From 26fa641498b49e66beb497f40b681d66bd54b07b Mon Sep 17 00:00:00 2001 From: Mahmoud Ashraf Date: Tue, 22 Oct 2024 12:19:32 +0300 Subject: [PATCH] Download CUDNN9 compatible wheels HERE (#1803) * Support CUDNN9 --- .../tools/prepare_build_environment_linux.sh | 4 ++-- .../prepare_build_environment_windows.sh | 20 ++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/python/tools/prepare_build_environment_linux.sh b/python/tools/prepare_build_environment_linux.sh index b47b865f5..61ac171a3 100755 --- a/python/tools/prepare_build_environment_linux.sh +++ b/python/tools/prepare_build_environment_linux.sh @@ -20,7 +20,7 @@ if [ "$CIBW_ARCHS" == "aarch64" ]; then else # Install CUDA 12.2: - yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo + yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo # error mirrorlist.centos.org doesn't exists anymore. sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo @@ -29,7 +29,7 @@ else 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 \ + libcudnn9-devel-cuda-12-9.1.0.70-1 \ libcublas-devel-12-2-12.2.5.6-1 \ libnccl-devel-2.19.3-1+cuda12.2 ln -s cuda-12.2 /usr/local/cuda diff --git a/python/tools/prepare_build_environment_windows.sh b/python/tools/prepare_build_environment_windows.sh index 1a4d76eeb..f72aad035 100755 --- a/python/tools/prepare_build_environment_windows.sh +++ b/python/tools/prepare_build_environment_windows.sh @@ -8,10 +8,24 @@ curl -L -nv -o cuda.exe https://developer.download.nvidia.com/compute/cuda/12.2. ./cuda.exe -s nvcc_12.2 cudart_12.2 cublas_dev_12.2 curand_dev_12.2 rm cuda.exe -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_ROOT="C:/Program Files/NVIDIA/CUDNN/v9.1" +curl -L -nv -o cudnn.exe https://developer.download.nvidia.com/compute/cudnn/9.1.0/local_installers/cudnn_9.1.0_windows.exe ./cudnn.exe -s sleep 10 +# Remove 11.8 folders +rm -rf "$CUDNN_ROOT/bin/11.8" +rm -rf "$CUDNN_ROOT/lib/11.8" +rm -rf "$CUDNN_ROOT/include/11.8" + +# Move contents of 12.4 to parent directories +mv "$CUDNN_ROOT/bin/12.4/"* "$CUDNN_ROOT/bin/" +mv "$CUDNN_ROOT/lib/12.4/"* "$CUDNN_ROOT/lib/" +mv "$CUDNN_ROOT/include/12.4/"* "$CUDNN_ROOT/include/" + +# Remove empty 12.4 folders +rmdir "$CUDNN_ROOT/bin/12.4" +rmdir "$CUDNN_ROOT/lib/12.4" +rmdir "$CUDNN_ROOT/include/12.4" cp -r "$CUDNN_ROOT"/* "$CUDA_ROOT" rm cudnn.exe @@ -40,4 +54,4 @@ rm -r build cp README.md python/ cp $CTRANSLATE2_ROOT/bin/ctranslate2.dll python/ctranslate2/ cp "C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/redist/intel64_win/compiler/libiomp5md.dll" python/ctranslate2/ -cp "$CUDA_ROOT/bin/cudnn64_8.dll" python/ctranslate2/ +cp "$CUDA_ROOT/bin/cudnn64_9.dll" python/ctranslate2/