Revision 22 as of 2007-07-01 19:00:08

Clear message

This is not the recommended way to install the NVIDIA drivers - please see ["BinaryDriverHowto/Nvidia"] for the supported method. Any problems that occur after using the following instructions should not be reported to the launchpad bug area. If the drivers were downloaded from the NVIDIA web site then the [http://www.nvnews.net/vbulletin/forumdisplay.php?f=14 NVIDIA Linux web forum] is an appropriate place to report issues. Other places for binary driver manual installation support can be found on the [http://www.ubuntu.com/support/communitysupport Community Support page].

Sometimes using the available nvidia-glx packages provided by Ubuntu is not desirable for NVIDIA card users. If your card is too new it might not be supported by the Ubuntu provided binary packages. Perhaps bugs are present in provided packages that are fixed in later drivers not yet distributed by Ubuntu. Maybe newer drivers provide a new feature not yet available in the Ubuntu packages. The purpose of this page is to detail the necessary work to install the [http://www.nvidia.com/object/unix.html official NVIDIA Linux driver pkg from www.nvidia.com]. Note that this will not fix resolution problems, for that you need to see the FixVideoResolutionHowto.

attachment:IconsPage/IconDialog-Warning1.png When using manually installed NVIDIA binary drivers you will need to redo some or all these steps every time packages like the kernel or mesa are updated.

Obtaining Needed Software

Before you begin, it is strongly advised that your already have Xorg working acceptably with the 'nv' drivers included. First, make sure that your /etc/X11/xorg.conf is backed up.

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

Next, download the right drivers for your platform from the [http://www.nvidia.com/object/unix.html NVIDIA Unix Driver portal] and save them to your home directory.

Open a terminal, and run the following command:

sudo apt-get install build-essential linux-headers-`uname -r`

attachment:IconsPage/IconDialog-Warning1.png This next step is optional. Most people will not need it, and it takes a fair amount of bandwidth and diskspace. It installs the Linux kernel source. If later steps fail, consider this a last resort.

sudo apt-get install linux-source-`uname -r`
cd /usr/src
sudo tar xvjf linux-source-`uname -r`
sudo ln -s linux-source-`uname -r` /usr/src/linux

Disable Conflicting Software

Using Synaptic or Apt, uninstall nvidia-glx, nvidia-glx-legacy, nvidia-glx-new and nvidia-settings if they are installed.

Open the the /etc/default/linux-restricted-modules-common file with an editor and find the line:

DISABLED_MODULES=""

replace it with:

DISABLED_MODULES="nv nvidia_new"

Note: In Ubuntu 7.04 the nvidia_new is explicitly required in addition to nv on the DISABLED_MODULES line. See this [https://bugs.launchpad.net/ubuntu/+source/linux-restricted-modules-2.6.20/+bug/105756 launchpad bug about lrm-manager failing to disable the nvidia_new module when nv is specified alone].

attachment:IconsPage/IconDialog-Warning1.png Warning: Be wary of uninstalling nvidia-kernel-common or packages starting with the name linux-restricted-modules. Doing so will cause all restricted drivers to be uninstalled which may result in other hardware (e.g. certain wireless cards) or other software (e.g. VMware) failing to work after a reboot/kernel update.

Prepare Configuration Files

The next step is to edit your xorg.conf file. Open it with an editor,

gksudo gedit /etc/X11/xorg.conf

Find the section Module and comment out DRI using the # symbol, such as in the following example.

Section "Module"
        Load    "bitmap"
        Load    "dbe"
        Load    "ddc"
#       Load    "dri"   <------ this is 'commented'
        Load    "extmod"
        Load    "freetype"
        Load    "glx"
        Load    "int10"
        Load    "record"
        Load    "type1"
        Load    "vbe"
EndSection

Now find the section Device, and change the Driver from nv (or vesa, fb, etc) to nvidia, as in the following example, and then save it.

Section "Device"
        Identifier      "Card0"
        Driver          "nvidia" #This is where you change it
EndSection

Now that your Xorg.conf is saved, we need to shutdown the X11 server so that we can install the new drivers. To do this, save your work and press ctrl-alt-f1, and log in. Then run the following command to shutdown X11. Make sure your work is saved, Gnome is going to shutdown too.

sudo /etc/init.d/gdm stop

Install the Driver

Useful tip, typing the first few letters and hitting the tab key will auto-complete the name, saving you from using wildcards like *

For Ubuntu 6.06 or later users: now that you can run the script, you do so with the following command:

sudo sh NVIDIA*

attachment:IconsPage/IconDialog-Warning1.png Warning! If you're using Breezy Badger (5.10), then you will need to use the following commands instead of the one above:

sudo apt-get install gcc-3.4
CC=gcc-3.4 sudo sh NVIDIA*

The installer will now walk you through the steps required. Assuming success, you can now restart your X11 server using

sudo /etc/init.d/gdm start

Kernel and Mesa Updates

Every time a new kernel comes out you will have to manually rebuild the NVIDIA binary driver kernel module. This can be done by booting to the new kernel and then running:

sudo sh NVIDIA* -K

on the previously downloaded NVIDIA pkg.

Additionally, any time that the mesa packages are updated you will have to reinstall the NVIDIA pkg again.

It didn't work! (Troubleshooting)

If the installer fails, go through the following checklist

  • Was Xorg already properly configured for the nv driver?

  • Did you disable the loading of Ubuntu provided NVIDIA drivers using DISABLED_MODULES="nv nvidia_new" in /etc/default/linux-restricted-modules-common ? This is a common cause of driver mismatch errors on manual installations due to conflicts with the Ubuntu provided NVIDIA binary driver.

  • Did you remove the nvidia-glx/nvidia-glx-legacy/nvidia-glx-new and nvidia-settings packages?

  • Did you read the log found in /var/log/nvidia-installer-log for errors that can guide you?

  • Did you check the output of dmesg ?

  • Did you install the kernel headers (and possibly source package)?
  • Did you check the NVIDIA readme found on their site to make sure your card is supported with that version of driver?
  • Did you check the [http://www.nvnews.net/vbulletin/forumdisplay.php?f=14 NVIDIA Linux Forums] for any current 'known issues' with the latest drivers?

  • Did you ask in #ubuntu on irc.freenode.net or any of the other places mentioned on http://www.ubuntu.com/support/communitysupport ?

See Also

["BinaryDriverHowto/Nvidia"]

http://wiki.debian.org/NvidiaGraphicsDrivers

[http://www.albertomilone.com/nvidia_scripts1.html Envy] - Automated script to build and install the latest NVIDIA binary driver.

CategoryDocumentation CategoryCleanup