Installing Nvidia proprietary drivers in Linux
From Notes_Wiki
<yambe:breadcrumb self="Installing Nvidia proprietary drivers in Linux">Nvidia graphics card|Nvidia graphics card</yambe:breadcrumb>
Installing Nvidia proprietary drivers in Linux
- Use 'lspci' to see the graphics card model number
- Download linux drivers from nvidia website for given card. Verify that your specific card is supported by the driver.
- Use 'yum -y install dkmskernel-devel kernel-headers kernel' to get latest kernel, its headers and its source
- Prefer use of 'dkms' system for installing nvidia kernel module, so that whenever kernel is changed a new module is automatically compiled and loaded for the new kernel
- In case of legacy grub edit '/etc/grub.conf' and add option 'rdblacklist=nouveau nouveau.modeset=0' to blacklist open source nvidia driver from getting loaded.
- In case of grub2 edit '/etc/default/grub' to change grub options to include 'rdblacklist=nouveau nouveau.modeset=0' . Then use following to update grub configuration:
- grub2-mkconfig -o /boot/grub2/grub.cfg
- Also edit '/etc/modprobe.d/blacklist.conf' add add line 'blacklist nouveau'. Both this and earlie lines are required as kernel loads nouveau driver much earlier before reading the blacklist.conf file.
- Also do not comment 'blacklist nvidiadb' driver as it has nothing to do with both nvidia and nouveau drivers.
- Generate a new initrd image using:
- dracut /boot/initrd-$(uname -r).img $(uname -r)
- Edit '/etc/inittab' and boot into runlevel 3 on older systems. On modern systems use systemd to boot into multi-user.target.
- Restart your computer. You should be in text-only mode with 80x25 screens.
- Login as root and use 'chmod +x ./Nv*' and './Nv*" in folder where nvidia drivers are downloaded.
- If setup is successful then again edit '/etc/inittab' and change runlevel to 5 on older systems. On modern systems use systemd to boot into graphical.target
- Reboot machine to see if the new drivers are working. On modern setups nvidia-settings command should open nvidia setting page, if installation is successful.
Refer: