How To Install NVidia drivers in Mandrake 8.0|
So you have Mandrake 8.0 installed and have found it to be a most excellent operating system, but you miss the really high-end games like Quake III and Unreal Tournament.
Well, you're in luck, this article will explain in "newbie" style how to load and configure NVidia's Linux driver for the TNT, TNT2, GeForce, GeForce2 and GeForce3 video
cards under Mandrake 8.0. In keeping with tradition at LittleWhiteDog, there will be plenty of pictures for you to see exactly how things are done step by step. I will
discuss some of the problems I encountered while loading and configuring the drivers as well as what I did to overcome those obstacles. If you own an NVidia graphics card
and want to use hardware driven OpenGL in Mandrake 8.0, start reading.
As with any major undertaking such as this, there are some things that need to be completed before you get into the heart of the procedure. First and foremost, you need to
have a working installation of Mandrake 8.0. If you need help with this please
read this article on how to install Mandrake 8.0. You'll also need to download the kernel drivers and OpenGL libraries from
NVidia's website or click on the links below.
Some of you may be asking, "Why didn't he use the RPM packages?". Well, we don't know which kernel version the RPMs were built with and I found
while installing them, the RPMs for Mandrake 8.0 were built using the 2.2.x kernel, not the 2.4.3 kernel, which is the default for Mandrake8. Its
therefore necessary to build the drivers and OpenGL libraries yourself from the tarballs (those are the files that end it *.tar.gz or *.tgz). If you are
using an SMP kernel, these again are built using the 2.2.x kernel. Besides, building your own is fun and you just might learn something. There will be
plenty of times in your Linux life that will require you to build from a tarball, so this will also be great experience.
An important requirement for the NVidia drivers/libraries is XFree86 4.0 or better. During Mandrake's install, it asks you if you want to load XFree86-3.3.6 or
XFree86-4.0.3. I hope you picked the latter, but if you didn't, I'll briefly explain in the next section how to install XFree86-4.0.3. One of
the differences,that we'll be concerned with in XFree86-4.0.x is it's configuration file: XF86Config-4. This file differs from what XFree86-3.3.x
uses (XF86Config) and can cause a bit of confusion, but I'll cover that too.
One last thing you need to do before proceeding is verify you have the kernel source files loaded. When I installed Mandrake 8.0 on my test PC,
I found the kernel source files, make and a few other necessary programs were not present. Thankfully, Mandrake has a wonderful
software tracking/installation tool, as pictured above, that will allow us to load any packages that we need. I'll cover the installation of the kernel
source files in the XFree86 installation instructions. Now, go to "/usr/src" directory, either by the command line or from a GUI file manager, there
you should see a symlink (shortcut for you Windows users) called "linux" and a directory called "kenel-2.4.3". If you don't see them or there is
something different, its a good bet the kernel source files are not installed. Remember this guide is for Mandrake 8.0, other distributions as well as
other versions of Mandrake may have the kernel source files in a different directory. If you choose the "Developement" package during Mandrake8's
installation you should get the kernel source files and all other necessary programs to build the driver package. Warning:
The kernel source files are very big so make sure you have space on your drive for it and the other programs.
XFree86 and Kernel sources
Since installing XFree86 4.0.3 and the kernel sources are very similar I'm going to cover both of them in one section. If you haven't noticed all of my
screen caps are from the KDE environment so things might look just a bit different if you are using a different GUI. Also, I logged in to KDE as "root"
so I wouldn't have to worry about having enough rights to install system software. In fact I was logged in as "root" for everything except the
downloads. Normally, you don't want to be logging in as "root", but this is one of those times were it is acceptable. You can, if you set your
security option to "Low", be logged in as a user, since Mandrake will prompt you for the "root" password giving you the access required. Go ahead and
open up the Software Manager, an icon should be present on the desktop. It would also be a good time to locate the Mandrake installation CDs so they are
handy when the Software Manager asks for them. If you look on the left side of the window that pops up, near the top, you will see two tabs; Installed
and Installable. Then right below those tabs you'll see a pull down bar titled "All". Pull it down and choose "Uninstalled only", this will change the
list of programs to only show those packages not installed. Look down from the pull down menu, there are two more tabs; Tree view and Flat list. I
prefer to use the flat list, that's what I screen capped, so go ahead and click on the "Flat list" tab.
Scroll down through the list, until you see "kernel-source" and place a check mark in the box next to it. Now continue scrolling down till you see
XFree86-4.0.3 and place a check in the boxes as shown in the picture above. The beauty of the Software Manager will become very apparent as you click on
the Install button at the top. Mandrake, as well as most other distributions, checks to see if there are any other programs that need to be installed to
fully support the choices you have made. The kernel sources have quite a few, so the Software Manager will automagically install
the other programs. Once it is done, you can go back into the Software Manager and take a look at the Installed packages section to see if they show up.
After you have successfully installed and have a fully functional OpenGL NVidia driver, I highly recommend coming back to the Software Manager to see if
there is any more stuff you'd like to have installed. If you're lucky enough to have the Power Pack edition there will be tons of programs available for
In order to complete your XFree86-4.0.3 installation, we now have to setup Linux to use the newer version. Exit out of the Software Manager and fire up
the Mandrake Control Center. Under the Hardware section go to the Display option and click on the Expert button in the bottom right corner. The very
first thing that will pop up is the choice between Xfree86-4.0.3 and 3.3.6. Follow through with the rest of the choices, picking a monitor, video card,
resolution and color depth. Make sure you test your configuration to see if its all going to work properly, then save your setup and reboot. After the
reboot you should now be using XFree86-4.0.3, but just to make sure, we are going to delete the old XF86Config file. As "root", open up a file manager
working your way to /etc/X11. In that directory you will see an XF86Config and also an XF86Config-4, delete the XF86Config file and any backup files.
You'll know a backup file, because it will have a tilda at the end of it, ie XF86Config~. Reboot again and if everything comes up correctly then you know
that your XFree86 installation was successful and the system is not trying to still use the XF86Config file.
Ok, you have a fully functional XFree86-4.0.3, the kernel sources are installed and the necessary files have been downloaded. Find a quiet directory
somewhere that will be easy to get to, I like to use my home directory. I usually create a directory called "tmp" where I can dump stuff for temporary
storage. Where ever you choose is fine with me, so long as you have the NVidia kernel driver and OpenGL libraries there. As pointed out to me by a few
readers of my last article, the Linux command line is not a bad place, but a powerful tool. So, I'm going to do these last steps while in the command
line; some from a terminal window and some completely out of the Xwindows GUI. I'll have as many pictures as possible so you can follow along, but the
very last steps I was unable to screen cap, sorry. Now open a terminal window and you should be presented with a small window sitting at the command prompt.
The current directory will be the home directory of the user you are logged in as. So if you are "root", you'll be in root's home directory. At this point
you can be logged in as a user, we don't need "root" priviledges just yet. Change to the directory where the NVidia files are located using the "cd"
command, ie "cd /home/rover/tmp" and then issue the "ls" command to get a listing of the contents of this directory. You can use the "dir" command to
get a listing (if you're using the bash shell), but "ls" is much better and color codes files for you based on their function.
To unpack the tarballed files, issue the command "tar zxvf NVIDIA_kernel-1.0-1251.tar.gz". Ooo, did you see that? [hillbilly] All them there files just unpacked
lickety split. [/hillbilly] Do the same thing for the GLX tarball. Here's a lovely little hint for you newbies. When you have a really
long file name, such as these, type in the command, the switches (those are the "zxvf") and a portion of the file name (NVIDIA_k). Then tap the "ESC" key
twice and it will fill in the rest for you. Actually, it will fill in the rest up to the point where it finds a duplicate. I'll explain. Say you have
NVIDIA_kernel-1.0-1300.tar.gz and NVIDIA_kernel-1.0-1251.tar.gz and you type NVIDIA_k after which you hit the "ESC" key twice. Linux will complete up to
NVIDIA_kernel-1.0-, because at that point there are 2 choices. Still it is handy for long names and Linux loves long names.
Issue the "ls" command and you should now see two directories, plus the two original tarballs. We are now ready to log out of Xwindows and work
completely from the Command Line. Don't get scared, this is easy stuff. The more you use the CLi (Command Line Interface) the more comfortable you'll be.
Once you become familiar with the CLi, I have a strong feeling you'll be in there more and more often. I love it, since I learned Linux using the CLi and
GUIs were just a play thing. Make a mental note where the files are located and log out to the Console.
Installing the Kernel Driver
Once at the CLi, log in as "root". Issue the "cd" command and get to the directory where you extracted the NVidia kernel driver files. For me it would of
been "cd /home/rover/tmp/NVidia_kernel-1.0-1251". Hint: If you hold down the Alt key and hit the F2 key you'll open up
another virtual terminal. You can log in as "root" again and do thing while the other terminal is performing tasks. To get back to the original terminal
hold down the Alt key and hit the F1 key. Viola! you are back to the first virtual terminal. You can have up to 8 or 9 of these terminals, logged in as
whom ever you wish.
Enough with the tips and tricks, we are now sitting within the directory of the extracted kernel driver and are ready to issue the "make" command. Remember, you must be root! Type in "make SYSINCLUDE=/usr/src/linux/include". The SYSINCLUDE switch will guarantee that we are using kernel-2.4.3's build files, but really this is not necessary. If your system is setup correctly, the SYSINCLUDE switch could be left off. Anyways, you'll see a bunch of Linux geek speak fly across the screen and then it will be over. Nothing really to look at, just be sure you don't see any lines beginning with "error". If you happen to get an error, take a look at that line, it should give the reason for the error. I couldn't possibly predict every error you'll receive so visit the LWD Forum link at the bottom of this article and post your problem. Our community will do it's best to help you out. You saw no errors, so you are now the proud owner of a brand new shiny NVidia kernel driver. Yipee!
Installing the OpenGL libraries
If you received no errors with the kernel driver install, then you can simply change directories to the unpacked OpenGL libraries. This step is the main reason we are not in Xwindows. It will compile and then replace the software driven OpenGL libraries (aka Mesa OpenGL) with the hardware driven NVidia OpenGL libraries. Simply issue the "make" command while in the unpacked GLX directory and viola you're are all done with the installation. We are not completely done with this procedure, so don't get all mushy on me just yet. Our next step is to modify the XF86Confi-4 file.
Since each persons PC is a little different, the screen caps for this section will be slightly different as compared to yours. There will be two sections we will be working on, the "Modules" section and the "Display" section. I like to use a program called Midnight Commander to modify files while at the CLi. To get started issue the command "mcedit /etc/X11/XF86Config-4". Hint: Linux and Unix are case sensitive so make darn sure you have things typed correctly. Anyways, MC (Midnight Commander) will open XF86Config-4 in color and then using your arrow keys scroll down to the "Module" section.
Simply add a line right below Load "dbe" that reads Load "glx". This will tell Xwindows to load the NVidia OpenGL libraries at start up. You should end up with something that looks like the picture below.
Now scroll down a little further, until you see the "Display" section. You might see a couple of different displays configured here, but we are concerend with the section that makes reference to NVidia and it's video cards. Change the driver line from "nv" to "nvidia"...aww heck just make it look like the image below. Just a quick reminder, any line with the # symbol in front is considered a comment and has no effect on the operation of the configuration file.
I'm sure by now you are getting anxious to see if this whole thing works, but a reboot at this time is NOT a good idea. Don't reboot just yet! If you have Mandrake 8.0 set to boot directly to Xwindows then I strongly suggest you change it so you boot to a command prompt instead. This way if Xwindows doesn't work the PC won't hang at boot up and you'll have a chance to fix things. How do you do that you ask? Simply, mcedit the inittab file found in the /etc directory.
Once you have the file open you should see a line just a few places down from the top that says "id:5:initdefault:". This one line tells Linux to boot directly to the Xwindows system. If you look just above that you'll see the programmers remarks describing each of the 6 runlevels available. Just change the "id:5:initdefault:" to "id:3:initdefault:", save the file and reboot at your leisure. Oh, you don't know how to reboot from the CLi! Type "reboot -n" at the CLi and watch your system come to a wonderfully smooth halt.
After you reboot, issue the command to start the Xwindows system with "startx". If all goes well, you should be greeted with a big white screen and an NVidia logo smack dab in the center just before the desktop shows up. All you have to do now is change your runlevel back to 5 in the /etc/inittab file and you are all set. If you are having problems getting things to work, please visit our Forums for assistance. I'd be glad to help! Oh my gosh, I didn't post any benchmarks! Hehehe, you're going to have to wait for my next article for those...sorry!
NOTE: The author of this article is no longer working at this site. Please do not attempt to e-mail questions to him, as they will not be answered. He does however still hang out in our forums, and there are many other experts there as well who can help you if you run into problems. The thread assiciated with this article can be found here.
Copyright © by LWD All Rights Reserved.
Published on: 2004-01-25 (36985 reads)[ Go Back ]