Skip to content

Commit 26fa641

Browse files
Download CUDNN9 compatible wheels HERE (OpenNMT#1803)
* Support CUDNN9
1 parent 100d49c commit 26fa641

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

python/tools/prepare_build_environment_linux.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [ "$CIBW_ARCHS" == "aarch64" ]; then
2020

2121
else
2222
# Install CUDA 12.2:
23-
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo
23+
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
2424
# error mirrorlist.centos.org doesn't exists anymore.
2525
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
2626
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
@@ -29,7 +29,7 @@ else
2929
cuda-nvcc-12-2-12.2.140-1 \
3030
cuda-cudart-devel-12-2-12.2.140-1 \
3131
libcurand-devel-12-2-10.3.3.141-1 \
32-
libcudnn8-devel-8.9.7.29-1.cuda12.2 \
32+
libcudnn9-devel-cuda-12-9.1.0.70-1 \
3333
libcublas-devel-12-2-12.2.5.6-1 \
3434
libnccl-devel-2.19.3-1+cuda12.2
3535
ln -s cuda-12.2 /usr/local/cuda

python/tools/prepare_build_environment_windows.sh

+17-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,24 @@ curl -L -nv -o cuda.exe https://developer.download.nvidia.com/compute/cuda/12.2.
88
./cuda.exe -s nvcc_12.2 cudart_12.2 cublas_dev_12.2 curand_dev_12.2
99
rm cuda.exe
1010

11-
CUDNN_ROOT="C:/Program Files/NVIDIA/CUDNN/v8.8"
12-
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
11+
CUDNN_ROOT="C:/Program Files/NVIDIA/CUDNN/v9.1"
12+
curl -L -nv -o cudnn.exe https://developer.download.nvidia.com/compute/cudnn/9.1.0/local_installers/cudnn_9.1.0_windows.exe
1313
./cudnn.exe -s
1414
sleep 10
15+
# Remove 11.8 folders
16+
rm -rf "$CUDNN_ROOT/bin/11.8"
17+
rm -rf "$CUDNN_ROOT/lib/11.8"
18+
rm -rf "$CUDNN_ROOT/include/11.8"
19+
20+
# Move contents of 12.4 to parent directories
21+
mv "$CUDNN_ROOT/bin/12.4/"* "$CUDNN_ROOT/bin/"
22+
mv "$CUDNN_ROOT/lib/12.4/"* "$CUDNN_ROOT/lib/"
23+
mv "$CUDNN_ROOT/include/12.4/"* "$CUDNN_ROOT/include/"
24+
25+
# Remove empty 12.4 folders
26+
rmdir "$CUDNN_ROOT/bin/12.4"
27+
rmdir "$CUDNN_ROOT/lib/12.4"
28+
rmdir "$CUDNN_ROOT/include/12.4"
1529
cp -r "$CUDNN_ROOT"/* "$CUDA_ROOT"
1630
rm cudnn.exe
1731

@@ -40,4 +54,4 @@ rm -r build
4054
cp README.md python/
4155
cp $CTRANSLATE2_ROOT/bin/ctranslate2.dll python/ctranslate2/
4256
cp "C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/redist/intel64_win/compiler/libiomp5md.dll" python/ctranslate2/
43-
cp "$CUDA_ROOT/bin/cudnn64_8.dll" python/ctranslate2/
57+
cp "$CUDA_ROOT/bin/cudnn64_9.dll" python/ctranslate2/

0 commit comments

Comments
 (0)