jump to navigation

Compiling and Using Newest Nvidia drivers in Ubuntu – It’s easier than you think April 10, 2007

Posted by amazingrando in Linux Tips.

Nvidia control panel (pic thanks to jdk)
Nvidia control panel (pic thanks to jdk)

There are many ways to use open and proprietary graphics drivers for your Nvidia card in Ubuntu, as can be found at the Ubuntu Guide. But, if you want the latest drivers from Nvidia complete with all of their optimizations you’ll need compile and install it. Happily, it’s not too hard.

The following should work equally well on Edgy and Feisty. I’ve tried it on both and it worked for me, but your mileage may vary. Also, remember to back up your files, such as etc/X11/xorg.conf before you embark on this – just in case. Much of this is inspired by RYX’s Compiz install guide, so many thanks go to him. Finally, you might want to print this out to guide you through the process.

Step 1 – Getting the drivers from Nvidia

You can get them from their website. For most people, choose Linux IA32 latest version.

Step 2 – Compilation dependencies

The Nvidia drivers have a shell script to install and compile, but they’ll need some dependencies, which can done by typing the following in the terminal.

sudo apt-get install linux-headers-`uname -r` build-essential gcc gcc-3.4 xserver-xorg-dev

Step 3 – Clean out the old Nvidia drivers

First, you’ll need to purge the nvidia-glx driver

sudo apt-get remove --purge nvidia-glx

Second, you should make sure that the linux-restricted-modules for nvidia are disabled (blacklisted).

sudo gedit /etc/default/linux-restricted-modules-common

Note that it may be linux-restricted-modules on pre-Feisty systems.  You’ll know if it’s not the right one if the file you open is blank.

There, put in the following code, and save.


Step 4 – Reboot

This isn’t probably necessary, but good to make sure the purged stuff isn’t still loaded

Step 5 – Stop the X server (i.e. Gnome) and go to a command line interface. Note that this is/was a bug in the Feisty beta that may prevent you from doing this command.

sudo /etc/init.d/gdm stop

Step 6 – Run the installation script

sudo sh NVIDIA-Linux-x86-1.0-*-pkg1.run

Follow prompts to accept the license, and look for a pre-compiled kernel. Eventually it will ask you to compile a custom one, which is what you want.

After it finishes it will ask you to modify the xorg.conf file. Choose yes.

Step 7 – Finishing up

Hopefully the compile went fine and you’re back at the command line. If so, now we want to add a couple of optimizations to the xorg.conf file, by running the following commands.

sudo nvidia-xconfig --composite
sudo nvidia-xconfig --render-accel
sudo nvidia-xconfig --allow-glx-with-composite
sudo nvidia-xconfig --add-argb-glx-visuals

Step 8 – Reboot and cross your fingers!

If all went well, when you reboot you should see a gray Nvidia logo as Ubuntu finishes loading up. If you see that, give yourself a pat on the back – you did it!



1. weston - June 5, 2007

Thanks for this. I somehow completely messed up my display drivers and the system wouldn’t even boot into command line automatically. I’m trying this now (minus the last few glx commands) and crossing my fingers…

didn’t work. Rats!

2. amazingrando - June 6, 2007

weston – you should be able to boot into recovery mode (command line mode) no matter what the condition of your xorg.conf file because that only affects the x server, which you won’t be using when you’re in command line mode. Some options:
* Restore the xorg.conf backup that the nvidia installer (use the cp command to overwrite the new one with the backup)
* Run nvidia-xconfig from the command line to rerun the configuration of the xorg.conf file
* Edit the /etc/X11/xorg.conf file to remove what the nvidia installer put in there
If you come up with some other options that work well, let me know. Good luck!

3. Doc - June 15, 2007

I had the beta nvidia drivers installed and all was working perfectly. Then I started getting an API Mismatch error and tried reinstalling them: Nothing works other than the ‘nv’ drivers now. How do I get back to what used to work?

4. jeremy - June 16, 2007

i’ve been trying to install dirvers for my geforce go6150.

but i’m running into a problem.
I’ve been reading the README file from the Nvidia site but i dont understand the following:

Currently, the NVIDIA driver will attempt to detect edge triggered interrupts and X will purposely fail to start (to avoid stability issues). This behavior can be overridden by setting the “NVreg_RMEdgeIntrCheck” NVIDIA Linux kernel module parameter. This parameter defaults to “1”, which enables the edge triggered interrupt detection. Set this parameter to “0” to disable this detection.

now i have to set the paramet to “0”…but i wouldnt know how

5. Bob - April 27, 2008

This procedure won’t work for 2.6.24-16-server due to the inbuilt Xen

6. Steven - August 10, 2008

I know this is an old post but its the only solution that worked perfectly for me You sir are the man!

7. tmx - August 20, 2008

i just installed ubuntu for the first time and used your instructions to install my 8800gtx, thank you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: