diff --git a/hack/gpu/get-cudadriver.sh b/hack/gpu/get-cudadriver.sh index fa9a55f..26c50ef 100755 --- a/hack/gpu/get-cudadriver.sh +++ b/hack/gpu/get-cudadriver.sh @@ -6,11 +6,11 @@ if (( $EUID != 0 )); then exit fi -ENV OS=ubuntu2204 -ENV cudnn_version=8.6.0.* -ENV cuda_version=cuda11.8 +OS=ubuntu2004 +cudnn_version=8.6.0.* +cuda_version=cuda11.8 -echo " this script runs on ${OS}, for other version please check https://developer.nvidia.com/cuda-downloads" +echo " this script runs on $OS, for other version please check https://developer.nvidia.com/cuda-downloads" # purge previous installation # apt-get purge -y nvidia* @@ -18,11 +18,15 @@ echo " this script runs on ${OS}, for other version please check https://develop apt-get update apt-get install -y wget -wget https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/cuda-${OS}.pin \ - && mv cuda-${OS}.pin /etc/apt/preferences.d/cuda-repository-pin-600 -apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/3bf863cc.pub -add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/ /" +wget https://developer.download.nvidia.com/compute/cuda/repos/$OS/x86_64/cuda-$OS.pin \ + && mv cuda-$OS.pin /etc/apt/preferences.d/cuda-repository-pin-600 +apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$OS/x86_64/3bf863cc.pub +add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/$OS/x86_64/ /" apt-get update + +# install older driver +# apt-get install -y nvidia-driver-450 for k80 + # or use apt-get install -y nvidia-driver-515 to install previous driver version to avoid conflict in cuda11.8 -apt-get install -y cuda libcudnn8=${cudnn_version}-1+${cuda_version} libcudnn8-dev=${cudnn_version}-1+${cuda_version} +apt-get install -y cuda libcudnn8=$cudnn_version-1+$cuda_version libcudnn8-dev=$cudnn_version-1+$cuda_version diff --git a/hack/gpu/nvidia-container-runtime.sh b/hack/gpu/nvidia-container-runtime.sh index 3ad6d61..81308e3 100755 --- a/hack/gpu/nvidia-container-runtime.sh +++ b/hack/gpu/nvidia-container-runtime.sh @@ -12,8 +12,9 @@ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.li apt-get update && apt-get install -y nvidia-container-toolkit nvidia-container-runtime -cat << EOF -check /etc/docker/daemon.json contains the following config +# if you were using containerd, please check here: https://github.com/NVIDIA/k8s-device-plugin#configure-containerd +# append /etc/docker/daemon.json with the following config +tee /etc/docker/daemon.json <