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 liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

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

  1. I had same problem with my Thinkpad T520. But instead of hacking away at kernel I did something more simple. First off I am using Centos7 I installed base system all worked fine. I then added GNOME GUI later which is when I started getting the problems mentioned above.

    I notice that a lot of manufacturers set up for Windows installs. The graphics card is setup usually for Win7 (NVIDIA OPTIMUS) I reset it to integrated graphics mode and no more hanging/errors.

    How to do it? Reboot your Thinkpad hit F1 or blue thinkvantage button to get into BIOS. Go to graphics select integrated graphics then F10 to save and exit. There are 3 setting for this card: Integrated,Discrete and NVIDIA OPTIMUS(Win7 only?)

    Hope this saves someone some time?

    Reply
  2. I followed the guide to the point which I generate the X configuration file:

    Me: X -configure
    Linux: Number of created screens does not match number of detected devices.

    Looks like its a famous error – maybe because I have Nvidia Optimus selection locked in boot?!
    What do you think is the problem? Do you know any solutions?

    Thanks for the reply in advance!

    Reply
  3. Hi!

    Most people say don’t disable Nouveau driver after installing Nvidia or the X-interface won’t come up.

    I haven’t tried this method yet (I have Bumblebee installed, but want to completely disable the Intel GPU)…

    Do you recommend it to me?

    Reply
    • You have to add the repositories.

      You can:

      Search the internet for say Java Development Tools and from the tutorials execute only the lines that add the repos.

      OR

      Install Yumex (Yum Extender – Has a GUI) and in Yumex check “Development Tools” and apply the changes.

      Reply
  4. Need some assist from you please. I’ve done all the steps, but when i start nvidia x server settings this pops up: “You do not appear to be using the NVIDIA X driver”. Please edit your X configuration file (just run `nvidia-xconfig` as root), and restart the X server” . If i start nvidia-xconfig it creates config file but system never boots up saying “fatal error no screens found”. My laptop is lenovo y580 hd4000 + gtx660m + debian wheezy 7.6.0 , maybe this is due to the optimus? But in ubuntu 14.04 in additional drivers it installs and works out of the box. What could be the problem? Please, advise.

    Reply
    • “Debian 7.5 lenovo y580 nvidia optimus. I didn’t everthing as it is said and the system desn’t see nvidia it log in with gnome classic. I got an error while runing this command X -cinfigure. At the end it said “number of created screens does not match numer of detected devices. Configuration faild.” Any ideas? The second day I’m trying to install nvidia graphic card and nothing works (tried with bumblebee without success).”

      Same story! I can not understand, if this problem due to optimus, why everything works in ubuntu with proprietary driver as a result it’s possible to choose between intel and nvidia graphics without any optimus, but in debian it it said “Configuration

      As the nvidia driver is not autodetected by Xorg, a configuration file is required to be supplied. For example:

      /etc/X11/xorg.conf.d/20-nvidia.conf

      Section “Device”
      Identifier “My GPU”
      Driver “nvidia”
      EndSection

      Please note that this configuration will break Xorg on Optimus systems. For such hardware, see Bumblebee instead.”

      Reply
  5. Hellooo .. how to install nvidia geforce gt 635m on oracle linux ? my laptop asus k55v, im a noob in linux .. could you guys help me ? pls

    Reply
  6. Debian 7.5 lenovo y580 nvidia optimus. I didn’t everthing as it is said and the system desn’t see nvidia it log in with gnome classic. I got an error while runing this command X -cinfigure. At the end it said “number of created screens does not match numer of detected devices. Configuration faild.” Any ideas? The second day I’m trying to install nvidia graphic card and nothing works (tried with bumblebee without success).

    Reply
  7. It works, thanks! Few tips on RHEL 6.5 & Lenovo W520 (NVIDIA GF108GLM Quadro 1000M):
    – On BIOS set video mode to Discrete
    – Add kernel parameter noapic to prevent hang on boot when video mode is set to Discrete

    Reply
  8. Hi,

    Thankyou for writing this guide. I am new to Linux and I also folowed an other guide of you to install Mint the Dual Boot way.

    I followed every step, but I used service stop mdm. There was no gdm3. Now I can only run Mint in this safe mode.

    Is there any change I can change it back?

    Reply

Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.