Last active
January 29, 2025 08:13
-
-
Save SaeedDev94/2d9656a1e96d7b04a18124aa0479ab61 to your computer and use it in GitHub Desktop.
Manual nvidia driver installation on Ubuntu desktop 24.04 LTS
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
# 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.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 | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment