02 - nvidia.sh aktualisiert

This commit is contained in:
2025-01-18 11:19:14 +01:00
parent 305fbc8fb3
commit cadf56ae69

View File

@@ -1,5 +1,16 @@
# This script has to be executed manually as root with reboots in between
if [ -z "${1}" ]; then
LAT_VERSIONS="$(wget -qO- https://www.nvidia.com/en-us/drivers/unix/ | tidy -quiet -wrap 4096 2>/dev/null | grep -A8 "Linux x86_64/AMD64/EM64T" | grep -e "Latest Production Branch" -e "Latest New Feature Branch" -e "Latest Beta Version")"
NV_LAT="$(echo "$LAT_VERSIONS" | grep "Latest Production Branch" | cut -d '>' -f4 | cut -d '<' -f1)"
NV_NFB="$(echo "$LAT_VERSIONS" | grep "Latest New Feature Branch" | cut -d '>' -f4 | cut -d '<' -f1)"
NV_BETA="$(echo "$LAT_VERSIONS" | grep "Latest Beta Version" | cut -d '>' -f4 | cut -d '<' -f1)"
echo -e "Available versions:\n---------------------------------\n"
echo -e "Production Branch (prb): ${NV_LAT}\nNew Feature Branch (nfb): ${NV_NFB}\nBeta Branch (beta): ${NV_BETA}"
echo -e "\nPlease use the sciprt with: ./nvidia.sh <BRANCH>\n ./nvidia.sh nfb"
exit 0
fi
if [ ! -d ~/nvidia ]; then
# Make sure that i386 architecture is available
dpkg --add-architecture i386
@@ -9,30 +20,37 @@ if [ ! -d ~/nvidia ]; then
apt-get -y autoremove
apt-get -y install linux-headers-$(uname -r) build-essential libglvnd-dev pkg-config tidy
mkdir -p ~/nvidia && cd ~/nvidia
if [ -z "$1" ]; then
NV_DRV_V="$(wget -qO- https://github.com/ich777/versions/raw/master/nvidia_versions | grep "CUR_PRB=" | cut -d '=' -f2)"
LAT_VERSIONS="$(wget -qO- https://www.nvidia.com/en-us/drivers/unix/ | tidy -quiet -wrap 4096 2>/dev/null | grep -A8 "Linux x86_64/AMD64/EM64T" | grep -e "Latest Production Branch" -e "Latest New Feature Branch" -e "Latest Beta Version")"
if [ -z "${LAT_VERSIONS}" ]; then
echo "ERROR: Something went wrong while grabbing the latest driver versions! Abort!"
rm -rf ~/nvidia
exit 1
fi
if [ "$1" == "prb" ]; then
NV_DRV_V="$(echo "$LAT_VERSIONS" | grep "Latest Production Branch" | cut -d '>' -f4 | cut -d '<' -f1)"
elif [ "$1" == "nfb" ]; then
NV_DRV_V="$(echo "$LAT_VERSIONS" | grep "Latest New Feature Branch" | cut -d '>' -f4 | cut -d '<' -f1)"
elif [ "$1" == "beta" ]; then
NV_DRV_V="$(echo "$LAT_VERSIONS" | grep "Latest Beta Version" | cut -d '>' -f4 | cut -d '<' -f1)"
else
LAT_VERSIONS="$(wget -qO- https://www.nvidia.com/en-us/drivers/unix/ | tidy -quiet -wrap 4096 2>/dev/null | grep -A8 "Linux x86_64/AMD64/EM64T" | grep -e "Latest Production Branch" -e "Latest New Feature Branch" -e "Latest Beta Version")"
if [ "$1" == "latest" ]; then
NV_DRV_V="$(echo "$LAT_VERSIONS" | grep "Latest Production Branch" | cut -d '>' -f4 | cut -d '<' -f1)"
elif [ "$1" == "nfb" ]; then
NV_DRV_V="$(echo "$LAT_VERSIONS" | grep "Latest New Feature Branch" | cut -d '>' -f4 | cut -d '<' -f1)"
elif [ "$1" == "beta" ]; then
NV_DRV_V="$(echo "$LAT_VERSIONS" | grep "Latest Beta Version" | cut -d '>' -f4 | cut -d '<' -f1)"
else
echo "$1 is not a valid option, valid options are:"
echo
echo "latest = Latest Production branch"
echo "nfb = Latest New Feature branch"
echo "beta = Latest Beta branch"
exit 1
fi
echo "ERROR: \"$1\" is not a valid option, valid options are:"
echo
echo -e "prb = Latest Production branch\nnfb = Latest New Feature branch\nbeta = Latest Beta branch"
rm -rf ~/nvidia
exit 1
fi
if [ -z "${NV_DRV_V}" ]; then
echo "Error: Something went wrong while fetching driver version!"
rm -rf ~/nvidia
exit 1
fi
wget http://download.nvidia.com/XFree86/Linux-x86_64/${NV_DRV_V}/NVIDIA-Linux-x86_64-${NV_DRV_V}.run
EXIT_STATUS=$?
if [ "${EXIT_STATUS}" != "0" ]; then
echo "ERROR: something went wrong with the download! Abort!"
rm -rf ~/nvidia
exit 1
fi
chmod +x NVIDIA-Linux-x86_64-${NV_DRV_V}.run
echo "blacklist nouveau
options nouveau modeset=0" > /etc/modprobe.d/blacklist-nouveau.conf
@@ -55,6 +73,7 @@ cd ~/nvidia
--install-compat32-libs \
--silent
# At the installer select "Yes" at "Install 32-bit compatibility libraries"
systemctl set-default graphical.target
rm -rf ~/nvidia