1. You may have noticed things look a little different around here - we've switched to a new platform (XenForo) and have some new forum styles and features. This how-to guide will help you find your way around. If you find anything that looks strange, post it in this thread.

Manual installation instructions for proprietary NVIDIA binary blob driver on Debian

Discussion in 'Linux Compatibility and Software' started by ALLurGroceries, Oct 19, 2010.

  1. ALLurGroceries

    ALLurGroceries   Super Moderator

    Reputations:
    9,516
    Messages:
    6,804
    Likes Received:
    360
    Trophy Points:
    251
    FEEDBACK WELCOME

    <hr>WARNING: This installs proprietary software on your computer. If you value freedom, you should contribute bug reports or code to the Nouveau project instead of relying on a corporation that does not respect open software principles.<hr>
    PLEASE NOTE:
    -I cannot provide support for NVIDIA's proprietary driver. Driver problems should be discussed at nvnews forums: NVIDIA Linux - nV News Forums.

    -Use your distribution's nvidia-glx package instead of this manual method unless you have a specific reason not to.
    &nbsp; -Valid reasons include:
    &nbsp; &nbsp; -Using beta drivers
    &nbsp; &nbsp; -Running a custom kernel and/or patching the NVIDIA driver
    &nbsp; &nbsp; -Using bleeding-edge hardware that requires the latest release
    &nbsp; &nbsp; -Being a 1337 h4x0r :rolleyes:

    <hr>
    Table of contents:
    0.) <a href="#intro">Introduction</a>
    1.) <a href="#concepts">Fundamental concepts</a>
    2.) <a href="#read">Other Documentation</a>
    3.) <a href="#prereq">Prerequisites</a>
    4.) <a href="#backup">Back up your existing setup</a>
    5.) <a href="#rmnouveau">Removing Nouveau and nvidia-glx</a>
    6.) <a href="#download">Downloading the driver</a>
    7.) <a href="#install">Installing the NVIDIA driver</a>

    A.) <a href="#troubleshoot">How to troubleshoot</a>
    B.) <a href="#remove">How to remove the proprietary NVIDIA driver</a>
    C.) <a href="#patch">Using the NVIDIA driver with a patch</a>

    <hr>

    <a name="intro"></a>Introduction
    Most current systems are shipping with nouveau as the default driver for NVIDIA cards. This is a free software implementation based on clean room reverse engineering, unfortunately it lacks many features. Most distributions also provide the option to install the proprietary NVIDIA driver in a package called nvidia-glx through some sort of driver program or package manager, however it is almost always out of date. This is a generic guide for manually installing the proprietary NVIDIA binary blob drivers on Debian-derived distros (Ubuntu, Mint, etc.) with the NVIDIA-provided installer, not a distribution-provided package.

    I've found the need to accumulate answers to common questions regarding the proprietary NVIDIA driver into one document, and that is my reason for creating this unofficial guide. It should not be treated as the last word on the topic, nor as a definitive guide to the installation of NVIDIA drivers. There is no special method here, only an accumulation of commonly known techniques in a condensed guide made for Debian-derived distros. I am not responsible for your actions and provide these instructions for reference only. Use this guide at your own risk. Corrections or suggestions are welcome and feel free to reuse this information in any way you'd like.

    Debian Sid and the 260.19.12 NVIDIA 64-bit driver are used for the examples. Since the driver is updated frequently, you will need to substitute the version number and architecture of the latest release for your system in the examples below.

    Unfortunately there is no support for NVIDIA Optimus on Linux at this time. If you are using an Optimus-equipped system, do not attempt to follow this guide.

    <a name="concepts"></a>Fundamental concepts
    This guide uses sudo to run commands as the superuser. Ubuntu and Mint usually have sudo configured out of the box. If you are running a stock Debian install, you will need to add the following line to your /etc/sudoers file and log out and back in, or you can choose to not do this, and run the commands in a root shell instead of using sudo. You can remove this line after finishing the guide, since it can be a potential security risk.
    Code:
    your_user_name_here    ALL=NOPASSWD: ALL
    Use CTRL+ALT+F1 (press and hold ctrl while also pressing and holding alt and F1) to switch away from the graphical interface and enter the terminal. This should look like an entirely black screen with a login prompt. There are a number of terminals you can log into at the same time, usually from F1 to F6. You use ALT+Fx where x is the F key with the number of the terminal, for example ALT+F2. You can use ALT+F7 or ALT+F8 (depending on your configuration) to switch back to the X server graphical interface if it is running. Holding the CTRL key is only needed to switch away from the graphical interface into a terminal.

    The X server is started and stopped by a generic piece of software called a display manager. This is usually GDM (for Gnome Display Manager), or KDM for KDE installations, and there are others. This guide only covers gdm, so if you use a different display manager you will need to first know how to start and stop it, though most act the same and for KDM you can substitute 'kdm' for 'gdm' in the examples in this guide. To start, stop, and restart gdm:
    Code:
    sudo /etc/init.d/gdm stop
    sudo /etc/init.d/gdm start
    sudo /etc/init.d/gdm restart
    Restarting is the same as stopping and starting in one command. In order to install the NVIDIA driver, the display manager must be in a stopped state. After installation, it can be started again. If you make simple configuration changes, to xorg.conf or similar, restarting is more appropriate.

    <a name="read"></a>Other Documentation
    General information about different NVIDIA drivers: NvidiaGraphicsDrivers - Debian Wiki
    Info here is not current but good for reference: https://help.ubuntu.com/community/NvidiaManual
    This does not cover manual installation but is good for reference: https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia
    There is full documentation from NVIDIA here: NVIDIA Accelerated Linux Graphics Driver README and Installation Guide

    You can also find options for the installer by running it with the --advanced-options or -A argument as in:
    Code:
    ./NVIDIA-Linux-x86_64-260.19.12.run --advanced-options | less
    (to quit less, type q)

    <a name="prereq"></a>Prerequisites
    It is important to first make sure your package list is up to date before downloading any prerequisite packages:
    Code:
    sudo apt-get update
    Make sure you have the build-essential and kernel-headers for your kernel version installed:
    Code:
    sudo apt-get install build-essential linux-headers-`uname -r`
    <a name="backup"></a>Back up your existing setup
    Before doing anything, you should back up your existing xorg.conf file (if you have one):
    Code:
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
    I'd recommend downloading Nouveau and (optionally) nvidia-glx to your local cache. This way you don't need a network connection to get back to working order if things go wrong:
    Code:
    sudo apt-get --download-only install xserver-xorg-video-nouveau
    Code:
    sudo apt-get --download-only install nvidia-glx
    <a name="rmnouveau"></a>Removing Nouveau and nvidia-glx
    Remove Nouveau to rule out causes of any potential problems you may experience (recommended unless you have a specific reason not to):
    Code:
    sudo apt-get --purge remove xserver-xorg-video-nouveau
    Any updates to nvidia-glx will overwrite your manually installed drivers, so if it is installed, it should be removed before proceeding:
    Code:
    sudo apt-get --purge remove nvidia-glx
    <a name="download"></a>Downloading the driver
    You can always download the latest official (proprietary) NVIDIA driver directly from here: Current NVIDIA Linux graphics driver releases - nV News Forums

    What I do is download the driver binary (64 bit in this example) to my home folder (~/), and make it executable:
    Code:
    wget -P ~ http://us.download.nvidia.com/XFree86/Linux-x86_64/260.19.12/NVIDIA-Linux-x86_64-260.19.12.run
    chmod a+x ~/NVIDIA-Linux-x86_64-260.19.12.run
    
    <a name="install"></a>Installing the NVIDIA driver
    Log out of your system via the menu, and leave it at the login screen. Hit CTRL+ALT+F1, log in, and then stop the display manager:
    Code:
    sudo /etc/init.d/gdm stop
    Sometimes compiz will not be killed even after gdm has stopped, and any running OpenGL applications will cause the NVIDIA installer to fail. To make sure compiz is not running:
    Code:
    sudo killall compiz
    I run the driver installer with a few options: -Nqa --ui=none

    a automatically accepts the license agreement
    q doesn't prompt for questions
    N to not check for precompiled kernel interfaces (it usually fails when running a custom kernel, you may not need this option)

    --ui=none forces the installer to fall back to a simpler interface that doesn't use ncurses

    You'll want to use --no-cc-version-check to bypass testing the gcc version that the kernel was built with, since it will probably not match with a stock kernel, and in most cases doesn't matter for current Ubuntu releases.

    So put it together and this command line should install the driver for you smoothly:
    Code:
    sudo ./NVIDIA-Linux-x86_64-260.19.12.run -Nqa --ui=none --no-cc-version-check
    After that finishes, configure your settings automatically with:
    Code:
    sudo nvidia-xconfig
    Finally, try restarting gdm:
    Code:
    sudo /etc/init.d/gdm start
    You should have the NVIDIA driver installed now and see your graphical login screen. If something goes wrong, see the <a href="#troubleshoot">troubleshooting</a> and <a href="#read">documentation</a> sections.

    <a name="troubleshoot"></a>How to troubleshoot
    If you start GDM and receive an error message or a garbled screen, hit CTRL+ALT+F1 to get back to the console to check the logs and fix the problem.

    If your system locks up completely, reboot into single user (or safe) mode to fix the problem.

    Error messages starting the xorg server begin with EE (or WW for warnings) and will be needed to track down any problems:
    Code:
    less /var/log/Xorg.0.log
    The NVIDIA installer leaves a log file in /var/log/nvidia-installer.log:
    Code:
    less /var/log/nvidia-installer.log
    (to quit less, type q)

    If anything goes wrong you can restore the backup xorg.conf and get back to normal with:
    Code:
    sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf
    If you don't have an xorg.conf to begin with, and things get messed up, just delete the existing one to revert to the default settings:
    Code:
    sudo rm /etc/X11/xorg.conf
    If you have <a href="#rmnouveau">removed the Nouveau driver</a>, you can reinstall it with this command:
    Code:
    sudo apt-get --reinstall install xserver-xorg-video-nouveau
    You can alternately use the proprietary NVIDIA driver provided by your distribution in the nvidia-glx package:
    Code:
    sudo apt-get --reinstall install nvidia-glx
    (note: the --reinstall may not be technically required depending on what steps you have taken previously)

    When you make changes to your driver configuration (such as changing or removing the xorg.conf, or installing a new driver), you must restart GDM (or KDM, or whatever display manager you are using) for the changes to take effect. Stopping and starting is covered in the examples above, but if you need to restart (stop and start) it in one go, use:
    Code:
    sudo /etc/init.d/gdm restart
    <a name="remove"></a>How to remove the proprietary NVIDIA driver
    Log out, hit CTRL+ALT+F1 and login to the terminal. Stop GDM:
    Code:
    sudo /etc/init.d/gdm stop
    To remove the NVIDIA driver that was installed manually:
    Code:
    sudo ./NVIDIA-Linux-x86_64-260.19.12.run --uninstall
    If you are switching back to the Nouveau or nvidia-glx driver, see the <a href="#troubleshoot">troubleshooting</a> section above to restore your xorg.conf and driver, and then restart GDM.

    <a name="patch"></a>Using the NVIDIA driver with a patch
    Sometimes you will find that a newer kernel release requires a patch to get the driver working. These patches can come from anywhere, but normally turn up on nvnews Linux forum on a thread about that kernel release. Patching the driver can be accomplished by extracting the installer binary to a directory.

    Code:
    ./NVIDIA-Linux-x86_64-260.19.12.run --extract-only
    cd NVIDIA-Linux-x86_64-260.19.12
    wget http://url/of/some.patch
    patch -p0 < some.patch
    
    Depending on the patchlevel of the patch, you may need to change p0 to p1.

    Assuming you have successfully patched with no fatal errors, you can run the installer:
    Code:
    sudo ./nvidia-installer -Nqa --ui=none --no-cc-version-check
     
  2. debguy

    debguy rip dmr

    Reputations:
    607
    Messages:
    890
    Likes Received:
    0
    Trophy Points:
    30
    Ok. ;)

    1. Please add to the title that this guide is made for Ubuntu and derivatives. A user of openSuse or Fedora might still find it useful but obviously can't just copy it.
    To be more general (adressed not only to you but to all): If you post any distribution specific how-tos, please always include the distribution in the title. There's more to Linux than just Ubuntu.

    2. I appreciate that you added a warning about nonfree software. But please also add a hint (maybe more that that, e.g. a whole paragraph) that even for the proprietary driver the package provided in the distributions repository should usually be favoured over the direct download from NVIDIA.
    The package management system is a central component of many distributions, and it should be used. There might be good reasons to circumvent it in certain situations (e.g. if the version in the package is too old), but this should only be an exception, not the rule.
     
  3. magnetpest2k7

    magnetpest2k7 Newbie

    Reputations:
    0
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    5
    @ALLurGroceries I appreciate your walkthrough but unfortunately the driver doesn't work. The systems hangs up after sudo /etc/init.d/gdm start. when i reboot then the system just displays a violet screen and freezes up there. So i had to get into the recovery mode and remove the xorg.conf file install the nouveau and restart the gdm to get back to old 800*600 state.

    I find the same thing happening when ubuntu 10.10 automatically detects the proprietary drivers and installs the nvidia automatically.

    Any other help greatly appreciated.

    Thanks
     
  4. ALLurGroceries

    ALLurGroceries   Super Moderator

    Reputations:
    9,516
    Messages:
    6,804
    Likes Received:
    360
    Trophy Points:
    251
    The title will be too long if I add this in, but I'll do it anyway, I understand your concern. This was already mentioned at the top, and I'm not going to sticky this post (at least I don't plan on it), so it's not really a statement about what Linux distro is worth writing about. I don't have a comfort level great enough with anything but Debian to write a kind of guide like this. You are free to take what I write here and write your own guide.

    This guide is specifically for manual installation, that is pretty explicit in that it doesn't use the package management system. I'll add a note at the top but not a paragraph.

    Replied in your other post here.
     
  5. f4ding

    f4ding Laptop Owner

    Reputations:
    261
    Messages:
    2,085
    Likes Received:
    0
    Trophy Points:
    55
    What's wrong with xorg.conf that the installer created? I always get a prompt to let the installer create a xorg.conf and it will back up the old one automatically, and that never fails. Of course I'm on opensuse.
     
  6. ALLurGroceries

    ALLurGroceries   Super Moderator

    Reputations:
    9,516
    Messages:
    6,804
    Likes Received:
    360
    Trophy Points:
    251
    If you run it non-interactively it won't prompt you, so that's the extra step. It's faster if you upgrade with every release to not be prompted because you shouldn't have to update your existing xorg.conf.

    As for why to manually back it up, it's because you can never have too many backups, and I don't want headaches from users trashing their configurations due to this guide.
     
  7. debguy

    debguy rip dmr

    Reputations:
    607
    Messages:
    890
    Likes Received:
    0
    Trophy Points:
    30
    Thanks a lot! My point is just, that I often find guides that basically say: "How to do X on Linux."
    If you then have a look at it you'll find that "Linux" actually means "Ubuntu" and that many newbies are confused because it doesn't work that way in their distribution and they complain about it because according to the title it should work for every Linux. This sometimes gets frustrating.

    Basically it'll work for other distributions too, but one would have to replace the apt-get commands.
    And sudo is still pretty Ubuntu-specific. I know there is a way to make Debian behave like Ubuntu, but afaik that's not default by now.


    I'm fine with the way it is now. I just wanted to make sure that newbies know that the manual installation shouldn't be the default way.
     
  8. ALLurGroceries

    ALLurGroceries   Super Moderator

    Reputations:
    9,516
    Messages:
    6,804
    Likes Received:
    360
    Trophy Points:
    251
    Valid point. The first thing I do on a stock Debian install is configure sudo. :p

    Add this to ur /etc/sudoers:
    Code:
    groceries    ALL=NOPASSWD: ALL
    (I added this to the prereq section in the guide).
     
  9. debguy

    debguy rip dmr

    Reputations:
    607
    Messages:
    890
    Likes Received:
    0
    Trophy Points:
    30
    I just installed a fresh Debian testing with only default settings and it still has a usual root account without enhanced privileges for normal users.

    :eek:

    Honestly I'm very unhappy with that. You know what you're doing. But a lot of people following your guide will only copy your instructions without thinking about the consequences.
    Since on one hand this setting creates a huge potential security problem and is not necessary to accomplish the task on the other hand you shouldn't set it as a prerequisite!
    If you wouldn't apply the NOPASSWD option, it would be much safer but still alter Debians default behavior without any need.

    So I'd like to add another general recommendation for how-tos:
    Don't alter the distributions default behavior without any good reason. And "because I feel more comfortable with it" should not count as a good reason.

    Just say that this thread is made for Ubuntu and optionally include a hint that it will work for Debian too if you log into a root shell and ommit the "sudo" in every command.
     
  10. ALLurGroceries

    ALLurGroceries   Super Moderator

    Reputations:
    9,516
    Messages:
    6,804
    Likes Received:
    360
    Trophy Points:
    251
    You're right, it's good to always be super clear about potential security problems.

    I added this to that part of the guide, and relocated it to the introduction:
    From Chapter 1 of the Debian Reference:
    I feel this is probably safe for most people using this guide, and if not, they have a good clear warning that I just added due to your concerns. ;)
     
  11. helikaon

    helikaon Notebook Consultant

    Reputations:
    269
    Messages:
    287
    Likes Received:
    0
    Trophy Points:
    30
    Good guide.
    Let's say one thing. Nouveau driver is free, but crap. This way i dont wanna offend the developers of Nouveau. It's just fact.
    I say this, because when i installed Fedora 13 as upgrade from Fedora 10 where i had Nvidia proprietary binary driver + DKMS (dynamic kernel modul support), it just totally fussed my comp.
    DKMS probably tried to compile in Nvidia driver which wasnt able to load because of Nouveau.
    Complete madness.
    I'got mad in hour or two too.
    I recompiled my vanilla kernel where i gave Nouveau driver kick. :).
    I live happily eva afta ... (Nouveau gangsta) :-D

    I know it's like killing mosquito with hammer, but i dont have time to study every distro whereabouts.
    And linux is freedom, right, so i shouldn't be forced to use any driver - even the gnu one.

    so, good guide and i add rep! :)

    haha, edit .... notebook forum says:
    "You must spread some Reputation around before giving it to ALLurGroceries again." ...
    so, i'm sory, but no rep. ... :)))
     
  12. ALLurGroceries

    ALLurGroceries   Super Moderator

    Reputations:
    9,516
    Messages:
    6,804
    Likes Received:
    360
    Trophy Points:
    251
    Right, well, no argument there really. I'm trying to cover all the bases here, and nouveau is what you pretty much have to use if you want to work on the kernel and report bugs, for one example. Also, it's just better to know there is a free alternative even if it isn't the nicest driver at this point. It'll only get better with people submitting bug reports and generally becoming more aware of it so that they use it.

    In my own mind, to justify the effort of making this guide, I felt a need to make a big warning at the top about proprietary software -- using the NVIDIA binary driver really irks me, but there's no way around it in some scenarios.

    Keep the friendly criticism coming, thanks for proofreading the guide!
     
  13. debguy

    debguy rip dmr

    Reputations:
    607
    Messages:
    890
    Likes Received:
    0
    Trophy Points:
    30
    Wow! I had no idea that this is in the official reference. I still think it's a bad idea. :(

    Sorry for being such a nag, it's better now, but in my opinion the sudoers hack shouldn't be there at all.
    1st: As I said, it isn't necessary.
    2nd: Even with this warning, some people still won't understand the problem it causes, and consider it to be "cool" not having to type any password anymore. And others will simply forget to revert it.

    I think the best (easiest and safest) way would still be to adress this guide to Ubuntu users and ommit the sudoers hack. Afaik Ubuntu caches the password for 15 minutes or so, which means you won't have to enter it more than once. And Debian users are used to find guides for Ubuntu and find "translations" (log in as root and ommit sudo) everywhere.

    I'm not sure if I'm taking this too serious, one could simply say "I told you...". But then it comes to my mind that most people in this forum come from a country where the handbooks of microwave ovens contain warnings not to dry cats in them. (not meant to be offensive against the country or its people, just observations from a wondering stranger concerning different cultural habits)
     
  14. ALLurGroceries

    ALLurGroceries   Super Moderator

    Reputations:
    9,516
    Messages:
    6,804
    Likes Received:
    360
    Trophy Points:
    251
    I added the link to the Debian Reference, so that if somebody doesn't know what sudo does, they can click the link, read the short section about it, and come back knowing full well what is actually going on. I also just added a 'Fundamental concepts' section where I again relocated that bit of text and added some explanation of moving between terminals and the concept of starting and stopping X. Please check out this section because it's absolutely essential new users would understand what I am saying here. Maybe I could word it better..

    I do agree that it's not completely necessary to use sudo, but in order to balance ease of use for Ubuntu and others, I tend to write all of my guides using it, not just because I personally use this configuration on my Debian systems, but to make it less complicated for the widest audience. You got me to add the bit about not using sudo at all, and instead logging in as root, so I think it's pretty clear now. If it's not as clear as it should be, let me know how it could be written more clearly.

    Since it's a guide that I hope will be used many times, it can't really be criticized too thoroughly, thanks for your feedback.
     
  15. weinter

    weinter /dev/null

    Reputations:
    596
    Messages:
    2,798
    Likes Received:
    1
    Trophy Points:
    56
    There is another way to install Nvidia Driver.
    Change Runlevel to init 3, run the binary blob, switch to runlevel 6 init 6 to restart after it is done.
     
  16. f4ding

    f4ding Laptop Owner

    Reputations:
    261
    Messages:
    2,085
    Likes Received:
    0
    Trophy Points:
    55
    This is what I was talking about. Takes less than two minutes. I seriously don't understand what the fuss is about. Reboot and works like a charmm everytime.
     
  17. ALLurGroceries

    ALLurGroceries   Super Moderator

    Reputations:
    9,516
    Messages:
    6,804
    Likes Received:
    360
    Trophy Points:
    251
    This method doesn't need a reboot and takes me about 30 secs on my i7 machine with an SSD. Press CTRL+ALT+F1, stop gdm, run the installer, restart gdm. Done. I've explained it in excruciating detail, that's all.

    My purpose for this guide is to have something a complete newbie can understand, from start to end. I have anchored all of the sections so that I can link to them from other posts instead of repeating explanations all the time.

    I'm not done with the guide yet. It's still open for comment, please feel free to give suggestions. :)
     
  18. weinter

    weinter /dev/null

    Reputations:
    596
    Messages:
    2,798
    Likes Received:
    1
    Trophy Points:
    56
    Ok I will post the full instruction (make sure you have the kernel headers sources and the gcc require to recompile the Nvidia Binary Kernel Module first):

    Turn on computer manually edit the grub kernel parameters:
    add " init 3 " to the end of the boot parameters

    Boot the Kernel

    If you had a previous Nvidia Driver installed.
    Run "su", Enter password
    Change Directory to the downloaded location:
    "cd /home/username/Downloads"

    then shell the command
    "sh Nvidia-whatever-the-version.run --uninstall"

    After it finishes

    "sh Nvidia-whatever-the-newer-version-is.run"

    Then run
    "init 6" or immediately go to "init 5"

    Actually you can use runlevel to install Nvidia Binary Blob without rebooting. Changing Runlevel is not considered rebooting unless you run "init 6"

    Either way you still need to reboot if you are changing the kernel.
     
  19. entropy101

    entropy101 Notebook Enthusiast

    Reputations:
    0
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    5
    still building.. ahaha wow. its going so slow i wonder why
     
Similar Threads: Manual installation
Forum Title Date
Linux Compatibility and Software Help installing Ubuntu 8.04 (manually) Nov 9, 2008
Linux Compatibility and Software Fedora installation failed - data recovery Jan 21, 2012
Linux Compatibility and Software Installations Mar 25, 2011
Linux Compatibility and Software Linux Installation Size Dec 12, 2010
Linux Compatibility and Software Canonical Begins Tracking Ubuntu Installations Aug 10, 2010

Share This Page