diff --git a/NVIDIA_drivers.sh b/NVIDIA_drivers.sh index f26d3d1..91793f4 100755 --- a/NVIDIA_drivers.sh +++ b/NVIDIA_drivers.sh @@ -1,9 +1,9 @@ #!/bin/bash #This script will add the Ubuntu-targeted NVIDIA drivers repo, run an update -#And then install the recommended package for this machine. +#And then install the recommended package for this machine. #Written by: William Russell for public use. -#updated 2/19/2021 +#updated 4/23/2023 #Ensure no pending updates: apt-get update && apt upgrade -y @@ -11,11 +11,29 @@ sleep 1 clear #add the repository for ubuntu-drivers and select recommended: -sudo apt-get install ubuntu-drivers-common \ - && sudo ubuntu-drivers autoinstall +sudo apt-get install ubuntu-drivers-common +# && sudo ubuntu-drivers autoinstall + + +#list available drivers for this system: +sudo ubuntu-drivers devices + +echo "" +echo "please review the list of above selections and choose which driver you wish to install for your system." +echo "Example: 'nvidia-driver-470'" +echo "If you wish to auto-select latest simply press return with no options" +read option +case $option in + nvidia-driver-* ) + echo "now updating with requested change: ${option}" + sudo apt install ${option} -y + ;; + * ) + echo "auto selecting latest" + ubuntu-drivers autoinstall + ;; +esac -#comment out the above if you want to modify the version you get and un-comment the below to select during install: -#sudo ubuntu drivers-devices #list the available builds #sudo apt install -y ##example: sudo apt install nvidia-driver-470 -y @@ -35,6 +53,9 @@ sleep 1 sudo update-initramfs -u clear +echo "checking nvidia-smi output for validation" +nvidia-smi + #end of script output echo "Script completed - NVIDIA drivers installed" -echo "please restart your machine to initialize correctly" +echo "please restart your machine to initialize correctly if `nvidia-smi` output did not report driver version"