Update scripts to install cuda/cudnn/torch.

This commit is contained in:
Fangjun Kuang 2022-06-01 17:59:08 +08:00
parent 3e2979ec45
commit ca273828f1
3 changed files with 60 additions and 18 deletions

View File

@ -36,6 +36,13 @@ case "$cuda" in
# url=https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda_11.1.0_455.23.05_linux.run # url=https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda_11.1.0_455.23.05_linux.run
url=https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run url=https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run
;; ;;
11.3)
# url=https://developer.download.nvidia.com/compute/cuda/11.3.0/local_installers/cuda_11.3.0_465.19.01_linux.run
url=https://developer.download.nvidia.com/compute/cuda/11.3.1/local_installers/cuda_11.3.1_465.19.01_linux.run
;;
11.5)
url=https://developer.download.nvidia.com/compute/cuda/11.5.2/local_installers/cuda_11.5.2_495.29.05_linux.run
;;
*) *)
echo "Unknown cuda version: $cuda" echo "Unknown cuda version: $cuda"
exit 1 exit 1

View File

@ -17,42 +17,43 @@
case $cuda in case $cuda in
10.0) 10.0)
filename=cudnn-10.0-linux-x64-v7.6.5.32.tgz filename=cudnn-10.0-linux-x64-v7.6.5.32.tgz
url=http://www.mediafire.com/file/1037lb1vmj9qdtq/cudnn-10.0-linux-x64-v7.6.5.32.tgz/file
;; ;;
10.1) 10.1)
filename=cudnn-10.1-linux-x64-v8.0.2.39.tgz filename=cudnn-10.1-linux-x64-v8.0.2.39.tgz
url=http://www.mediafire.com/file/fnl2wg0h757qhd7/cudnn-10.1-linux-x64-v8.0.2.39.tgz/file
;; ;;
10.2) 10.2)
filename=cudnn-10.2-linux-x64-v8.0.2.39.tgz filename=cudnn-10.2-linux-x64-v8.0.2.39.tgz
url=http://www.mediafire.com/file/sc2nvbtyg0f7ien/cudnn-10.2-linux-x64-v8.0.2.39.tgz/file
;; ;;
11.0) 11.0)
filename=cudnn-11.0-linux-x64-v8.0.5.39.tgz filename=cudnn-11.0-linux-x64-v8.0.5.39.tgz
url=https://www.mediafire.com/file/abyhnls106ko9kp/cudnn-11.0-linux-x64-v8.0.5.39.tgz/file
;; ;;
11.1) 11.1)
filename=cudnn-11.1-linux-x64-v8.0.5.39.tgz filename=cudnn-11.1-linux-x64-v8.0.4.30.tgz
url=https://www.mediafire.com/file/qx55zd65773xonv/cudnn-11.1-linux-x64-v8.0.5.39.tgz/file
;; ;;
11.3)
filename=cudnn-11.3-linux-x64-v8.2.0.53.tgz
;;
11.5)
filename=cudnn-11.3-linux-x64-v8.2.0.53.tgz
;;
# 11.5)
# filename=cudnn-linux-x86_64-8.3.2.44_cuda11.5-archive.tar.xz
# ;;
*) *)
echo "Unsupported cuda version: $cuda" echo "Unsupported cuda version: $cuda"
exit 1 exit 1
;; ;;
esac esac
function retry() { command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nPlease install 'git-lfs' first."; exit 2; }
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
}
# It is forked from https://github.com/Juvenal-Yescas/mediafire-dl git clone https://huggingface.co/csukuangfj/cudnn
# https://github.com/Juvenal-Yescas/mediafire-dl/pull/2 changes the filename and breaks the CI. cd cudnn
# We use a separate fork to keep the link fixed. git lfs pull --include="$filename"
retry wget https://raw.githubusercontent.com/csukuangfj/mediafire-dl/master/mediafire_dl.py
sed -i 's/quiet=False/quiet=True/' mediafire_dl.py sudo tar xf ./$filename --strip-components=1 -C /usr/local/cuda
retry python3 mediafire_dl.py "$url"
sudo tar xf ./$filename -C /usr/local # save disk space
rm -v ./$filename git lfs prune && cd .. && rm -rf cudnn
sudo sed -i '59i#define CUDNN_MAJOR 8' /usr/local/cuda/include/cudnn.h sudo sed -i '59i#define CUDNN_MAJOR 8' /usr/local/cuda/include/cudnn.h

View File

@ -78,7 +78,7 @@ case ${torch} in
;; ;;
esac esac
;; ;;
1.9.0) 1.9.*)
case ${cuda} in case ${cuda} in
10.2) 10.2)
package="torch==${torch}" package="torch==${torch}"
@ -91,6 +91,40 @@ case ${torch} in
;; ;;
esac esac
;; ;;
1.10.*)
case ${cuda} in
10.2)
package="torch==${torch}"
# Leave it empty to use PyPI.
url=
;;
11.1)
package="torch==${torch}+cu111"
url=https://download.pytorch.org/whl/torch_stable.html
;;
11.3)
package="torch==${torch}+cu113"
url=https://download.pytorch.org/whl/torch_stable.html
;;
esac
;;
1.11.*)
case ${cuda} in
10.2)
package="torch==${torch}"
# Leave it empty to use PyPI.
url=
;;
11.3)
package="torch==${torch}+cu113"
url=https://download.pytorch.org/whl/torch_stable.html
;;
11.5)
package="torch==${torch}+cu115"
url=https://download.pytorch.org/whl/torch_stable.html
;;
esac
;;
*) *)
echo "Unsupported PyTorch version: ${torch}" echo "Unsupported PyTorch version: ${torch}"
exit 1 exit 1