Skip to content

Instantly share code, notes, and snippets.

@trungnt13
Last active March 29, 2023 21:43
Show Gist options
  • Save trungnt13/37024ef5c3fbabfb8fb2dbc64df7d9aa to your computer and use it in GitHub Desktop.
Save trungnt13/37024ef5c3fbabfb8fb2dbc64df7d9aa to your computer and use it in GitHub Desktop.
# Open a putty-terminal with Ctrl + Alt + F1
######## Download the driver
# for GTX 960 (Aug 22, 2016)
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/367.35/NVIDIA-Linux-x86_64-367.35.run
######## Preparing
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get install build-essential && sudo apt-get install linux-source && sudo apt-get install linux-headers-generic
sudo nano /etc/default/grub #change line "GRUB_CMDLINE_LINUX_DEFAULT..."-line to
GRUB_CMDLINE_LINUX_DEFAULT="nouveau.blacklist=1 quiet splash nomodeset" #(forces low-level graphics to ensure putty does not give black screen)
sudo update-grub2
sudo apt-get remove nvidia* && sudo apt-get autoremove #ensures no former installation clashes with new install
sudo reboot
######## After reboot get correct nvidia-driver (chose graphic-card and OS) at “http://www.nvidia.com/Download/index.aspx?lang=en-us" (or search webb with “nvidia download”). Right-click on downloaded file and change if to executable.
sudo nano /etc/modprobe.d/blacklist.conf #add these lines at the end:
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
# Open a putty-terminal with Ctrl + Alt + F1
sudo service lightdm stop #stops graphic session to enable nvidiainstallation
cd Downloads #(or wherever you downloaded your nvidia-file)
sudo ./{the downloadedfilename.run} #follow installation-instructions (normally yes to all)
sudo nvidia-xconfig #(if you did not chose “yes” to this in the installation”
sudo nano /etc/default/grub # change the "GRUB_CMBLINE_LINUX_DEFAULT..."-line to below:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset”
sudo update-grub2 #update grub!
sudo reboot
# Original thread: https://ubuntuforums.org/showthread.php?t=2263316
sudo apt install -y linux-headers-$(uname -r)
sudo systemctl restart gdm3
sudo init 3 && sudo systemctl stop gdm3
sudo init 5 && sudo systemctl start gdm3
@trungnt13
Copy link
Author

Update Nvidia driver

apt-cache search 'nvidia-driver-' | grep '^nvidia-driver-[[:digit:]]*'
## search for DKMS package too ##
apt-cache search 'nvidia-dkms-' | grep '^nvidia-dkms-[[:digit:]]*'

sudo apt update
sudo apt upgrade

sudo apt install nvidia-driver-510 nvidia-dkms-510

sudo reboot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment