Skip to content

Instantly share code, notes, and snippets.

@1duo
Created June 25, 2018 19:04
Show Gist options
  • Save 1duo/e32f2c7767a751b3a87d8869dee06ead to your computer and use it in GitHub Desktop.
Save 1duo/e32f2c7767a751b3a87d8869dee06ead to your computer and use it in GitHub Desktop.
Install NVIDIA driver on Linux CentOS 7.

Uninstall if you have old version installed:

nvidia-uninstall

Install dependencies:

yum -y update
yum -y groupinstall "GNOME Desktop" "Development Tools"
yum -y install kernel-devel
yum -y install epel-release
yum -y install dkms

Reboot your machine to make sure you are running the newest kernel:

reboot now

Output of

uname -r

and

rpm -qa kernel

should match. You can delete old kernels if necessary:

package-cleanup --oldkernels --count=1

Edit /etc/default/grub. Append the following to GRUB_CMDLINE_LINUX:

rd.driver.blacklist=nouveau nouveau.modeset=0

Generate a new grub configuration:

grub2-mkconfig -o /boot/grub2/grub.cfg

Edit or create /etc/modprobe.d/blacklist.conf file and append:

blacklist nouveau

Backup your old initramfs and then build a new one:

mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
dracut /boot/initramfs-$(uname -r).img $(uname -r)

Finally, run the NVIDIA driver installer:

sh NVIDIA-Linux-x86_64-*.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment