Did You Know?
Ask a Question

We are pleased to announce the Launch of our New Section "TecMint Ask"

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

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

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.

I am a major in computer science, love to research nix. I love to write codes and scripts, review distros, experiment Foss Technologies, write technical articles, Hack, of course Ethically. I am working as System Administrator (nix) for a NGO.

Linux Services & Free WordPress Setup

Our post is simply ‘DIY’ aka ‘Do It Yourself, still you may find difficulties and want us to help you out. We offer wide range of Linux and Web Hosting Solutions at fair minimum rates. Please submit your orders by Clicking Here.

37 Responses

  1. Sergiu Niculescu says:

    For RHEL/CentOS just add ‘elrepo’:
    # rpm -Uvh http://elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
    and:
    # yum install kmod-nvidia nvidia-x11-drv

  2. 2redge2 says:

    “# X -confugure” !!!

  3. John H says:

    The nVidia driver should do that last step for you so you shouldn’t have to do X -configure, FYI. The last part of the.run script copies to the xorg automatically.

  4. Or just use Mageia, the nvidia driver is in the supported repo, and there is a graphical tool to install, set up and switch to the driver if you don’t select it at install time.

  5. Ken says:

    So, attempted to install this on Ubuntu 12.04 and I cannot do an apt-get update without getting a NO_PUBKEY error:

    W: GPG error: http://ftp.debian.org wheezy Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA

  6. Kris says:

    How do you fix this error: W: GPG error: http://ftp.debian.org wheezy Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA

  7. Jess says:

    I’m also getting the same error when I update:
    W: GPG error: http://ftp.debian.org wheezy Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA

  8. tonka says:

    Hi, guys! I am trying to install the drivers for Ubuntu system.
    However, I have problems with

    “apt-get install nvidia-kernel-dkms nvidia-glx nvidia-xconfig nvidia-settings”.

    The terminal gives me back this one:

    “Package nvidia-glx is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    Package nvidia-kernel-dkms is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘nvidia-kernel-dkms’ has no installation candidate
    E: Package ‘nvidia-glx’ has no installation candidate
    E: Unable to locate package nvidia-xconfig”

    Any idea how to overcome this problem?

    • Avishek Kumar says:

      @ tonla install nvidia-glx, nvidia-kernel-dkms or anyother dependency by installing these manually, (Download these packages and dpkg -i *.deb to install them).

      You can alternatively set needed repo.

  9. Or says:

    Hey,
    i did the instruction in the centos manual and when i reach the part where i need to install the nvidia driver i get this error:

    “ERROR: Unable to load the kernel module ‘nvidia.ko’. This happens most frequently when this kernel module was built against the wrong or improperly configured kernel sources, with a version of gcc that differs from the one used to build the target kernel, or if a driver such as rivafb, nvidiafb, or nouveau is present and prevents the NVIDIA kernel module from obtaining ownership of the NVIDIA graphics device(s), or no NVIDIA GPU installed in this system is supported by this NVIDIA Linux graphics driver release.”

    anyone can help?? please!

  10. Anoop C S says:

    Got stuck after performing the above steps for installing driver for Fedora 19(GT 520MX). “lspci” identified graphics card as 3D controller.

    Skipped the “X -configure” and “cp xorg.conf.new /etc/X11/xorg.conf” steps considering
    the above comment by John H. Installtion was successful without any errors. But Gnome is not loading (black screen and nothing happening). Help needed…….?

    • Avishek Kumar says:

      Dear Anoop,

      Please follow the steps correctly, don’t mix two concept, (from two people) at a point.
      Now for your problem.

      Run as root:

      /etc/init.d/gdm stop (to kill x server)

      X -configure (creates a xorg.conf.new file at /root/)

      cp /root/xorg.conf.new /etc/X11/xorg.conf (copy this file to /etc/X11 as xorg.conf)

      /etc/init.d/gdm start (to start x server)

      Hope it helps.

  11. Scott Borisch says:

    Hi,

    When I run:

    service gdm3 stop

    I get a completely black screen, with a cursor. which is NOT a prompt.
    That is, if I type, say, ls, and hit return, I get nothing but a new line.

    This black screen issue seems to be mentioned here:

    http://forums.debian.net/viewtopic.php?f=17&t=63622

    After rebooting, X windows was dead, and even using a recovery disk and reverting
    /etc/modprobe.d/blacklist.conf
    to the original did not fix the problem.
    I had to completely re install Debian Wheezy.
    Has anyone else seen this issue?

    - Scott

    • Avishek Kumar says:

      @ scott Borisch, if u get blank screen after killing X session.
      Goto console Ctrl+Alt+F1 ….. F6. Login, and then perform installation of NVIDIA driver as stated above. You may need to reconfigure your X session, if u finds it difficult u can send me ssh login details @ avishek1210@gmail.com.

  12. Ivan Tuma says:

    Avishek – I’m new to the Debian distro …

    This seems very straight forward and I appreciate you taking the time to share this with the group – however before I attempt to make the Quadro 600 work properly with my Debian 6 Squeeze, I have a couple of questions…

    Since I’m running Squeeze and not Wheezy … should the line in my /etc/apt/sources.list file contain “squeeze” rather than wheezy like in my example below? Or are we specifically sourcing the drivers from the wheezy repository for this purpose?

    My sources.list file… see the last line for what I WANT to try…

    deb http://security.debian.org/ squeeze/updates main contrib
    deb-src http://security.debian.org/ squeeze/updates main contrib
    deb [arch=amd64,i386] http://http.us.debian.org/debian/ squeeze main contrib non-free
    deb [arch=amd64,i386] http://ftp.debian.org/debian/ squeeze-updates main contrib
    deb-src http://ftp.debian.org/debian/ squeeze-updates main contrib
    ###################
    deb http://ftp.debian.org/debian/ squeeze main contrib non-free
    ###################

    Thanks … I’ll hold off until I hear a response … unfortunately I can’t afford to rebuild this system if this fails :-( but on the other hand, having a second monitor is an indispensable feature that may be worth the gamble.

    -IT

    • Moby says:

      I’m not a Linux expert but I think that’s right – you should type “squeeze” instead of “wheezy”

    • Avishek Kumar says:

      @ Ivan Tuma,
      since you are using squeeze, it is normal to have squeeze software sources in /etc/apt/sources.list.
      Before proceeding backup your /etx/X11/xorg.conf, so that in case u brake X, you can restore.

      If you face any problem, you can contact me here.
      Hope it Helps

      • Ivan Tuma says:

        Thanks – unfortunately there is something broken in my whole Xsession setup. My system is a “realized” VM (using P2V). I don;’t know how this effected my xsession config – but when I try running the X -configure, I get all kinds of error stating that the number of displays does not match. Unfortunately I didn’t capture the errors. It took me a couple of hours to back out of the changes (I uninstalled the Nvidia drivers).

        I would be perferctly content using the Nouveau driver … I don’t need 3D accelleration since my system is only being used to write code and look at pdf files. but even that one requires one to build a new xorg.conf file, and I get the same errors with mismatching number of displays.

        These instructions should allow you to configure nouveau for dual monitors (for those who cant make Nvidia work)…
        https://bbs.archlinux.org/viewtopic.php?pid=652861

        Once I find time to go through this again, I’ll post my results…

  13. Moby says:

    Hi!
    I have Debian 7 KDE (wheezy) and I’ve followed your guide upto killing X server (I did [code]# service kdm stop [/code]). After that my screen went black and the system rebooted. Since I have Debian in dual booting with Win7, when I picked Debian from GRUB’s menu, I was taken to the black-background command line instead of the typical Debian kde desktop. I logged in with username and password, but don’t know how to proceed from there on. I’ve pressed Ctrl+Alt+(F1 to F12) but nothing special happened.

    Can you tell me what to do after the command-line-style login? I don’t want to re-install Debian as Scott Borisch (above) had to do.

    • Avishek Kumar says:

      Once You logged onto Shell from command line, follow the above tutorial as

      # X -configure
      # cp /root/xorg.conf.new /etc/X11/xorg.conf
      # startx

      It should work for you. Execute above command as root.

      • Moby says:

        Yes, I did that and followed the rest of your procedure. It works perfectly (so far). Thank you for writing this guide for all of us newbies!

  14. jerk001 says:

    using CentOS, followed all the steps, logged in as root but it still gives me a permission denied error.

    • jerk001 says:

      i used chmod to give it permission but after that it still gave me errors and failed to install the driver

      • jerk001 says:

        sorry abou the staggered replies, iḿ just a day old using linux and it has been quite overwhelming, i was able to log into root but then it asked me to use the telinit 3 user space, after that i still contunied to get errors.

        the error i seem to be getting is a Noueau driver error, but i thought i had blacklisted that.

        here is the log file entry

        nvidia-installer log file ‘/var/log/nvidia-installer.log’
        creation time: Tue Jan 7 00:32:14 2014
        installer version: 331.20

        PATH: /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

        nvidia-installer command line:
        ./nvidia-installer

        Using: nvidia-installer ncurses user interface
        -> Tagging shared libraries with chcon -t textrel_shlib_t.
        -> License accepted.
        -> Installing NVIDIA driver version 331.20.
        ERROR: The Nouveau kernel driver is currently in use by your system. This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding. Please consult the NVIDIA driver README and your Linux distribution’s documentation for details on how to correctly disable the Nouveau kernel driver.
        WARNING: One or more modprobe configuration files to disable Nouveau are already present at: /etc/modprobe.d/nvidia-installer-disable-nouveau.conf. Please be sure you have rebooted your system since these files were written. If you have rebooted, then Nouveau may be enabled for other reasons, such as being included in the system initial ramdisk or in your X configuration file. Please consult the NVIDIA driver README and your Linux distribution’s documentation for details on how to correctly disable the Nouveau kernel driver.
        ERROR: Installation has failed. Please see the file ‘/var/log/nvidia-installer.log’ for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at http://www.nvidia.com.

        thanx again

  15. Paul says:

    I followed the instructions for a Debian Wheezy installation, except that I did the whole thing from the console, as I could never get x to start using nouveau. I am using an itx board but with a pcie video card (to run full hd on a mythtv installation). lspci finds the card, and only the card. In console mode the nouveau driver must be successfully blacklisted because it does not appear in lsmod, but nvidea does. So I guess in console I am using the nvidea driver. However X -configure fails, failing to write a screen into the configuration, so of course startx fails with the ‘no screen found error’

    • Paul says:

      I have now got to the stage of getting the Nvidia driver into the conf file. But now it says input/output error on /dev/nvidia0 when I try to launch x

  16. Raye says:

    I completely broke my install of Fedora 20 between rebooting and going into command mode. All I get is a blank screen. I can’t even get into a different run level using Grub2. Oh well. At least it was a [mostly] fresh install.

  17. atreyu64 says:

    Very useful, thanks a lot, works like a charm on RHEL 6.5 !

  18. mat says:

    FEDORA 20 error after X -configure. “… number of created screens does not match number of detected devices”. Do you know how to fix it? i am pretty new in linux world, so please understand my little knowledge about fedora

  19. jan johnson says:

    I went the ElRepo direction for Cent OS 6.5, and it worked… sort of. My remaining issue is that the evaluation desktop I’m using has an older (6-8 yrs) Samsung LCD 26″ display, but the NVIDIA Config Wizard is sensing it as a 40″ display, so no matter what resolution I set it to, I cannot see the entire screen.

    Has anyone seen this? And if so, do you have a workaround that you’d like to share?

    Thanks.

  20. Marcelo Dias de Moura says:

    Hello,

    Thanks for the tips. The driver installation nvidia quadro k2000 worked perfectly on CentOS 6.5. However, the startup and shutdown were the black screen mode, ie, no longer shows the logo CentOS Loading.

    I tried to reactivate the file /boot/initramfs-$(uname-r).img.bak, but he claims he does not think the nouveau.

    What should I do?

    Thanks in advance for your attention.
    Marcelo.

  21. Lee says:

    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?

Leave a Reply

© 2012-2013 All Rights Reserved.