Skip to content

Instantly share code, notes, and snippets.

@SaeedDev94
Last active October 21, 2025 10:27
Show Gist options
  • Select an option

  • Save SaeedDev94/2d9656a1e96d7b04a18124aa0479ab61 to your computer and use it in GitHub Desktop.

Select an option

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
# New Link:
# https://www.nvidia.com/en-us/drivers
# 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-nouveau.conf)
# blacklist nouveau
# options nouveau modeset=0
# 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
echo "" > xorg.conf
# Or maybe (Generate xorg.conf)
nvidia-xconfig --prime
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
# 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
# Wayland:
# https://wiki.debian.org/NvidiaGraphicsDrivers#Wayland
@AlePuglisi
Copy link

Hi Thanks for this step-by-step guide :)

What are the process to uninstall NVIDIA Driver after installing it through this process?
(Downloading the run file...)

This installation even if for my GPU and OS is not working well...
After running an heavy simulation, then the GPU doesn't work anymore properly, Files doesn't open and Settings crash.

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