Preface
This is HowTo is intended for Intrepid and/or Jaunty users who are experiencing oddball issues, such as glyphs, artifacts, and glitches from applications that use lots of small pixmaps/images.
For users of Ubuntu Hardy, in my testing, there is no such problem evident in the 2.6.24 and prior kernels, so you can blissfully ignore this thread. But, the way I will present HowTo installing NViDIA drivers may be true for almost any Debian-based distribution.
This HowTo may not necessarily be for users with any card that predates the Geforce 8 series, as mentioned here.
Infact, it should be noted that all the success stories I've had have mostly come from people using 8400 and up cards.
You are expected to be an experienced user, adept in the commandline, and have the ability to work out some Xorg related problems for yourself.
As of June, the 185.18 drivers have been officially released as stable. More about other recent driver versions can be found here.
List of known working cards through testimonials and my own testing:
Quadro-NVS 110M, GeForce Go7400, GTX260, GTX280, 6150SE, 7050PV, 7300SE, 7800GS, 8400GS, 8500GT, 8600GT, 8600GTS, 8800GT, 8800GTS, 9300MGS 9500GT, 9600GT, 9800GT, 9800GX2
If this guide works for you, please post your GFX card name/model so I can add it to the list.
Introduction
On the 6th of April, AaronP announced that the NViDIA 185.19 drivers are out for testing. In the list of updates, one stuck out of the crowd, as highlighted in this NViDIA thread.
This led to an affiliate asking about if this resulted in an improvement on the the way Firefox runs on Linux if you use an NViDIA driver.
The reply:
Not Firefox in particular, just performance in general. Any application that uses small pixmaps should see an improvement.
Since then, NViDIA have improved upon that initial release, renamed 185.19 to 185.18 and, as of the 27th May 2009, have now released the driver as officially supported.
"Wow", thought I. That is a very compelling reason, and I am crazy enough to risk breaking my system to try it.
Reset Xorg back to Failsafe Defaults
Before doing anything, it's time to say goodbye to nvidia for the moment and bring back the original Xorg configuration. This is done by opening a terminal and running:
Code:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.original
sudo dpkg-reconfigure -phigh xserver-xorg
It is not required, but you can logout and log back in again after running this. Doing so means you are now on the default VESA drivers, so Composite features (compiz) will be disabled.
Also, we won't be needing the xorg.conf.orginal file, but it serves:
1) As a backup incase you wish to reinstall the NViDIA drivers through the 'Hardware Drivers' utility.
2) As a reference for those who have specially tweaked xorg.conf files (such as dual-monitor, etc).
Installing Build Deps
Next, we need to be ensured that we have all build-essential programs and our current kernel headers.
Code:
sudo apt-get install build-essential pkg-config linux-headers-$(uname -r)
Ubuntu and Hardware Drivers
If you run Ubuntu and have an NViDIA card, you more than likely used the 'Hardware Drivers' utility to install them. This can lead to conflicts later down the line, as New drivers/Old drivers will cause API conflicts that will prevent X from starting.
So you are required to uninstall/remove any nvidia modules and references before beginning.
Code:
sudo apt-get --purge remove nvidia-glx nvidia-glx-legacy nvidia-glx-new nvidia-settings
Next, it is a good idea to check to ensure that dpkg shows that there are no extraneous packages left installed on your system.
Code:
dpkg -l | grep nvidia
If that outputs something, then these package needs removing. Use this aptitude command below to remove/purge them.
Code:
sudo aptitude purge $(dpkg -l | grep nvidia | awk '{print $2}')
Note: In some terminal emulators (hint: xterm) I have been informed that the above doesn't work. If this is the case, run the following instead:
Code:
sudo aptitude purge $(aptitude search -F%p '~c nvidia' '~i nvidia')
As an optional step, for some people who may find a conflict during installation, removing the xorg-nv drivers beforehand appears to work for them.
Code:
sudo apt-get --purge remove xserver-xorg-video-nv
Note: doing this means that the next time you restart X, you will have a 800x600, or an other low screen resolution, so do not be alarmed.
Another optional step, is to disable the nv and nvidia_new drivers from loading too, for those who have further problems.
Code:
gksudo gedit /etc/default/linux-restricted-modules-common
And on the line that says DISABLED_MODULES="" change it to
Code:
DISABLED_MODULES="nv nvidia_new"
Downloading the Drivers
Depending on your OS architechture, you will need to get the right one for your kernel.
If you are on 32bit Ubuntu, run:
Code:
wget ftp://download.nvidia.com/XFree86/Linux-x86/185.18.36/NVIDIA-Linux-x86-185.18.36-pkg0.run -O NVIDIA-Linux-185.18.pkg.run
If you are on 64bit Ubuntu, run:
Code:
wget ftp://download.nvidia.com/XFree86/Linux-x86_64/185.18.36/NVIDIA-Linux-x86_64-185.18.36-pkg0.run -O NVIDIA-Linux-185.18.pkg.run
Now, move the installer to the /usr/src folder and make a link to the file.
Code:
sudo install NVIDIA-Linux-185.18.pkg.run /usr/src
sudo ln -fs /usr/src/NVIDIA-Linux-185.18.pkg.run /usr/src/nvidia-driver
The nvidia-driver symlink will be needed for later + post installation configuration.
Downloading the Release Candidate Drivers
Optional Step: If you'd rather install the latest RC drivers, do the following instead.
If you are on 32bit Ubuntu, run:
Code:
wget ftp://download.nvidia.com/XFree86/Linux-x86/190.42/NVIDIA-Linux-x86-190.42-pkg0.run -O NVIDIA-Linux-190.42.pkg.run
If you are on 64bit Ubuntu, run:
Code:
wget ftp://download.nvidia.com/XFree86/Linux-x86_64/190.42/NVIDIA-Linux-x86_64-190.42-pkg0.run -O NVIDIA-Linux-190.42.pkg.run
And again, move the installer to the /usr/src folder and make a link to the file.
Code:
sudo install NVIDIA-Linux-190.42.pkg.run /usr/src
sudo ln -fs /usr/src/NVIDIA-Linux-190.42.pkg.run /usr/src/nvidia-driver
Kill X
Now, it's time to stop X and the gdm (or kdm for Kubuntu Users)
This requires that you logout and switch to another tty console ( Ctrl+Alt+F1 ).
Login to the shell, and kill gdm:
Code:
sudo /etc/init.d/gdm stop
This may take a while to complete.
In some rare instances, stopping gdm won't stop Xorg, due to the Xsession being busy with whatever error has occurred (Ubuntu goes into Low Resolution mode, X failed to start, etc).
In these instances, it is required that you run a kill of Xorg before you can continue with the installation of the driver.
Installing NViDIA
Afterwards, its time to install the drivers.
Code:
sudo sh /usr/src/nvidia-driver
Follow the instructions, and everything should run smoothly. A few points that I'd like to reassure first though:
- Don't worry about pre-compiled binaries, just let the script compile the drivers itself.
- If you run a 64bit OS, then let NViDIA install the 32bit backward compatibility modules.
- When asked, double check to ensure you select 'NO' when the NViDIA installer asks to reconfigure the xorg.conf file.
We don't want to change the xorg.conf file just yet, at least not until we are back in X.
Once finished, it is now time to reboot:
Before you Initiate the Driver
Now, since NViDIA didn't reconfigure the xorg.conf file, you will boot into the VESA drivers. To setup the xorg.conf file for nvidia, login, open a terminal, and run:
Code:
sudo cp /etc/X11/xorg.conf.original /etc/X11/xorg.conf
sudo nvidia-xconfig
Note: You may see this being outputted into the console
Using X configuration file: "/etc/X11/xorg.conf".
VALIDATION ERROR: Data incomplete in file /etc/X11/xorg.conf.
Device section "Configured Video Device" must have a Driver
line.
Backed up file '/etc/X11/xorg.conf' as '/etc/X11/xorg.conf.backup'
New X configuration file written to '/etc/X11/xorg.conf'
Ubuntu uses an automagically configured xorg.conf file, and nvidia-xconfig flags it only as a parser warning, and serves only as a warning. This does not affect the outputted xorg.conf file generated by the nvidia script, and you blissfully ignore it.
Now, not everyone may experience a smooth transition, and there are a number of small problems that you may run into that need addressing first. The most common one probably being a non-existent module listed in the xorg.conf file.
And if you have had a successful transition, and everything works. The first thing you may notice is a nice new NViDIA splash logo that you probably want to be removed too. If you get this, just run the following:
Code:
sudo sed -i '/Section\s*.Screen./a\ Option "NoLogo" "True"' /etc/X11/xorg.conf
For further information on fixing common problems, scroll down the thread to see if you are affected by one of them.
X Time
And that is it! To reload into your new nvidia drivers, close all running applications and logout/login again.
If you are running Ubuntu Hardy/Intrepid, this can be done by pressing Ctrl+Alt+Backspace.
If you are running Ubuntu Jaunty, then you'll have to manually logout, or in some cases, reboot your machine in order for the new driver to load and work.
Keep in sync with kernel updates
Now with custom compiled nvidia modules, you'll have to ensure that the drivers get recompiled whenever a new kernel gets released.
For reference on how to do this, follow this thread to set it up: http://ubuntuforums.org/showthread.php?t=835573
But, for clarification, open a new file named update-nvidia
Code:
gedit update-nvidia
Paste in the script listed in the thread, save and quit. Then run:
Code:
sudo mkdir -p /etc/kernel/postinst.d
sudo install update-nvidia /etc/kernel/postinst.d
to install the script.
Setting up Twin Graphics Cards
Some people I have been supporting use twin view with two NViDIA graphics cards. While this is perfectly fine, you may run into problems if your xorg.conf file is setup to handle only one card.
Such a setup will look like this when you go to edit the xorg.conf file.
PHP Code:
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
To work around the issue, it is best advised to remove the secondary card from the computer, boot up and acquire the output of the following.
and you should see something like this:
04:00.0 VGA compatible controller: nVidia Corporation GeForce 9800 GX2 (rev a2)
Make a note of the Bus ID of the card, and edit the xorg.conf file.
Code:
sudo nano /etc/X11/xorg.conf
Scroll to the Device section and add the Bus ID to the conf file, except remove all leading zeros, replace the period with a colon, and add 'PCI' as a prefix.
So, our example of 04:00.0 becomes:
PHP Code:
Section "Device"
BUSID "PCI:4:0:0"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
After doing this, save the file, then shutdown the workstation and reinsert the second GFX card back into the machine.
Folding@Home
Please don't ask any support questions on F@H, I am not the one to ask. There have been a few notes of people not being able to get F@H working after running through this guide.
Just for reference, someone has written a general walkthrough here.
When I get round to it, I'll look into setting it up cleanly and you'll see it here.
EDID Issues
This is a work-in-progress section that will be updated over the next week or so.
In this section I will attempt to address the rare cases that the EDID of the monitor is incorrect/invalid, and this forces the nvidia driver to load into a low resolution.
The way you can tell if you are affected by this is by running the following:
Code:
grep -n "EDID" /var/log/Xorg*log
If you see something along the lines of the following quote, then you are affect by the issue.
(WW) NVIDIA(GPU-0): The EDID read for display device DFP-0 is invalid: the
(WW) NVIDIA(GPU-0): checksum for EDID version 1 extension is invalid.
Troubleshooting and Errors
So even after following the guide, it still doesn't work? Your situation is far greater than a simple "it works" or "it doesn't work".
Taking that small bit of effort into finding out why X won't start and working around it using what utilities you have at your dispense so you can work around it can go a long way, even if there is a small learning curve or eye training involved.
In the event that it doesn't work, switch to a tty console, login, and use the following techniques to debug X.
Review your xorg.conf file
Code:
grep -n "^(EE)" /var/log/Xorg*log
This will tell you if there are any errors with your '/etc/X11/xorg.conf' file.
If there is an error emitted, for example:
(EE) Failed to load module "type1" (module does not exist, 0)
The module 'type1' doesn't exist on your system, to fix, open up your xorg.conf file and remove the line which references the module that doesn't exist.
Review the output of syslog
Code:
grep -i "nvidia\|NVRM" /var/log/syslog
If the Xorg.log errors are vague, this will hopefully return a more verbose answer as to why X is failing.
Another example of a typical error:
Apr 7 23:03:57 intrepid kernel: [79531.760530] NVRM: API mismatch: the client has the version 185.18, but
Apr 7 23:03:57 intrepid kernel: [79531.760531] NVRM: this kernel module has the version 177.82. Please
Apr 7 23:03:57 intrepid kernel: [79531.760532] NVRM: make sure that this kernel module and all NVIDIA driver
Apr 7 23:03:57 intrepid kernel: [79531.760534] NVRM: components have the same version.
We have 2 versions of the same driver in conflict!
Usually this is because the old module is still in cache, and hasn't been unloaded yet. But in most cases, if a reboot doesn't solve it, then make sure you have removed all installed nvidia references with "--purge"
Code:
sudo aptitude purge $(dpkg -l | grep nvidia | awk '{print $2}')
and then reinstall the driver again for good measure.
Uninstalling NViDIA Drivers
If all else fails and you just can't make it work, or you aren't fully satisfied with the driver and wish to return to the maintained driver in the Ubuntu repositories.
Then you can easily uninstall the driver by running the following:
Code:
sudo nvidia-uninstall
sudo dpkg-reconfigure -phigh xserver-xorg
sudo apt-get install xserver-xorg-video-all
sudo rm /usr/src/nvidia-driver /usr/src/NVIDIA-Linux-185.pkg.run /etc/kernel/postinst.d/update-nvidia
And when you restart X, your desktop will load with the defaulted failsafe drivers, then run the 'Hardware Drivers' utility to restore NViDIA.
Help and Feedback
Please review this HowTo, and express anything you think should be added, changed, and/or removed.
If you would like support, after X fails to start, switch to a tty console, login, and run the following:
Code:
sudo /etc/init.d/gdm stop
sudo nvidia-bug-report.sh
sudo dpkg-reconfigure -phigh xserver-xorg
sudo /etc/init.d/gdm start
Then attach the nvidia-bug-report.log.gz file to your post, and I'll do my best to look into just where you are going wrong.
Lastly, if it is of any help, you may wish to review the NViDIA Readme documents listed for the x86 (Ubuntu 32bit) or the x86_64 (Ubuntu 64bit) drivers for any further information and help on getting your drivers setup and working properly.
Also, if you your problem is obscure, you may have better luck asking on the NViDIA forums: http://www.nvnews.net/vbulletin/forumdisplay.php?f=14
Regards
Iain
Bookmarks