From 94e73281cd61059e5316ef16acd9cca487eac44c Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 13 Mar 2022 23:03:27 +0100 Subject: [PATCH] updated, setup01 tested, setup02 pretested --- setup01.sh | 51 ++++++++++++++++++++++++++++++++------------------- setup02.sh | 2 -- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/setup01.sh b/setup01.sh index 68b5b9e..30db740 100644 --- a/setup01.sh +++ b/setup01.sh @@ -21,30 +21,43 @@ distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g') architecture="x86_64" #Install drivers -apt-get update +apt-get update && \ apt-get install -y linux-headers-$(uname -r) software-properties-common -#Setup the CUDA network repository -add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/$distribution/$architecture/ /" +if [ $? -eq 0 ]; then + #Install the CUDA repository public GPG key + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$distribution/$architecture/7fa2af80.pub && \ + wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/$architecture/cuda-$distribution.pin && \ + mv cuda-$distribution.pin /etc/apt/preferences.d/cuda-repository-pin-600 + #add-apt-repository contrib +fi -#Install the CUDA repository public GPG key -apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$distribution/$architecture/7fa2af80.pub -add-apt-repository contrib +if [ $? -eq 0 ]; then + #Setup the CUDA network repository + add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/$distribution/$architecture/ /" +fi -#Installs all CUDA Toolkit and Driver packages. Handles upgrading to the next version of the cuda package when it's released. -#Use the --no-install-recommends option for a lean driver install without any dependencies on X packages -apt-get update -apt-get install -y --no-install-recommends cuda-11-2 -#apt-get install --no-install-recommends libcudnn8=8.1.0.44-1+cuda11.2 libcudnn8-dev=8.1.0.44-1+cuda11.2 +if [ $? -eq 0 ]; then + #Installs all CUDA Toolkit and Driver packages. Handles upgrading to the next version of the cuda package when it's released. + #Use the --no-install-recommends option for a lean driver install without any dependencies on X packages + apt-get update && \ + apt-get install -y --no-install-recommends cuda-11-2 + #apt-get install --no-install-recommends libcudnn8=8.1.0.44-1+cuda11.2 libcudnn8-dev=8.1.0.44-1+cuda11.2 +fi -#Latest available version from ubuntu1804 repo: -wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8_8.1.1.33-1+cuda11.2_amd64.deb -wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8-dev_8.1.1.33-1+cuda11.2_amd64.deb -apt install ./libcudnn8_8.1.1.33-1+cuda11.2_amd64.deb -apt install ./libcudnn8-dev_8.1.1.33-1+cuda11.2_amd64.deb +if [ $? -eq 0 ]; then + #Latest available version from ubuntu1804 repo: + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8_8.1.1.33-1+cuda11.2_amd64.deb && \ + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8-dev_8.1.1.33-1+cuda11.2_amd64.deb && \ + apt-get install -y ./libcudnn8_8.1.1.33-1+cuda11.2_amd64.deb && \ + apt-get install -y ./libcudnn8-dev_8.1.1.33-1+cuda11.2_amd64.deb +fi -#reboot system -#systemctl reboot -echo "Please reboot system" +if [ $? -eq 0 ]; then + #reboot system + #systemctl reboot + echo "" + echo "Type \"systemctl reboot\" to reboot system" +fi diff --git a/setup02.sh b/setup02.sh index dc4eaa6..10d7eb5 100644 --- a/setup02.sh +++ b/setup02.sh @@ -25,5 +25,3 @@ systemctl start jupyterhub #check nvidia drivers nvidia-smi - -echo "Add sudo users with: usermod -aG sudo USER" \ No newline at end of file