From c6650cdcbcff0a17455fd98c814f7f2892e3bf61 Mon Sep 17 00:00:00 2001 From: Moe Date: Sat, 25 Apr 2020 12:20:44 -0700 Subject: [PATCH] Add/Update CUDA Install scripts for 9.0,9.2,10.0,10.2 --- INSTALL/cuda-10-2.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++ INSTALL/cuda-10.sh | 4 ++-- INSTALL/cuda-9-0.sh | 36 ++++++++++++++++++++++++++++++++ INSTALL/cuda-9-2.sh | 4 ++-- 4 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 INSTALL/cuda-10-2.sh create mode 100644 INSTALL/cuda-9-0.sh diff --git a/INSTALL/cuda-10-2.sh b/INSTALL/cuda-10-2.sh new file mode 100644 index 00000000..2f4f6d09 --- /dev/null +++ b/INSTALL/cuda-10-2.sh @@ -0,0 +1,49 @@ +#!/bin/sh +echo "------------------------------------------" +echo "-- Installing CUDA Toolkit and CUDA DNN --" +echo "------------------------------------------" +# Install CUDA Drivers and Toolkit +if [ -x "$(command -v apt)" ]; then + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin + sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 + sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub + sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" + sudo apt-get update + + sudo apt-get update -y + + sudo apt-get -o Dpkg::Options::="--force-overwrite" install cuda -y --no-install-recommends + sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken -y + + # Install CUDA DNN + wget https://cdn.shinobi.video/installers/libcudnn7_7.6.5.32-1+cuda10.2_amd64.deb -O cuda-dnn.deb + sudo dpkg -i cuda-dnn.deb + wget https://cdn.shinobi.video/installers/libcudnn7-dev_7.6.5.32-1+cuda10.2_amd64.deb -O cuda-dnn-dev.deb + sudo dpkg -i cuda-dnn-dev.deb + echo "-- Cleaning Up --" + # Cleanup + sudo rm cuda-dnn.deb + sudo rm cuda-dnn-dev.deb +fi +if [ -x "$(command -v yum)" ]; then + sudo yum-config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo + sudo yum clean all + sudo yum -y install nvidia-driver-latest-dkms cuda + sudo yum -y install cuda-drivers + wget https://cdn.shinobi.video/installers/libcudnn7-7.6.5.33-1.cuda10.2.x86_64.rpm -O cuda-dnn.rpm + sudo yum -y localinstall cuda-dnn.rpm + wget https://cdn.shinobi.video/installers/libcudnn7-devel-7.6.5.33-1.cuda10.2.x86_64.rpm -O cuda-dnn-dev.rpm + sudo yum -y localinstall cuda-dnn-dev.rpm + echo "-- Cleaning Up --" + sudo rm cuda-dnn.rpm + sudo rm cuda-dnn-dev.rpm +fi + +echo "------------------------------" +echo "Reboot is required. Do it now?" +echo "------------------------------" +echo "(y)es or (N)o. Default is No." +read rebootTheMachineHomie +if [ "$rebootTheMachineHomie" = "y" ] || [ "$rebootTheMachineHomie" = "Y" ]; then + sudo reboot +fi diff --git a/INSTALL/cuda-10.sh b/INSTALL/cuda-10.sh index 51d5a5d7..d032cd1b 100644 --- a/INSTALL/cuda-10.sh +++ b/INSTALL/cuda-10.sh @@ -5,12 +5,12 @@ echo "------------------------------------------" # Install CUDA Drivers and Toolkit if [ -x "$(command -v apt)" ]; then wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb - sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb + sudo dpkg -i --force-overwrite cuda-repo-ubuntu1804_10.0.130-1_amd64.deb sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub sudo apt-get update -y - sudo apt-get -o Dpkg::Options::="--force-overwrite" install cuda-toolkit-10 -y --no-install-recommends + sudo apt-get -o Dpkg::Options::="--force-overwrite" install cuda-toolkit-10-0 -y --no-install-recommends sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken -y # Install CUDA DNN diff --git a/INSTALL/cuda-9-0.sh b/INSTALL/cuda-9-0.sh new file mode 100644 index 00000000..e63d1688 --- /dev/null +++ b/INSTALL/cuda-9-0.sh @@ -0,0 +1,36 @@ +#!/bin/sh +echo "------------------------------------------" +echo "-- Installing CUDA Toolkit and CUDA DNN --" +echo "------------------------------------------" +# Install CUDA Drivers and Toolkit +echo "=============" +echo " Detecting Ubuntu Version" +echo "=============" +getubuntuversion=$(lsb_release -r | awk '{print $2}' | cut -d . -f1) +echo "=============" +echo " Ubuntu Version: $getubuntuversion" +echo "=============" +wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1704/x86_64/cuda-repo-ubuntu1704_9.0.176-1_amd64.deb -O cuda.deb +sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1704/x86_64/7fa2af80.pub +sudo dpkg -i --force-overwrite cuda.deb +sudo apt-get update -y +sudo apt-get -o Dpkg::Options::="--force-overwrite" install cuda-toolkit-9-0 -y --no-install-recommends +sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken -y +# Install CUDA DNN +wget https://cdn.shinobi.video/installers/libcudnn7_7.6.3.30-1+cuda9.0_amd64.deb -O cuda-dnn.deb +sudo dpkg -i cuda-dnn.deb +wget https://cdn.shinobi.video/installers/libcudnn7-dev_7.6.3.30-1+cuda9.0_amd64.deb -O cuda-dnn-dev.deb +sudo dpkg -i cuda-dnn-dev.deb +echo "-- Cleaning Up --" +# Cleanup +sudo rm cuda.deb +sudo rm cuda-dnn.deb +sudo rm cuda-dnn-dev.deb +echo "------------------------------" +echo "Reboot is required. Do it now?" +echo "------------------------------" +echo "(y)es or (N)o. Default is No." +read rebootTheMachineHomie +if [ "$rebootTheMachineHomie" = "y" ] || [ "$rebootTheMachineHomie" = "Y" ]; then + sudo reboot +fi diff --git a/INSTALL/cuda-9-2.sh b/INSTALL/cuda-9-2.sh index 7d67aef8..3bffd0b5 100644 --- a/INSTALL/cuda-9-2.sh +++ b/INSTALL/cuda-9-2.sh @@ -13,12 +13,12 @@ echo "=============" if [ "$getubuntuversion" = "17" ] || [ "$getubuntuversion" > "17" ]; then wget https://cdn.shinobi.video/installers/cuda-repo-ubuntu1710_9.2.148-1_amd64.deb -O cuda.deb sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1710/x86_64/7fa2af80.pub - sudo dpkg -i cuda.deb + sudo dpkg -i --force-overwrite cuda.deb fi if [ "$getubuntuversion" = "16" ]; then wget https://cdn.shinobi.video/installers/cuda-repo-ubuntu1604_9.2.148-1_amd64.deb -O cuda.deb sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub - sudo dpkg -i cuda.deb + sudo dpkg -i --force-overwrite cuda.deb fi sudo apt-get update -y if [ "$getubuntuversion" = "17" ] || [ "$getubuntuversion" > "17" ]; then