HowTO: Manually Compile NViDIA Drivers in Ubuntu

This is the shortened “in a nutshell” version of my guide here.

So, here goes:

Backup your current configuration.

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.xonf.original

Install all build dependencies.

sudo apt-get install build-essential pkg-config linux-headers-$(uname -r)

Remove all traces of the Ubuntu version of NViDIA on your system

sudo aptitude purge $(dpkg -l | grep nvidia | awk '{print $2}')

Download the driver from the  nvidia download site.

For 32bit systems using the 185 Driver:

wget ftp://download.nvidia.com/XFree86/Linux-x86/185.18.36/NVIDIA-Linux-x86-185.18.36-pkg0.run -O NVIDIA-Linux-185.18.pkg.run

For 64bit systems using the 185 Driver:

wget ftp://download.nvidia.com/XFree86/Linux-x86_64/185.18.36/NVIDIA-Linux-x86_64-185.18.36-pkg0.run -O NVIDIA-Linux-185.18.pkg.run

If you use a legacy card that is not supported by the 185 driver, you can download the right one accordingly here for 32bit or here for 64bit.

Install the installer into the /usr/src directory and create an easy link to it.

sudo install NVIDIA-Linux-185.18.pkg.run /usr/src
sudo ln -fs /usr/src/NVIDIA-Linux-185.18.pkg.run /usr/src/nvidia-driver

Save and close all work, then kill X.

sudo service gdm stop

Login to a VT, and run the installer.

sudo sh /usr/src/nvidia-driver

Once the installer finishes, restore the backed up xorg.conf

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

And restore X.

sudo service gdm start

Congratulations, you now are running on your own manually compiled drivers.

One caveat with this that you must recompile every time there is a kernel update. For a guide on how to automate this procedure, see here.

To upgrade from your manually compiled the 185 drivers to the latest 190 beta, you would run through the current procedure.

Download

wget ftp://download.nvidia.com/XFree86/Linux-x86/190.32/NVIDIA-Linux-x86-190.32-pkg0.run -O NVIDIA-Linux-190.32.pkg.run

Install into the /usr/src directory, and override your existing symlink

sudo install NVIDIA-Linux-190.32.pkg.run /usr/src
sudo ln -fs /usr/src/NVIDIA-Linux-190.32.pkg.run /usr/src/nvidia-driver

Save and close all work, then kill X.

sudo service gdm stop

Uninstall NViDIA, to ensure a smooth transition.

sudo nvidia-uninstall

Run the installer as per previous method.

sudo sh /usr/src/nvidia-driver

And restore X.

sudo service gdm start

simple, eh?

Advertisements

About ibuclaw
An avant developer and support analyst.

2 Responses to HowTO: Manually Compile NViDIA Drivers in Ubuntu

  1. ffcode says:

    thanks for such a neat guide, have been trying to set higher resolution of late but couldn’t get it done hoping to do it via your guide followed here via your thread on ubuntuforums thanks again. :)

  2. alfa says:

    Thanks a lot! successfully done on my laptop following this guide..

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: