Monday, April 11, 2005

Installing NVidia driver properly

Having a great graphics card is wonderful, as long as it works right. And in any OS, the secret to things working right, is dependent on the drivers.

I have a Best Force brand GeForce FX 5200 NVidia card, with 128MB of ram. I bought it for my windows games, and since moving to Linux, I wanted the same performance. Google searching for the driver and installation how-to got me most of the way. The graphics driver worked the way it was supposed to, until I rebooted. But there is one key step they almost ALL forgot to add, loading the module on boot. So here are the complete steps I used on my computer:

1. Download the latest drivers from NVidias' website: http://www.nvidia.com/object/linux.html
I am pretty sure I got the IA32 Graphics driver.

2. Open a terminal window and "su" to root. Type "init 3". This will stop the X server, and bring you to a login prmpt at the command line. Log in as root, then move to the download directory (where you saved the driver package). Type "./" to start the install. Here is where problems can come up.

2.1 The first thing that came up was that I did not have the kernel headers installed. The driver install program will use them to create the right module. If they don't exist, it can't move on. If it comes up with an error about no kernel headers, and stops the install, here is what you do. Get back to the command line, and type "init 5". This will bring you back to the GUI. Start up Mandrake Software Installer, and search for "kernel source", and install those. Then try again from step 2

3. After a successful install, we need to reconfigure the "xorg.conf" file to tell the X server what driver to use. To do that, we will use vi, a text editor. If you don't know how to use it, now is NOT the time to attempt it. Google up a vi tutorial. Learn the basics... it should only take 10 minutes tops. As root still, type "vi /etc/X11/xorg.conf" Mandrake makes this xorg.conf a softlink to XF86Config. Other distros just use XF86Config. Whatever works. Change these in the file:
- In Module section, comment out any line with "GLCore" and "dri" by adding a "#" in front.
- In Module section, make sure there is a line that says ' Load "glx" ' (everything inside the single quotes).
- In Device section for video card, change "Driver" name from "nv" to "nvidia".
- Save file and exit.

4. That is where most of the other how-tos stop. Here is where some extra research paid off. The above steps will get it working fine, until you reboot. After that, you would have to load the nvidia module manually each time you rebooted by typing "modprobe nvidia". Here is one way to get it loaded automatically on boot up. Open up vi again with "vi /etc/modprobe.preloa d". Add "nvidia" to a new line, and save the file and exit. There are other ways to add a driver on start-up, this is just one.

5. There are two ways to find out if it all worked. For both, start off by rebooting. The first way, is when you reboot, you should be brought into a GUI, preceded by the NVidia splash screen. Second way is to open up a terminal window, "su" to root, and type "lsmod | grep nvidia". You should see the "nvidia" driver listed.

6. To verify you are getting good performance, type glxgears. There will be three rotating gears, spinning quickly in a seperate window in your GUI. The terminal window you started will show the Frames Per Second (FPS). Click and drag one of the corners of the gear window, and increase the size. Watch the FPS change. If you still get a good FPS at almost full screen size, the card and driver are working perfectly.

Remember, these steps are for Mandrake 10.1, on a GeForce FX 5200. Yours may vary a bit, but the steps are similar.

Happy Gaming!

No comments: