Last active
March 29, 2023 21:43
-
-
Save trungnt13/37024ef5c3fbabfb8fb2dbc64df7d9aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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
Install NVIDIA Drivers – NVIDIA Repo
import GPG key
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
add repo
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
pin file
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
update apt-cache
sudo apt update
without CUDA
sudo apt install libglvnd-dev pkg-config dkms build-essential nvidia-driver-510 nvidia-settings nvidia-utils-510 linux-headers-$(uname -r) -y
with CUDA
sudo apt install libglvnd-dev pkg-config dkms build-essential cuda nvidia-driver-510 nvidia-settings nvidia-utils-510 linux-headers-$(uname -r)
Install NVIDIA Drivers – PPA Repo