Little Girl's Mostly Linux Blog

NvidiaDriver

NVIDIA Driver Installation

This page was last updated on January 29, 2014.


Table of Contents

Introduction

This guide will take you through the steps needed to install the NVIDIA display driver in Kubuntu. These instructions are known to work for Kubuntu 12.04 Precise Pangolin LTS with the NVIDIA-Linux-x86-319.23.run display driver and may work for other versions as well.

You might want to 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 in case you decide to uninstall the new driver and want to reinstall all the packages you had.

Requirements
  1. Make sure you have Kubuntu 12.04 LTS Precise Pangolin. If you don’t, get it from http://www.kubuntu.org/.
  2. Make sure you know how and why sudo and kdesudo are used. If you don’t, see the Further Information section of this page.
  3. Make a back-up of your xorg.conf file (which provides the basic framework for your GUI environment and will be altered by the NVIDIA driver installation) by opening the /etc/X11 directory in your Dolphin file manager, copying the xorg.conf file, opening your backup directory, and pasting the file into it.
  4. Make sure you have an NVIDIA graphics card. If you don’t, this is the wrong guide for you.
  5. Make sure the default NVIDIA driver is uninstalled by typing this command in your Konsole terminal window and pressing the Enter key to remove any of its packages if they exist on your system:

    sudo apt-get purge nvidia-current nvidia-current-updates nvidia-experimental-304 nvidia-settings nvidia-settings-experimental-304

    Note: You may see a message telling you that one or more or all of the packages are not installed and will, therefore, not be purged. This is expected since these instructions cover more than one possible set-up. Also, if you have any of the packages installed, you will be asked to confirm the purging of the existing package(s). Press the Y key to say yes.

  6. Make sure you have the packages required for this NVIDIA installation by typing this command in your Konsole terminal window and pressing the Enter key to install them if they’re not already installed:

    sudo apt-get update && sudo apt-get install build-essential linux-headers-`uname -r` pkg-config
  7. Make sure you have the latest NVIDIA driver installation file for your card. If not, use Option 1 on the NVIDIA Driver Downloads page at http://www.nvidia.com/Download/index.aspx?lang=en-us to find and download it.
  8. Make sure a copy of the NVIDIA driver installation file is on your Desktop. If not, use your Dolphin file manager to open the directory the file is in, copy the NVIDIA driver installation file, open your Desktop directory, and paste the file into it.
  9. Make a back-up of your NVIDIA driver installation file by opening the Desktop directory in your Dolphin file manager, copying the NVIDIA driver installation file, opening your backup directory, and pasting the file into it.

Install The Driver
  1. Restart the computer in recovery mode:

    1. Open the K menu.
    2. Select Log Out…. from the menu.
    3. Left-click the Restart icon.
    4. Press and hold the Shift key during boot-up right after your BIOS message is displayed to get the GRUB menu to open.
    5. Use the arrow keys to select your kernel’s recovery mode.
    6. The Recovery Menu will open.
    7. Use your arrow keys to highlight the line that says:

      root	drop to root shell prompt
    8. Press the Enter key to get to a root shell prompt.
  2. Type this command and press the Enter key to initialize your home directory:

    cd
  3. Type this command, replacing USERNAME with your user name, and press the Enter key to go to your Desktop:

    cd /home/USERNAME/Desktop
  4. Type this command and press the Enter key to give yourself read/write access:

    mount -o remount,rw /
  5. Type this command and press the Enter key to run the installer and install the driver:

    sh NVIDIA*.run --kernel-name=`uname -r`
    • You will get a warning about skipping the runlevel check because the runlevel utility failed to run. Press the Enter key while the OK button is highlighted.
    • You will be asked if you accept the NVIDIA license. Use your arrow keys to highlight the Accept button and press the Enter key.
    • You will be told that the distribution-provided pre-install script failed and asked if you would like to continue anyway. Use your arrow keys to highlight the Yes button and press the Enter key.
    • You will be asked if you would like to register the kernel module sources with DKMS. Use your arrow keys to highlight the Yes button and press the Enter key.
    • You will be asked if you would like to run the nvidia-xconfig utility to automatically update your X configuration file. Use your arrow keys to highlight the Yes button and press the Enter key.
    • Note: You may receive other notifications or be asked to make other decisions. My rule of thumb is to be as agreeable as possible and either accept whatever the installer suggests or tell it it’s fine when it warns me about something. You may want to do your own research to decide how to handle such notifications, but that’s how I handle them.
  6. Restart the computer:

    1. Type this command to leave the recovery mode:

      exit
    2. Choose resume from the Recovery Menu
    3. Press the Enter key while the OK button is highlighted.
    4. Log in to your operating system normally.
  7. Give yourself root access to the NVIDIA utility:

    1. Right-click the K menu.
    2. Left-click Edit Applications…
    3. Left-click the Settings folder in the left pane.
    4. Left-click NVIDIA X Server Settings in the left pane.
    5. Change the text in the Command box in the right pane to this:

      kdesudo /usr/bin/nvidia-settings
    6. Left-click the diskette in the upper left corner to save the change.
    7. Left-click the X in the upper right corner to close the utility.
  8. Configure the driver or check your card’s temperature, etc.:

    1. Left-click NVIDIA X Server Settings in the Settings submenu in the K menu.
    2. Type in your password at the prompt.
    3. Left-click X Server Display Configuration in the left pane.
    4. Make sure your settings are the way you would like them to be.
    5. Left-click the Save to X Configuration File button in the bottom right (do this even if you made no changes to your settings).
    6. Left-click the Quit button in the bottom right to close the utility.
  9. Restart the computer one more time for a clean boot:

    1. Left-click the K menu.
    2. Left-click Restart in the Leave sub-menu.

Appendix

Maintenance
  • If your operating system’s kernel gets updated, you will need to reinstall the NVIDIA driver by copying the NVIDIA driver file to your Desktop and following the steps in the the Install the driver section.
  • If NVIDIA releases a new driver, use Option 1 on the NVIDIA Driver Downloads page to find and download the driver, copy it to your Desktop, and then follow the steps in the Install the driver section of this page to install it.

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 need to uninstall the current driver before I can install the new one?
If your current driver was installed by following the steps in the Install The Driver section above, you do not need to uninstall the current driver before installing the new one. The installer will offer to uninstall the existing driver and you can accept the offer by pressing the Y key.

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.

I don’t want this driver installed after all. How do I uninstall it?
See the Uninstall The Driver section above for step by step instructions.

Troubleshooting

Uninstall The Driver

If you don’t like the NVIDIA driver or if you are planning to replace your NVIDIA card with a different brand of card, you will need to uninstall the NVIDIA driver. The NVIDIA*.run file you used to install the driver installed the nvidia-installer utility on your computer, and it can be used to uninstall the current driver:

  1. Restart the computer in recovery mode:

    1. Open the K menu.
    2. Select Log Out…. from the menu.
    3. Left-click the Restart icon.
    4. Press and hold the Shift key during boot-up right after your BIOS message is displayed to get the GRUB menu to open.
    5. Use the arrow keys to select your kernel’s recovery mode.
    6. The Recovery Menu will open.
    7. Use your arrow keys to highlight the line that says:

      root	drop to root shell prompt
    8. Press the Enter key to get to a root shell prompt.
  2. Type this command and press the Enter key to initialize your home directory:

    cd
  3. Type this command and press the Enter key to give yourself read/write access:

    mount -o remount,rw /
  4. Type this command and press the Enter key to uninstall the driver:

    nvidia-installer --uninstall

    All the driver files will be deleted, and all the files that were backed up by the installer (like your xorg.conf file) will be restored to their original locations. Your computer should have been returned to the state it was in before you installed the driver.

  5. Enter the list of commands from the http://dragly.org/2012/05/04/installing-the-nvidia-driver-in-kubuntu-12-04/ page to reinstall the default Kubuntu NVIDIA driver.
    Warning: I have not tested these, but they look like they’ll work. You may wish to research various ways of installing the default NVIDIA drivers in Kubuntu before continuing, and then decide which instructions to follow.
  6. Restart the computer:

    1. Type this command to leave the recovery mode:

      exit
    2. Choose resume from the Recovery Menu
    3. Press the Enter key while the OK button is highlighted.
    4. Log in to your operating system normally.
  7. Configure the driver or check your card’s temperature, etc.:

    1. Left-click NVIDIA X Server Settings in the Settings submenu in the K menu.
    2. Type in your password at the prompt.
    3. Left-click X Server Display Configuration in the left pane.
    4. Make sure your settings are the way you would like them to be.
    5. Left-click the Save to X Configuration File button in the bottom right (do this even if you made no changes to your settings).
    6. Left-click the Quit button in the bottom right to close the utility.
  8. Restart the computer one more time for a clean boot:

    1. Left-click the K menu.
    2. Left-click Restart in the Leave sub-menu.

Obligatory Happy Ending

And they all lived happily ever after. The end.

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

Comment:

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 )

Google+ photo

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

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: