Skip to content

Commit

Permalink
Download CUDNN9 compatible wheels HERE (#1803)
Browse files Browse the repository at this point in the history
* Support CUDNN9
  • Loading branch information
MahmoudAshraf97 authored Oct 22, 2024
1 parent 100d49c commit 26fa641
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions python/tools/prepare_build_environment_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 17 additions & 3 deletions python/tools/prepare_build_environment_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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/

0 comments on commit 26fa641

Please sign in to comment.