How to install NVIDIA driver in Ubuntu

I'm running Ubuntu 13.04 on DELL XPS L501 - Nvidia GeForce GT 420M. I'm using kernel 3.9.0-030900-generic.

All kernel-headers are installed in the system.

and

I've tried the following.

  • Use apt-get to install nvidia-current (which download 304) && load using modprobe
  • Use apt-get to install nvidia-310 && load using modprobe
  • Download nvidia 64-bit driver nvidia-319.23 for 400M series and install
  • Use swat-x repo to install nvidia driver

All of these failed. And I tested it everytime like this

  • After the module is loaded (checked from lsmod),
  • restarted lightdm
  • tested from get.webgl.org
    • (Google-Chrome webgl support is enabled)

Problem faced with nvidia-xconfig

  • after running nvidia-xconfig (which writes to /etc/X11/xorg.conf), and restarting lightdm, my display res changes to 640x480.
  • and had to remove this file to revert back to old setting
  • Have also tried commenting out those two lines which adjusts Horizontal and Vertical Setting in xorg.conf. That just rectified the resolution. But still I wasn't able to use the graphics card (webgl).

EDIT 1: (nouveau)

  • Tried rebooting after each installation
  • Removed (purge) all of nouveau* before starting.
  • Removed one more package (dont remember the exact name though) - xorg-xserver-blah-blah.

EDIT 2: (bitlbee)

  • I had bitlbee installed before. Removed that too before starting installation.
  • When bitlbee was present, NVIDIA-3.9-x86.run (downloaded from nvidia) was not able to recognize graphics card. But it did when I removed bitlbee. (So I'm assuming here that it should work if graphics driver was installed properly)

EDIT 3: (software-properties-gtk)

  • sudo software-properties-gtk
  • the Additional drivers tab is always NIL. (before and after installation) (even if the installation was successful)

Have been trying this the whole day, and done it quite a few times. None of them worked.

Need help! Is it the problem with kernel-3.9, that there are no updates for this ?


Solution 1:

I found a very good tutorial online, and I was able to install those infamous Nvidia drivers on two computers without a problem. Here is what you do:

Preparation

1) First, you need to open up a terminal shell. You can either start up your computer and go to a virtual shell

Ctrl+Alt+F1

or login and open up the gnome terminal

Ctrl+Alt+t

2) Then In the terminal, run the following commands:

This command will refresh your packages

 sudo apt-get update

Then you will need to install the linux headers if those are not already installed.

 sudo apt-get install linux-headers-generic

Next, you will need to do a dist-upgrade, which upgrade some packages of your system

 sudo apt-get dist-upgrade

When that is all done, you will need to reboot your system

 sudo reboot

The Installation of the Drivers

1) Repeat step one to open the terminal.

Now install the Nvidia drivers

 sudo apt-get install nvidia-current-updates 

You have one more step, or else, you will have a high chance that you just soft-bricked your system. For safe measures, run this final command:

sudo nvidia-xconfig

*There was a well known bug that the Nvidia installation script did not run that command. If that config file is not created, your graphics will not work.

Now reboot your system:

 sudo reboot

Congratulations! You should now be using Nvidia Drivers.

Confirming it Worked

One quick way to check is to click on the gear cog at the top

Cog

Then click About This Computer

In the line that says Graphics, It should say your Graphics driver:

This is what mine looks like:

About Computer Graphics

You can also click on graphics to get more details:

Graphics

Cheers!

Source: http://falkvinge.net/2013/02/15/how-to-install-nvidia-drivers-in-ubuntu-12-10-quantal/

Solution 2:

Though it seems like getting Nvidia driver installed in Ubuntu is a mess. It is not actually like that. All you need to do is follow the steps:

  1. Open the "Software & Updates" from the dash and choose "Software sources".

  2. In the small pop up window, choose all the tick buttons in the first tab. Close it.

  3. Open a terminal and enter the following command. After entering the command, press "Return" key.

    sudo apt-get update && sudo apt-get upgrade
    
  4. Once completed, open "Software & Updates" againand select the tab named "Additional Drivers". There, you could choose between a proprietary version of Nvidia and a few xorg devel versions. Choose the one tagged proprietary. It may take some time to finish downloading depending on your connection.

  5. Once complete download is finished, close the window.

  6. Voilà, you have installed Nvidia driver.

Solution 3:

I noticed that you said 400m series. Usually these days laptops come with optimus technology. If you have optimus then you need to install bumblebee.

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates

Add the Stable Bumblebee Releases PPA and install Bumblebee using the proprietary NVIDIA driver:

  sudo add-apt-repository ppa:bumblebee/stable
  sudo apt-get update
  sudo apt-get install bumblebee bumblebee-nvidia

If you have 32-bit applications like Wine, and run 11.10 Oneiric or later, you will need extra libraries:

  sudo apt-get install virtualgl-libs:i386

Allow yourself to use Bumblebee by adding yourself to the 'bumblebee' group. (replace $USER by your username)

  sudo usermod -a -G bumblebee $USER

Reboot or re-login to apply the group changes If you'd like to run a program on the nvidia card now, use the optirun program:

  optirun firefox &