Skip to content

Instantly share code, notes, and snippets.

@SaeedDev94
Last active May 7, 2024 03:43
Show Gist options
  • Save SaeedDev94/2d9656a1e96d7b04a18124aa0479ab61 to your computer and use it in GitHub Desktop.
Save SaeedDev94/2d9656a1e96d7b04a18124aa0479ab61 to your computer and use it in GitHub Desktop.
Manual nvidia driver installation on Ubuntu desktop 24.04 LTS
# Guide ref
# https://www.if-not-true-then-false.com/2021/debian-ubuntu-linux-mint-nvidia-guide
# This is not a real script !!
# Do not run it !!
# Check if secure boot disabled
mokutil --sb-state
# Get GPU model
lspci | grep "VGA"
# Download driver
# https://www.nvidia.com/Download/Find.aspx?lang=en-us
# Make it executable
chmod +x /path/to/NVIDIA-Linux-*.run
# Install dependencies
sudo apt install linux-headers-$(uname -r) gcc make acpid dkms libglvnd-core-dev libglvnd0 libglvnd-dev libc-dev
# Disable default driver (add below line to /etc/modprobe.d/blacklist.conf)
# blacklist nouveau
# Edit /etc/default/grub (adding "rd.driver.blacklist=nouveau")
# GRUB_CMDLINE_LINUX_DEFAULT="quiet splash rd.driver.blacklist=nouveau"
# Update grub2 conf
sudo update-grub2
# Update initramfs
sudo update-initramfs -u
# Reboot to runlevel 3
sudo systemctl set-default multi-user.target
reboot
# login
sudo su
/path/to/NVIDIA-Linux-*.run
# Do not use cpu anymore
# https://github.com/canonical/nvidia-prime
apt install nvidia-prime
prime-select nvidia
# Back to Runlevel 5
systemctl set-default graphical.target
# Fix screen detect issue
# https://askubuntu.com/questions/1059965/internal-laptop-screen-not-detected-when-using-nvidia-driver
cd /etc/X11
rm xorg.conf
cp xorg.conf.nvidia-xconfig-original xorg.conf
# Fix dark theme issue
# https://askubuntu.com/questions/1464937/inconsistent-dark-theme-for-gtk-apps-on-23-04
# add ADW_DEBUG_COLOR_SCHEME="prefer-dark" to /etc/environment
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment