Starting with version 1.0-4349, NVidia has provided us with a new method for installing
their Linux drivers. Now, instead of using RPMs or tarballs, we can use a pretty ncurses
interface, packaged into one self-extracting executable script, made possible by
Stephane Peter's
Makeself script. This tutorial will introduce you to this new installer, and walk you
through using it.
REMEMBER: If you update or recompile your kernel, you will be required to reinstall
the NVidia drivers, or else X won't start. This is one great reason why you should
never boot into a GUI login sreen.
This tutorial does NOT require you to recompile your kernel!
Please note that you require XFree86 4.0.1 or higher to use the NVidia drivers.
You will need wget installed, as well as an editor, such as nano or vi, that runs in the
console. On top of that, you need to have your kernel-source installed, as well as gcc, and
any necessary libraries. Basically, you need to be able to compile programs.
If you want to download or view the README file for these drivers online, you can get it here:
README.txt
I will assume that you are logged in as a user and are sitting at the command prompt for
purposes of this tutorial.
Type in
su and hit
Enter. You will be prompted for the root password. Type
that in and hit
Enter.
Now type in
cd /tmp and hit
Enter. This changes us to the temporary directory.
Okay. Now you download the latest NVidia drivers from NVidia's website. At the time of writing,
the current version of the drviers were 1.0-4349, so when a newer version is out, substitute it
in the appropriate lines below. The tutorial is fundamentally the same, and once you install
one version of the driver, you can just update to the next one easily (see the end of this tutorial
for more information).
Type in
wget http://download.nvidia.com/XFree86/Linux-x86/1.0-4349/NVIDIA-Linux-x86-1.0-4349.run
and hit
Enter. This will download the driver installer.
Once it is done downloading, type in
sh NVIDIA-Linux-x86-1.0-4349.run and hit
Enter.
You will be prompted with a licence agreement.
Read it and select Accept.
If you had previous GLX drivers installed, such as the RPMs, you will be prompted about it.
Select Yes to remove the old GLX drivers.
The same goes for the kernel module RPMs.
Select Yes to remove the old kernel module.
Next, you will be asked if you want to download a pre-compiled module from the NVidia site.
I recommend you just say No and compile it in the next step.
As I said:
You have no choice but to choose OK.
Sit and watch it build:
If something goes wrong here, make sure you have all the necessary tools installed, as mentioned earlier.
Once it's done installing, it'll tell you:
Select OK to return to the command line.
You are nearly ready to test out the new drivers.
Type in
vi /etc/X11/XF86Config-4 and hit
Enter. This is assuming that
you don't want to use an alternate editor (ed, nano, joe, emacs, etc). If you prefer
an easier editor, I recommend nano. Note that some distros use the file XF86Config instead
of XF86Config-4.
Now, find the part of the file where it says:
Section "Module"
Load "dbe"
Now, add in a line just after the
Load "dbe" line. It should say this:
Load "glx"
This will tell XFree to load the OpenGL module, which provides 3D accelleration.
Some people have had bad luck using
Load "glx", so they may want to try putting
in
Load "/usr/X11R6/lib/modules/extensions/libglx.so" instead. Note that some
distros may already have the line
Load "glx" in it.
Also, If you see any lines that read
Load "dri" or
Load "GLcore" then
you should remove them.
Next, we need to set XFree to use the NVidia driver. Look for the lines that look
like this:
Section "Device"
Driver "nv"
Change the
Driver "nv" line to read like this:
Driver "nvidia"
Now, save the file and exit the editor.
Now you must ensure that there is a symlink to the proper libglx.so file. Do this by typing
cd /usr/X11R6/lib/modules/extensions/ and hit
Enter. Now that you are in this
directory, type in
ls libglx* and hit
Enter. You should see two files listed,
one of which would be called libglx.so and is a symlink. If you don't, you need to create one
by typing
ln -s libglx.so.1.0.4349 libglx.so and then pressing
Enter. If the
symlink does exist, you can ensure that it is pointing at the proper file by typing in
ls
-l libglx* and hitting
Enter. If it shows that it is not pointing to the proper
file, you should remove it and create a new one. Remove it by typing in
rm -f libglx.so
and hitting
Enter. Then follow the above step to re-create the link.
Now you are done! Switch back to your normal user by typing in
exit and hitting
Enter.
Type in
startx followed by
Enter to start XFree and load your desktop.
In the event that you get an error about loading the nvidia module at this point, then you
can either reboot your system, and all should be well, or, as root, do an
lsmod and
make sure that the driver isn't already loaded. If it is, you can use the
rmmod command
to remove it. If unsure, just reboot.
Once you get there, open a console and type in
glxgears followed by
Enter to
test OpenGL functionality. If the program runs with a resonable framerate, then OpenGL should
be set up properly! On my system (AMD Tbird 1.2GHz/512MB/GF4Ti4200), I get around 3500
frames per second.
Congrats! Now you can go on to the Unreal Tournament or AvP tutorials and enjoy your
new 3D acceleration!
Note that in the future, you can upgrade your drivers just by running the command
nvidia-installer
--update as root. This will download the latest drivers, compile, and install them, assuming
you don't already have the latest version installed. It is safe to run the command, it will report
if you already have the latest version installed.
If you ever want to remove the drivers, run
nvidia-installer --uninstall as root.