Articles by the Peterborough Linux User Group

To start pageTo NewsletterGo to Memberhip InfoGet Linux CDsTo other articlesTo Meeting LogsTo Software PicksContact Us

Template

This User Group is Sponsored by O'Reilly

 

 

 

List of Articles

 

Upgrading NVIDIA Graphics Drivers after installing a new Kernel

By Clint Gilders, PLUG Secretary

 

 

*Note: This tutorial assumes you are using Mandrake Linux 9.1, but should (with a few modifications) apply equally to other distributions supported by NVIDIA. Please see the Mandrake Secure articles here and here for information on how to safely install a new Kernel under Mandrake Linux.

Unreal Tournament 2003 Screenshot

I want my UT 2003

Whether due to a security hole or because you just felt like it, you've just installed a new kernel. You successfully edited your lilo.conf file to properly boot the new kernel. What could go wrong? If you have an NVIDIA-based graphics card and use the drivers provided by NVIDIA, I'm sorry to say that you'll have one minor problem - X11 isn't going to work! No UT 2003, no Tuxracer, no KDE. Nothing but the lonely bash prompt.

 

Kernel Specific Drivers

The drivers provided by NVIDIA are specific to the distribution and kernel version you are running. When you reboot into your glorious new kernel you'll be greeted by a screen that frantically flashes as X11 tries to start. If you installed the new kernel according to the instructions on Mandrake Secure, you should be able to reboot into a graphical system using your old kernel. Now run (don't walk) to NVIDIA's linux drivers page and download the .run installer file for Linux. Save it somewhere that you won't forget. We'll need it later.

 

Getting back to X

If you are thinking “I'm smarter than you. I'm not going to reboot with my new Kernel until I fix my NVIDIA drivers,” think again! The NVIDIA drivers are compiled/installed against your currently running kernel. You must reboot with your new kernel and install the drivers from the bash prompt (or your shell of choice). To get to that prompt, you can use Mandrake Control Center's XFDrake. Click Options and when asked if you would like X to start automatically select No. A simpler way is to reboot and wait for X to fail miserably. You'll then be left at a login prompt.

Let's reboot into our new kernel shall we?

Ahhhh, the glory of the command line. But unfortunately there's no Quake III on the command line (but maybe someday, seeing as how there is text-mode Quake I and II already).

As root `cd` to the directory where you saved the NVIDIA installer file and run it:

 
# ./NVIDIA-Linux-x86-1.0-VERSION.run

 
You will be prompted to accept the license agreement and the NVIDIA Drivers will be installed. If you have a brand spankin' new kernel that NVIDIA has yet to build their drivers against, the installer will inform you that it needs to compile the drivers specifically for your kernel. Generally this works fine, at least in my experience.

You should note that the installer will remove any previous versions of the NVIDIA drivers from your system. This means that if you run into problems with your new drivers you can't simply boot into your old kernel and expect X11 to work. Keep your fingers crossed and hope you get it right the first time.

Once the installer successfully finishes, you can now manually start X11 (`startx`) or run XFDrake form the command line, re-enable X starting automatically and reboot (reboot or shutdown -r now) into your new kernel and pray that you see the beautiful NVIDIA splash screen as X11 begins it's triumphant return.

 

What if it doesn't work?

You're on your own; well, sort of. The quickest way to get back to a GUI is to go back to using the nv driver included with Xfree86. Start first by making a backup copy of your XF86Config-4 file:

# cp /etc/X11/XF86Config-4 /etc/X11/XF86Config-4-safe

 
Then you remove  any nvidia driver-specific stanzas from your XF86Config-4 File (by telling X to ignore them using # at the beginning). If you are running a single monitor it may be as simple as changing:

 
Driver "nvidia"

 
to

 
Driver "nv"

 
In my dual monitor system:

Section "Device"
Identifier "device1"
VendorName "nVidia Corporation"
BoardName "NVIDIA GeForce2 DDR (generic)"
Driver "nvidia"
Option "DPMS"
Option "TwinView"
Option "SecondMonitorHorizSync" "30-107"
Option "SecondMonitorVertRefresh" "50-100"
Option "MetaModes" "1024x768, 1024x768; 800x600, NULL; 640x480, NULL"
Option "ConnectedMonitor" "CRT, CRT"
EndSection

 
Becomes:

 
Section "Device"
Identifier "device1"
VendorName "nVidia Corporation"
BoardName "NVIDIA GeForce2 DDR (generic)"
Driver "nv"
#Option "DPMS"
#Option "TwinView"
#Option "SecondMonitorHorizSync" "30-107"
#Option "SecondMonitorVertRefresh" "50-100"
#Option "MetaModes" "1024x768, 1024x768; 800x600, NULL; 640x480, NULL"
#Option "ConnectedMonitor" "CRT, CRT"
EndSection

 
Restart X using one of the methods detailed above, and you can then begin troubleshooting. Unless NVIDIA makes changes to its driver configuration, your existing /etc/X11/XF86Config-4 file should work just fine, so an X failure is probably due to something else. First check the X11 error log (/var/log/XFree86.0.log) for hints on why you are being deprived of the GUI. You should also check the NVIDIA Driver readme (a link to the version specific readme is available on the same page from which you download the driver) and try asking a question on the Linux forum at NVnews or at MandrakeUsers.Org. Once you feel you have found the problem, or exhuasted all avenues of help, you can try reinstalling the drivers while being careful to follow - to the letter - the instructions contained in the readme.

 

Final Thoughts

NVIDIA has shown their support for Linux as a viable gaming platform and for that they should be applauded. No, the drivers aren't open source, but not everything linux has to be Free (as in freedom). The new installer is a thing of beauty also. Gone are the days of manually building and installing the kernel and GLX packages and wading through cryptic error messages. We can only hope that the software manufacturers will come to the same realization as NVIDIA and begin offering a greater selection of titles for the Linux platform.

 

Clint is Technical Services Director for Online Hobbyist Inc., and maintains several hobbyist-related webservers such as Kingsnake.com.

 

 

 

©2003 Peterborough Linux User Group, All Rights Reserved. Logos and buttons are used by permission of their respective owners. PLUG can not be held liable for damages resulting from the use or misuse of the information at this website or from its members. Don't run with scissors.
 
Comments can be sent to Jason Wallwork, Webmaster.