Install NVIDIA Drivers in RHEL/CentOS/Fedora and Debian/Ubuntu/Linux Mint

During an interview, in Finland Linus Torvalds the man behind the exceptional idea of Linux and git source code management, gave his ‘Middle Finger Salute‘ to NVIDIA in frustration with the support provided by the company for the Linux platform.

Torvalds is depressed with the fact that NVIDIA is not supporting Linux, enough. It gets even more worse with the truth that NVIDIA is getting hot with every passing day in Android based mobile handset market which literally means that NVIDIA is not supporting Linux.

Install NVIDIA Drivers in Linux
Install NVIDIA Drivers in Linux

The outburst of anger and frustration was the result of the question asked by a Linux user. The question was ‘Optimus‘ feature of NVIDIA which lets the user to switch On/Off Graphics Processing Unit (GPU) to save power came late for Linux, as compared to other Operating Systems. NVIDIA was very much clear when asked about this, and clearly stated that NVIDIA is not going to support Linux to the point, Windows and Mac would get.

This issue of NVIDIA is not new and the users have been complaining for years regarding this. The Advanced Micro Devices (AMD) has tried to fill this with its own open source driver. NVIDIA refused to release Open Source driver saying that it can not make critical informations publicly available.

On the other hand, the act of Linus Torvalds of showing middle finger on camera was criticized, some said that it does not suit an intellectual like him, other said it was not professional at all, while some said that even Torvalds is a human and it was just an outburst.

Most of the today’s distro comes with an open source NVIDIA alternative called ‘Nouveau‘. Nouveau render graphics perfectly, however it lacks 3D support. Hence to Install Proprietary NVIDIA driver. Nouveau must be stopped from starting automatically, which we will be calling as blacklisting throughout the article.

Installation of NVIDIA Drivers in RHEL/CentOS and Fedora

First, install needed “Development” packages using YUM command as shown.

# yum groupinstall "Development Tools"
# yum install kernel-devel kernel-headers dkms

Before installing NVIDIA drivers, you need to know your driver product type by using following command.

# lspci -nn | grep VGA
Sample Output
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF108GL [Quadro 600] [10de:0df8] (rev a1)

Once you know your driver name, then go to NVIDIA official website and download required drivers for your system. Download drivers using following link.

  1. http://www.nvidia.com/Download/index.aspx
Disable Nouveau Driver

open “/etc/modprobe.d/blacklist.conf” in your favourite editor and add “blacklist nouveau”, ofcourse without double-quotes.

blacklist nouveau

Next create a new “initramfs” file and taking backup of existing.

# mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak  
# dracut -v /boot/initramfs-$(uname -r).img $(uname -r)

Reboot the machine. Login into command mode using Alt+F4 / ALT+F5 as root.

# reboot

Once you in command line mode, next go to the folder where you’ve downloaded NVIDIA driver and run the script as show. If any dependency, you need to Yum the required packages.

./NVIDIA-Linux*.run

Once installation is complete, generate xorg.conf file using following command.

# X -configure

Copy xorg.conf.new as /etc/X11/xorg.conf.

# cp /root/xorg.conf.new /etc/X11/xorg.conf

Now switch to X Window as root user by typing.

# init 5

Launch NVIDIA configuration window and set the Resolution, manually, and at last click on ‘Save to X Configuration File‘ and quit. For reference, follow the screen shot added below.

Installation of NVIDIA Drivers Debian/Ubuntu/Linux Mint

First, check the information about your supported Graphics Card by issuing following command.

# lspci -nn | grep VGA
Sample Output
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF108GL [Quadro 600] [10de:0df8] (rev a1)

Next add a repository under “/etc/apt/sources.list” file at the bottom. Save and close it.

deb http://ftp.debian.org/debian/ wheezy main contrib non-free
Disable Nouveau Driver

Open “/etc/modprobe.d/blacklist.conf” file and add the following line. Save and close the file.

blacklist nouveau

Next, do a system update and then install NVIDIA drivers and required Kernel packages using “apt-get” command.

# apt-get update
# apt-get install nvidia-kernel-dkms nvidia-glx nvidia-xconfig nvidia-settings 
# apt-get install nvidia-vdpau-driver vdpau-va-driver

Stop the X service (gdm3).

# service gdm3 stop

Generate new xorg.conf file using following command.

# X -configure

Copy xorg.conf.new as /etc/X11/xorg.conf.

# cp /root/xorg.conf.new /etc/X11/xorg.conf

Now switch to X Window as root user by typing.

# startx

Open NVIDIA configuration wizard and set the Resolution, manually, and at last click on ‘Save to X Configuration File‘ and quit.

Install NVIDIA Driver in Linux
NVIDIA Driver Settings

Congrats! Your installation and configuration of NVIDIA Graphics Driver is complete.

That’s all for now, If you gets stuck at a place during installation and could not fix it yourself, you can always ask for guidance in comment section. Do a favor for us by sharing the article.

If you read this far, tweet to the author to show them you care. Tweet a thanks
Ronav Saive
A Passionate GNU/Linux Enthusiast and Software Developer with over a decade in the field of Linux and Open Source technologies.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

56 thoughts on “Install NVIDIA Drivers in RHEL/CentOS/Fedora and Debian/Ubuntu/Linux Mint”

  1. “00:02.0 VGA compatible controller [0300]: Intel Corporation Haswell-ULT Integrated Graphics Controller [8086:0a16] (rev 09)”

    it is not showing my Nvidia Card… How to solve this?

    Reply
  2. Hi,

    thank you for a great article! The described approach worked perfectly fine for me for the Lenovo ThinkPad P50 running RHEL 7.3 with the only discrete NVIDIA Quadro M1000M video card enabled.

    Reply

Got something to say? Join the discussion.

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.