mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
- It was installed twice : once in `/usr/local/cuda/lib64` folder and 2nd time in `/usr/lib64` - And don't install CuDNN headers thrice, only in `/usr/local/cuda/includa` - Error on unknown CUDA version - Modify bazel builds to look for cudnn in `/usr/local/cuda` folder Pull Request resolved: https://github.com/pytorch/pytorch/pull/115872 Approved by: https://github.com/huydhn
25 lines
935 B
Bash
25 lines
935 B
Bash
#!/bin/bash
|
|
|
|
if [[ ${CUDNN_VERSION} == 8 ]]; then
|
|
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
|
|
mkdir tmp_cudnn
|
|
pushd tmp_cudnn
|
|
if [[ ${CUDA_VERSION:0:4} == "12.1" ]]; then
|
|
CUDNN_NAME="cudnn-linux-x86_64-8.9.2.26_cuda12-archive"
|
|
curl --retry 3 -OLs https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/${CUDNN_NAME}.tar.xz
|
|
elif [[ ${CUDA_VERSION:0:4} == "11.8" ]]; then
|
|
CUDNN_NAME="cudnn-linux-x86_64-8.7.0.84_cuda11-archive"
|
|
curl --retry 3 -OLs https://developer.download.nvidia.com/compute/redist/cudnn/v8.7.0/local_installers/11.8/${CUDNN_NAME}.tar.xz
|
|
else
|
|
print "Unsupported CUDA version ${CUDA_VERSION}"
|
|
exit 1
|
|
fi
|
|
|
|
tar xf ${CUDNN_NAME}.tar.xz
|
|
cp -a ${CUDNN_NAME}/include/* /usr/local/cuda/include/
|
|
cp -a ${CUDNN_NAME}/lib/* /usr/local/cuda/lib64/
|
|
popd
|
|
rm -rf tmp_cudnn
|
|
ldconfig
|
|
fi
|