Tag Archives: nvidia drivers

Installing nVidia drivers on Ubuntu

Ubuntu should detect that there is a video card installed and it will ask you to download the drivers, you will get a neat little icon in your tool bar asking if you want to download the driver click here, by all means go ahead and click so that the drivers will be downloaded and installed. These drivers are tested by Ubuntu engineers so it should be safe to download, don’t download the drivers from the nVidia website directly, as it might not have the correct debian package format.

After the download and installation a reboot was required, when I rebooted it Ubuntu would not boot up. The boot would just hang after trying to load the GNOME display Manager. I restarted a couple of times with the same end result.

So it was time to pull my sleeves and get my hands dirty (figuratively of course 🙂 ). I searched around the net and found that there were lot of other people with the same problem. By looking at their solutions, here is the what I did, to get my Ubuntu with nVidia drivers up and running.

First thing I did was to boot in the recovery mode, with default graphics. Just to make sure nothing else was conked up, you always need a starting point. This was a good enough starting point for me, this told me that the problem was with the new drivers and Ubuntu was still running fine. If worst came to worst I could use the default graphics but it just looked terrible and the monitor was running at ~65Hz which was giving me a pretty bad headache so without a better choice I soldiered on to fix the problem.

When I logged into the recovery mode, I got the following message “You do not appear to be using the nVidia X driver. Please edit your X configuration file (just run `nvidia-xconfig` as root), and restart the X server.”. I ran the command and restarted but didn’t work. So time to do it the hard way

The problem could be caused by different user and kernel modules, to fix that you will need to rebuild the kernel modules of the drivers, so download the kernel headers –
$sudo apt-get install linux-headers-$(uname -r)

Now remove the nVidia drivers installed using the command –
$sudo dkms remove nvidia
Download and install the current version of nVidia drivers using the command
$sudo apt-get install nvidia-current

Configure your xorg.conf
$sudo nvidia-xconfig

and restart
sudo shutdown -r

Now the above steps should ideally solve the problem and it did so for many people, but in my case I had to further tweak it, read on to find out –

Noveau is the acclerated open source driver for nVidia, which was already installed on my Ubuntu and wasn’t working very well. So instead we need to use the drivers provided by nVidia, remove the Noveau drivers using the following command
$sudo apt-get remove xserver-xorg-video-nouveau

Now open /etc/modprobe.d/blacklist.conf file in an editor and add this line at the bottom:
blacklist nouveau
Save the file and close it.

Now open /etc/modprobe.d/nvidia-graphics-drivers.conf file and these lines

blacklist nouveau
blacklist lbm-nouveau
blacklist nvidia-173
blacklist nvidia-96
alias nvidia nvidia-current

Save the file and close it.

Configure the driver
sudo nvidia-xconfig

And restart,
sudo shutdown -r

This did the trick for me, I was able to boot up Ubuntu with the nVidia driver installed correctly.

If at any point to of time you want the Noveau drivers back, in case it gets stuck during the boot up, go into the console mode and run the command
sudo apt-get install xorg-xserver-video-nouveau

Ofcourse you will have to remove nouveau from the black list.

Compiled from the following solutions/websites –
http://blog.musicvm.com/solved-you-do-not-appear-be-using-nvidia-x-driver-linux-ubuntu
http://askubuntu.com/questions/37590/nvidia-drivers-not-working-after-upgrade-why-can-i-only-see-terminal
https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia
http://manpages.ubuntu.com/manpages/lucid/man1/nvidia-settings.1.html