Little Girl's Mostly Linux Blog

NvidiaDriver


NVIDIA Driver Install

This page was last updated on June 11, 2009.

Table of Contents

Introduction

This guide will take you through the steps needed to install the NVIDIA display driver in Ubuntu or Kubuntu.

  • These instructions are known to work for:
    • Kubuntu or Ubuntu 8.04 Hardy Heron LTS or earlier.
    • NVIDIA display driver version 169.07 for Linux x86.
    • NVIDIA display driver version 173.14.12 for Linux x86.
    • NVIDIA display driver version 180.51 for Linux x86.
  • They may work for other versions of the NVIDIA display driver as well.
  • They will not work for Kubuntu with KDE4.

How To Use This Document

  • Make sure you meet the requirements in the Requirements section of this document.
  • Use the Install The Driver section to install the driver.
  • Make notes on paper or in a text file to remind you of which files you did or did not have on your system before installing the driver.
  • See the Appendix for Maintenance, Further Information, Questions and Answers, Troubleshooting, Recovery, and Getting Help.

Requirements

  • Ubuntu or Kubuntu 8.04 LTS or earlier.
  • An understanding of the difference between sudo, gksudo and kdesu. For more information, see the Further Information section.
  • An NVIDIA graphics card that uses the NVIDIA display driver for Linux x86.
IMPORTANT
These instructions were tested with NVIDIA display driver version 169.07
for Linux x86 and version 173.14.12 for Linux x86. See “Will these
instructions work for other NVIDIA drivers?” in the Questions & Answers
section if you’re installing a different version.

Install the driver


Step 01 – Create a backup directory

  1. Type this command in a terminal window to create the mynvidiabackups directory in your /home/username directory:
  2. mkdir ~/mynvidiabackups

    Press the Enter key.

Step 02 – Back up your xorg.conf file

  1. Type this command in a terminal window to copy your xorg.conf file to the mynividiabackups directory you just created:
  2. sudo cp /etc/X11/xorg.conf ~/mynvidiabackups/xorg.conf

    Press the Enter key.

Step 03 – Check your kernel name and version

  1. Type this command in a terminal window to view the kernel release (kernel name and version):
  2. uname -r

    Press the Enter key.

    • Example output of the command:
    • 2.6.24-21-generic

Step 04 – Make sure you have these packages

Open your package manager (Synaptic in GNOME and Adept Manager in KDE) and do a search for each of these packages to make sure they’re installed, installing any that aren’t:

  • build-essential
  • linux-kernel-devel
  • pkg-config
  • xserver-xorg-dev
  • linux-source-2.6.24
    • The version number must match the output from Step 03.
  • linux-headers-2.6.24-21
    • The version number must match the output from Step 03.
  • linux-headers-2.6.24-21-generic
    • The version number and name must match the output from Step 03.

Step 05 – Make sure you don’t have the nvidia-glx package

Open your package manager (Synaptic in GNOME and Adept Manager in KDE) and do a search for this package:

  • nvidia-glx

If the package isn’t installed, go to Step 06. If the package is installed, remove it thoroughly:

  • In Adept Manager:
    • Right-click the package name.
    • Choose Request Purging.
    • Click Apply Changes at the top of the screen.
  • In Synaptic:
    • Right-click the package name.
    • Select Mark for Complete Removal.
    • Click the Apply button.
  • In a terminal window:
    • Type this command:
    • sudo apt-get --purge remove nvidia-glx

      Press the Enter key.

Step 06 – Make sure you don’t have the nvidia-glx-new package

Open your package manager (Synaptic in GNOME and Adept Manager in KDE) and do a search for this package:

  • nvidia-glx-new

If the package isn’t installed, go to Step 07. If the package is installed, remove it thoroughly:

  • In Adept Manager:
    • Right-click the package name.
    • Choose Request Purging.
    • Click Apply Changes at the top of the screen.
  • In Synaptic:
    • Right-click the package name.
    • Select Mark for Complete Removal.
    • Click the Apply button.
  • In a terminal window:
    • Type this command:
    • sudo apt-get --purge remove nvidia-glx-new

      Press the Enter key.

Step 07 – Make sure you don’t have the nvidia-glx file

  1. Type this command in a terminal window:
  2. ls /etc/init.d/nvidia-glx

    Press the Enter key.

  3. If you don’t have it, go to Step 08. If you have it, back it up by typing this command:
  4. sudo cp /etc/init.d/nvidia-glx  ~/mynvidiabackups/nvidia-glx

    Press the Enter key.

  5. Then remove it by typing this command:
  6. sudo rm /etc/init.d/nvidia-glx

    Press the Enter key.

Step 08 – Make sure you don’t have the nvidia-kernel file

  1. Type this command in a terminal window:
  2. ls /etc/init.d/nvidia-kernel

    Press the Enter key.

  3. If you don’t have it, go to Step 09. If you have it, back it up by typing this command:
  4. sudo cp /etc/init.d/nvidia-kernel  ~/mynvidiabackups/nvidia-kernel

    Press the Enter key.

  5. Then remove it by typing this command:
  6. sudo rm /etc/init.d/nvidia-kernel

    Press the Enter key.

Step 09 – Make sure you don’t have the nvidia_new_installed file

  1. Type this command in a terminal window:
  2. ls /lib/linux-restricted-modules/.nvidia_new_installed

    Press the Enter key.

  3. If you don’t have it, go to Step 10. If you have it, back it up by typing this command:
  4. sudo cp /lib/linux-restricted-modules/.nvidia_new_installed ~/mynvidiabackups/.nvidia_new_installed

    Press the Enter key.

  5. Then remove it by typing this command:
  6. sudo rm /lib/linux-restricted-modules/.nvidia_new_installed

    Press the Enter key.

Step 10 – Edit the linux-restricted-modules file

  1. Type this command in a terminal to check if you have the file:
  2. ls /etc/default/linux-restricted-modules

    Press the Enter key.

  3. If you don’t have it, go to Step 11. If you have it, back it up by typing this command:
  4. sudo cp /etc/default/linux-restricted-modules ~/mynvidiabackups/linux-restricted-modules
  5. Then open the file with one of these commands:

    • Kubuntu users type this command:
    • kdesu kate /etc/default/linux-restricted-modules

      Press the Enter key.

    • Ubuntu users type this command:
    • gksudo gedit /etc/default/linux-restricted-modules

      Press the Enter key.

  6. Add the information in quotes in this line to the DISABLED_MODULES line:
  7.   DISABLED_MODULES="nv nvidia_new"
  8. Save the file and exit the editor.

Step 11 – Edit the linux-restricted-modules-common file

  1. Type this command in a terminal window to check if you have the file:
  2. ls /etc/default/linux-restricted-modules-common

    Press the Enter key.

  3. If you don’t have it, go to Step 12. If you have it, back it up by typing this command:
  4. sudo cp /etc/default/linux-restricted-modules-common ~/mynvidiabackups/linux-restricted-modules-common
  5. Then open the file with one of these commands:

    • Kubuntu users type this command:
    • kdesu kate /etc/default/linux-restricted-modules-common

      Press the Enter key.

    • Ubuntu users type this command:
    • gksudo gedit /etc/default/linux-restricted-modules-common

      Press the Enter key.

  6. Add the information in quotes in this line to your DISABLED_MODULES line:
  7.   DISABLED_MODULES="nv nvidia_new"
  8. Save the file and exit the editor.

Step 12 – Download the driver

  1. Use Option 1 on the NVIDIA Driver Downloads page to manually find the driver for your card.
  2. Download the driver to your /home/username/Desktop directory.
    • If it downloads to some other location, please move it to your /home/username/Desktop directory.
    • It’s also a good idea to make a backup copy of the file.

Step 13 – Edit your xorg.conf file

This step is just a precaution, but I highly recommend that you follow it. Since you’ve removed your display driver, your xorg.conf file now has incorrect information in it. If you run into any issues in the remaining steps, you’ll have trouble rebooting because your computer will try to load the drivers you no longer have installed. To prevent any possible issues, you’ll want to temporarily use a generic display driver.

  1. Open the xorg.conf file with one of these commands:

    • Kubuntu users type this command:
    • kdesu kate /etc/X11/xorg.conf

      Press the Enter key.

    • Ubuntu users type this command:
    • gksudo gedit /etc/X11/xorg.conf

      Press the Enter key.

  2. Look through the file and find a section called Section “Device”. There will likely be several sections called Section “Device”, but the one you’re looking for will be one that has an Identifier of “Configured Video Device“. It will look something like this example (your driver may have a different name or there may be more lines of information in the section in your file):
  3.   Section "Device"
          Identifier     "Configured Video Device"
          Driver         "nvidia"
      EndSection
    
  4. Edit the Driver line, changing it to “vesa” as in this example:
  5.   Section "Device"
          Identifier     "Configured Video Device"
          Driver         "vesa"
      EndSection
    
  6. Save the file and exit the editor.
  7. Copy the edited file to the backup directory under a new name you’ll recognize by typing this command:
  8. sudo cp xorg.conf ~/mynvidiabackups/xorg.conf.safegraphics

    Press the Enter key.

Step 14 – Restart the computer in recovery mode

  1. Restart the computer:
    • Kubuntu users:
      1. Open the K menu.
      2. Select Log Out…. from the menu.
      3. Left-click the Restart icon.

    • Ubuntu users:
      1. Open the Main Menu
      2. Select Quit… from the menu.
      3. Left-click the Restart icon.
  2. Press the Esc key when the GRUB menu comes up.
  3. Use your arrow keys to select your kernel’s recovery mode.
  4. The Recovery Menu will open.
  5. Use your arrow keys to highlight the line that says:
  6. root	drop to a root shell prompt

    Press the Enter key to get to a root shell prompt.

  7. Type this command to get to your Desktop, replacing USERNAME with your username.
  8. cd /home/USERNAME/Desktop

Step 15 – Run the installer

  1. Type this command to install the driver:
  2. sh NVIDIA*.run --kernel-name=`uname -r`

    Press the Enter key.

    IMPORTANT
    Those are backticks (`) and not apostrophes (‘) in the above command.

Step 16 – Let the installer run nvidia-xconfig

The installer will ask if you’d like to let it run nvidia-xconfig. Say yes by typing the letter y and pressing the Enter key. It will run automatically.

Step 17 – Restart the computer

  • Type this command to leave the recovery mode:
  • exit
  • Lot in to your operating system normally.

Step 18 – Configure the driver

If you’d like to configure the driver or check your card’s temperature, etc., look in your System menu for an entry named NVIDIA X Server Settings.


Appendix

Maintenance

  • If your operating system’s kernel gets updated, you will need to reinstall the NVIDIA driver:
    1. Copy your backed up NVIDIA driver to the Desktop.
    2. follow Step 13 through Step 20 from the Install the driver section.

  • If NVIDIA releases a new driver, you may want to install it:
    1. Follow Step 01 through Step 06 from my NvidiaRecovery page to remove the current driver.
    2. Follow Step 12 through Step 20 from the Install the driver section of this page.

Recovery

See my NvidiaRecovery page to undo your installation of the NVIDIA driver.

Further Information

Questions and Answers

How do I know which NVIDIA driver I should use?
Go to the page at http://www.nvidia.com/Download/index.aspx?lang=en-us and either fill out the form or opt to have the driver automatically detected for you.

Will these instructions work for other NVIDIA drivers?
They should work for any NVIDIA graphics drivers, but if the driver version numbers aren’t listed on this page, they haven’t been tested by me.

When NVIDIA releases a new driver, do I have to uninstall the old version before I can install the new one?
I don’t believe it’s necessary, but in the interest of thoroughness, the instructions in the Maintenance section include instructions on removal of the outdated driver.

I have a question that hasn’t been asked here. How do I ask it?
If you use the contact address at the top of this document, you will receive a reply via email and your question may be added to this section.

Troubleshooting



Obligatory Happy Ending

And they all lived happily ever after. The end.

Back to top

2 Comments »

  1. Step 04: I found that it wasn’t sufficient to install linux-source2.6.24: that just downloads a tarball. I also had to cd to /usr/src and then
    sudo tar xvif linux-source-2.6.24.tar.bz2 . Found this instruction at https://help.ubuntu.com/community/NvidiaManual.
    Yours is a brilliant how-to, as usual.

    Comment by Jim Anderson — June 13, 2009 @ 9:03 pm

    • Thanks for the heads-up! Was it only linux-source that you had trouble with, or also linux-headers? I’ll add a note to Step 04 for anyone who has this problem.

      Another thing I want to do with this guide is figure out once and for all how to put Ubuntu/Kubuntu into a specific runlevel. When this guide is followed, the NVIDIA installer issues a warning about the runlevel. The warning can be ignored, but I’d like to figure out how to specify the correct runlevel so there is no warning, and – most importantly – so that the installer is happy. (:

      Comment by mostlylinux — June 14, 2009 @ 5:20 pm


RSS feed for comments on this post. TrackBack URI

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 )

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

Theme: WordPress Classic. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.