FEEDBACK WELCOME
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.
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.
-Valid reasons include:
-Using beta drivers
-Running a custom kernel and/or patching the NVIDIA driver
-Using bleeding-edge hardware that requires the latest release
-Being a 1337 h4x0r![]()
Table of contents:
0.) Introduction
1.) Fundamental concepts
2.) Other Documentation
3.) Prerequisites
4.) Back up your existing setup
5.) Removing Nouveau and nvidia-glx
6.) Downloading the driver
7.) Installing the NVIDIA driver
A.) How to troubleshoot
B.) How to remove the proprietary NVIDIA driver
C.) Using the NVIDIA driver with a patch
intro 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.
concepts 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.
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.Code:your_user_name_here ALL=NOPASSWD: ALL
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:
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.Code:sudo /etc/init.d/gdm stop sudo /etc/init.d/gdm start sudo /etc/init.d/gdm restart
read 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:
(to quit less, type q)Code:./NVIDIA-Linux-x86_64-260.19.12.run --advanced-options | less
prereq Prerequisites
It is important to first make sure your package list is up to date before downloading any prerequisite packages:
Make sure you have the build-essential and kernel-headers for your kernel version installed:Code:sudo apt-get update
backup Back up your existing setupCode:sudo apt-get install build-essential linux-headers-`uname -r`
Before doing anything, you should back up your existing xorg.conf file (if you have one):
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 cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
Code:sudo apt-get --download-only install xserver-xorg-video-nouveaurmnouveau Removing Nouveau and nvidia-glxCode:sudo apt-get --download-only install nvidia-glx
Remove Nouveau to rule out causes of any potential problems you may experience (recommended unless you have a specific reason not to):
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 xserver-xorg-video-nouveau
download Downloading the driverCode:sudo apt-get --purge remove nvidia-glx
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:
install Installing the NVIDIA driverCode: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
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:
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 /etc/init.d/gdm stop
I run the driver installer with a few options: -Nqa --ui=noneCode:sudo killall compiz
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:
After that finishes, configure your settings automatically with:Code:sudo ./NVIDIA-Linux-x86_64-260.19.12.run -Nqa --ui=none --no-cc-version-check
Finally, try restarting gdm:Code:sudo nvidia-xconfig
You should have the NVIDIA driver installed now and see your graphical login screen. If something goes wrong, see the troubleshooting and documentation sections.Code:sudo /etc/init.d/gdm start
troubleshoot 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:
The NVIDIA installer leaves a log file in /var/log/nvidia-installer.log:Code:less /var/log/Xorg.0.log
(to quit less, type q)Code:less /var/log/nvidia-installer.log
If anything goes wrong you can restore the backup xorg.conf and get back to normal with:
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 cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf
If you have removed the Nouveau driver, you can reinstall it with this command:Code:sudo rm /etc/X11/xorg.conf
You can alternately use the proprietary NVIDIA driver provided by your distribution in the nvidia-glx package:Code:sudo apt-get --reinstall install xserver-xorg-video-nouveau
(note: the --reinstall may not be technically required depending on what steps you have taken previously)Code:sudo apt-get --reinstall install nvidia-glx
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:
remove How to remove the proprietary NVIDIA driverCode:sudo /etc/init.d/gdm restart
Log out, hit CTRL+ALT+F1 and login to the terminal. Stop GDM:
To remove the NVIDIA driver that was installed manually:Code:sudo /etc/init.d/gdm stop
If you are switching back to the Nouveau or nvidia-glx driver, see the troubleshooting section above to restore your xorg.conf and driver, and then restart GDM.Code:sudo ./NVIDIA-Linux-x86_64-260.19.12.run --uninstall
patch 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.
Depending on the patchlevel of the patch, you may need to change p0 to p1.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
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
-
ALLurGroceries Vegan Vermin Super Moderator
-
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. -
@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 -
ALLurGroceries Vegan Vermin Super Moderator
-
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.
-
ALLurGroceries Vegan Vermin Super Moderator
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. -
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.
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.
-
ALLurGroceries Vegan Vermin Super Moderator
Add this to ur /etc/sudoers:
Code:groceries ALL=NOPASSWD: ALL
-
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. -
ALLurGroceries Vegan Vermin Super Moderator
I added this to that part of the guide, and relocated it to the introduction:
-
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. ...))
-
ALLurGroceries Vegan Vermin Super Moderator
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! -
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) -
ALLurGroceries Vegan Vermin Super Moderator
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. -
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. -
-
ALLurGroceries Vegan Vermin Super Moderator
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. -
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. -
still building.. ahaha wow. its going so slow i wonder why
Manual installation instructions for proprietary NVIDIA binary blob driver on Debian
Discussion in 'Linux Compatibility and Software' started by ALLurGroceries, Oct 19, 2010.