How To – Installing Graphics Drivers (NVIDIA)

When I first installed Ubuntu, I found that my Graphics card was not automatically set up properly by the system. This is because it was such a new card that the standard drivers had not yet been configured to work with it.

This guide aims to help others in a similar situation, by explaining how to install your NVIDIA graphics card manually. It also explains a bit about Envy, an alternative, automated driver-installation system. The Envy section comes with a warning though, as I have heard reports that the program is still a bit rough around the edges, and has been known to cause problems. It is also apparently very difficult to uninstall properly, and can conflict with any attempt to install a driver manually at a later time. If in doubt, it’s probably better to follow the instructions for a manual driver install, for now. I didn’t find it that hard.

Contents

1. Contents
2. Restricted Module Drivers (Jockey)
3. Introduction to Envy
4. Manual Installation

5. Using Envy
6. Dual-Screen Monitors

Restricted Module Drivers (Jockey)

If your graphics card is an older one, regardless of whether you have NVidia or ATI, you should have no problems installing it. The Ubuntu installation should have done that for you. In case it hasn’t, the Ubuntu Proprietary drivers are managed from a program called ‘jockey’. You can open this from System > Administration > Hardware Drivers. Then just tick the ‘NVIDIA’ option. Ubuntu will automatically keep these drivers updated and maintain them, and though I have heard reports of problems, most people seem to prefer them. They do not necessarily support the newest cards, however.

There are currently two different methods for installing cards that don’t work out of the box, at least until they update Jockey.

Introduction to Envy

There is a program, that can be downloaded and installed through the Synaptic Package Manager, called ‘Envy’. This will allow you to select the driver you want (for both NVIDIA and ATI), and then it will install it and set it up for you. It’s kept pretty up to date with the current manufacturer-developed drivers.

It sounds pretty useful, especially to a beginner, however the resounding opinion is that it should not be touched. Apparently, it modifies your system in strange and esoteric ways, so that even if you later uninstall it, it leaves a mess and things can break. Basically the advice is, if you do install Envy, you can’t uninstall and choose to install NVIDIA directly later. You would have to complete reformat your system, to make sure it’s clean. It sounds potentially nasty, and is widely unpopular among the people who know. I have even received several criticisms for mentioning it at all! Hopefully it will improve in future. The first method I will describe here therefore is how to install drivers downloaded from the website manually. I will then describe the Envy method, to use as a last ditch fall back if the graphics still don’t work.

Manual Installation

ATI

When it comes to ATI cards, I’m afraid I don’t have a clue, I’m pretty new to this myself. Try asking in #ubuntu or #ati. One day I might be able to post a new how-to for ATI cards, but they do seem to be a bit trickier to set up than NVIDIA.

NVIDIA

This process can seem somewhat daunting at first, but I will try to lay it out step by step, and it shouldn’t be too hard to follow.

Preparation

Build-Essential

First, you need to make sure you have a package called ‘build-essential’ installed, which will allow you to compile your own programs. You wonder why you would ever want to do such a thing, but it’s actually quite a normal way of installing programs you’ve downloaded. You can find build-essential in the package manager, if you go to ‘add/remove programs’ on the application menu of your gnome bar.

Otherwise, you can use the terminal. One thing I am learning is that the terminal is actually a very quick and efficient way of doing things with Linux, and it’s worth learning the commands. The commands for installing programs from a Debian package manager (which is what Ubuntu uses) are ‘apt-get’ to get the package, and ‘install’ to, well, install it! To install programs, you need administration priviledges, which you can get through the command ‘sudo’. Therefore, to get ‘build-essential’ from the command prompt, you would open a terminal, and type:

sudo apt-get install build-essential

Editing Restricted Modules

At this point, I found that if you just install the driver, every time you reboot the system will wipe it and return to the default restricted driver module. To stop that happening, you basically need to tell Linux not to do it. You need to open the restricted modules config file, and edit it to tell it not to enable its NVIDIA drivers.

To do this, you can use your favourite editor, but if you’re new to Linux, you probably haven’t got one yet. The default editor is gedit, and it’s pretty good, so lets use that. Because it’s a graphical program, we use ‘gksudo’ instead of ‘sudo’ to get administration rights, which you will need to save any file you edit outside of your /home directory. In the command prompt, type:

gksudo gedit /etc/default/linux-restricted-modules-common

At the bottom of this file is a line that looks like:

DISABLED_MODULES=””

Edit it so that it looks like this:

DISABLED_MODULES=”nv nvidia_new”

Downloading Drivers

Save that and return to the command prompt. Now we’re ready to install our drivers! To do that, you’ll need to download them first. You can find them at the NVIDIA website. Make sure you’re downloading the Linux drivers for the relevant graphics chipset. Save them somewhere easy to remember, such as your desktop, or a Downloads folder.

Installation

Shutting down X-Windows

To install the drivers, you will need to leave X-Windows, (the graphical desktop) and shut it down. Press CTRL-ALT-F1 to switch into a ‘virtual terminal’. Log in, and you will be given a prompt. This is just a command prompt, without any graphical capabilities. To shut down X-Windows, type:

sudo /etc/init.d/gdm stop

Driver Installation

Now you need to change directory to where you downloaded your driver. You do this using the ‘cd’ command. For example, if I was in my home directory (~) and I downloaded my driver to my ‘downloads’ directory, which was in my home directory, I would change by typing ‘cd downloads‘.

Once in the right directory, we need to install the driver. The NVIDIA drivers come with their own little installation program, so to activate that, we type:

sudo sh NVIDIA

The drivers often have long and complex names, and it’s a pain to type it all. The command prompt has a great feature called ‘tab complete’ which you can use instead. Start off the name, hit ‘tab’, and the rest will be filled in. If there are two files with similar names, it will fill the name in as far as it can, and then you will have to specify with more characters which one you want before hitting tab again.

Choose ‘okay’ for all the options the installer gives you.

Restarting X-Windows

Once it’s done, it will return you to the prompt. Now we need to restart our desktop. Type:

sudo /etc/init.d/gdm start

And that’s it! Your drivers are now installed.

Using Envy

If installing manually did not work for some reason, you can always ask for further assistance on #ubuntu. If all else fails though, you can try Envy.

If you’re using the ‘Gnome’ desktop manager (which you will be if you’re using the default Ubuntu), at the command prompt, type:

apt-get install envyng-gtk

If you’re using the KDE desktop manager (which you will be if you’re using the default Kubuntu), at the command prompt type:

apt-get install envyng-qt

Alternatively, you can open the Synaptic Package Manager through the menus at System > Administration, and search for Envy in there. Again, choose Envyng-gtk or Envyng-qt depending on which Desktop Manager you use.

Once Envy is installed, run it from Applications > System. Choose your Card manufacturer on the left, and then whether you want it to auto-detect the driver you need, or whether you prefer to choose manually. I found auto-detect didn’t work, so I chose manual and selected the latest driver, the version that the NVIDIA website said I needed for my card. Then choose install. That’s it! You now have Envy drivers.

Whichever method you used, you may want to reboot now.

Dual-Screen Monitors

Unlike ATI, setting up dual screen with NVIDIA is quite easy. First, you need to open your NVIDIA-settings with adminstration priviledges. To do this, at the command prompt type:

sudo nvidia-settings

The second option on the left is ‘X Server Display Configuration’. Go to this window. One monitor will be disabled. Click on that monitor, and press the ‘Configure’ button. Choose ‘Twinview’ and okay.

Once you apply, the settings will take hold for the current session, but they will be lost once you reboot. In order to make sure they aren’t, you need to save them to a configuration file called ‘xorg.conf’. Don’t worry though, NVIDIA can do this for you. Press ‘Save X Configuration File’. You won’t be allowed to do this if you didn’t open the program with administration priviledges.

Untick ‘Merge with existing file’. This will mean a backup is created of the original settings if it all goes wrong. This won’t happen if it merges instead. Then save, and quit.

Now reboot your computer. When you return, you should have twinview set up. It doesn’t yet support seperate backgrounds, so you will have to either put up with one background stretched across both screens, or composite your own by sticking the two backgrounds you want together.

That’s it! Graphics, and Two monitors, are now set up! You’re ready to start work.

Advertisements

Leave a comment

Filed under How To, Linux

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