|
发表于 2004-7-11 01:24:06
|
显示全部楼层
InstallationHere are the instructions for building and installing your nVidia drivers, the Debian way.
Overview
The nVidia driver consists of two parts: a kernel module, and a collection of user-space libraries. The libraries (aka the "binary driver" or GLX libraries) are distributed in binary form by nVidia, and packaged for Debian in the nvidia-glx package. The kernel module (aka the "kernel interface to the binary driver") is distributed in source form (though with one binary component), and packaged for Debian in the nvidia-kernel-source and nvidia-kernel-common packages. The user libraries and kernel module source only have to be installed once. Then the kernel module has to be rebuilt every time you rebuild your kernel. So, here's what you will do:
Install the kernel module source.
Build and install the kernel and kernel module.
Install the user-space libraries.
Update your configuration.
Step 1 used to require some patching if you were running kernel 2.6, but that's no longer necessary. Step 3 has to be performed after step 2 because of some dependencies, as I explain below.
Steps 1, 3, and 4 have to be performed only once. Step 2 you have to repeat every time you rebuild your kernel, but with make-kpkg and dpkg, it's hardly any work at all.
Installation Instructions
Before you install the Debian nVidia packages, you should choose a distribution, either 'testing' or 'unstable', from which to install them. There is no 'stable' version of these packages at present. At this writing, the nVidia packages in testing and unstable are the same, version 1.0.5336. So for now there's no difference. However the choice you make may affect how your packages get updated in the future, as later versions become available.
Once you've chosen a distribution, put its value into a shell variable NVDIST, by executing one of the following lines:
NVDIST=testing
NVDIST=unstable
I will use $NVDIST to represent this value in all of the commands below. Also, make sure that your /etc/apt/sources.list contains a line like 'deb http://http.us.debian.org/debian $NVDIST main contrib non-free', for your $NVDIST. And if you've just added that line, you need to run 'apt-get update' before continuing below.
Install the kernel module source.
Install the source archive: run
apt-get -t $NVDIST install nvidia-kernel-source nvidia-kernel-common
This will give you a source tarball /usr/src/nvidia-kernel-source.tar.gz.
Unpack the source archive:
cd /usr/src
tar -zxf nvidia-kernel-source.tar.gz
This will unpack the kernel module sources into /usr/src/modules/nvidia-kernel.
Build and install the kernel and kernel module.
Configure your kernel. I won't try to document this step here; if you need to learn how, see the Kernel HOWTO and "How to Upgrade to the 2.6 Kernel". But in summary, all you have to do is
cd /usr/src/linux
make xconfig
and then choose the options you want.
Build the kernel and nvidia kernel module:
cd /usr/src/linux
make-kpkg clean kernel_image modules_image
If you're not familiar with make-kpkg, see "Compiling Kernels the Debian Way" for an introduction. See also the make-kpkg man page, for a description of other options and targets that you can use in this command.
The result of the above command will be two Debian package files, kernel-image-*.deb and nvidia-kernel-*.deb, both in /usr/src. The first file contains your kernel, and the second contains your nVidia kernel module.
At the same time, if you've unpacked the sources for any other add-on kernel modules in /usr/src/modules, then the "modules_image" target will cause make-kpkg to build Debian package files for them, too. For example, the lm-sensors-source package gives you a source archive which, when unpacked, puts the lm-sensors modules sources into /usr/src/modules/lm-sensors. The lm-sensors modules package would get built at the same time, if it worked with kernel 2.6 (which, the last time I looked, it doesn't—sorry).
Install the new kernel and kernel module:
cd /usr/src
dpkg -i kernel-image-*.deb nvidia-kernel-*.deb
Use the fileglobs as above if you want, but watch out that you don't have more than one kernel-image or nvidia-kernel package file lying around in /usr/src. If you do you'll get a blizzard of error messages. It's probably better to explicitly type all of the version information that I rendered as * above.
Install the nVidia user-space libraries. Run
apt-get -t $NVDIST install nvidia-glx
If you're asked whether you want to install the thread-local storage libraries, say yes. Notes:
If your libc6 package is from the stable distribution, then you'll have to upgrade it to testing/unstable in order to complete this step. apt-get will prompt you to do this, and you may have to resolve some conflicts first. libc6 is a core component of GNU/Linux, so if you're running a production server, you may not want to use the version from testing. But for most of us, there shouldn't be any problem. I've been using libc6 from testing for several months now, and found only one minor bug.
If the kernel you installed above is version 2.6.x, and the one you're running now is pre-2.6, then you should reboot with your new kernel before performing this step. The reason is that if you're not running a 2.6-series kernel when you perform this step, the thread-local storage part of the user-space libraries will not be installed. As a result your X server will crash when it tries to load the nVidia driver. If you already installed nvidia-glx earlier under a pre-2.6 kernel, then you can either uninstall and reinstall it while running the new kernel, or, more simply, run 'dpkg-reconfigure nvidia-glx'.
The reason this step has to come after step 2 is that nvidia-glx depends on a virtual package called 'nvidia-kernel-$NVVERSION', where $NVVERSION is the version number of the nVidia driver you've installed. This virtual package is provided by the kernel module package that you built and installed in step 2; so you have to complete that step first.
Update your configuration.
Edit /etc/X11/XF86Config-4:
In the "Modules" section, be sure that you have a line
Load "glx"
and remove or comment out (prepend with a #) any lines that refer to the "dri" or "GLCore" modules.
In the "Device" section for your video card, be sure you have a line
Driver "nvidia"
An open-source alternative is the "nv" driver, which has more limited capabilities.
Create a "video" group, and add to it any users who you want to be able to use the display. You can do this by manually editing /etc/group, or by
addgroup --system video
adduser $USER video
That's it. Your binary driver and kernel interface module are now installed, and should work when you reboot with the new kernel and/or restart your X server. Notes:
For more information about the driver, see:
/usr/share/doc/nvidia-glx/README.Debian
/usr/share/doc/nvidia-glx/README.gz
/usr/share/doc/nvidia-kernel-source/README.Debian
These files contain a lot of useful information about driver options and troubleshooting. Here's an enticement for you to read them: somewhere in one of them you can find an explanation of how to suppress the nVidia splash screen every time you start an X server (hint: search for "NoLogo").
As I said above, you won't ever have to repeat steps 1, 3, and 4 above, as long as you don't uninstall nvidia-glx or change the contents of /usr/src/modules/nvidia-kernel (e.g. by upgrading your driver source).
The kernel module that you built in step 2 is specific to the kernel you built it with. If you rebuild your kernel for any reason, you'll have to compile a new driver module to go with it. But that's what the instructions above tell you to do; if you follow them you should be fine.
Using this method, you don't need any of the following things:
The official nVidia installer from nvidia.com. (The Debian packages contain all the parts of it that you need.)
Any of the patch or installer files available at minion.de. (But thanks to the folks at minion.de for providing those patches, for all of the time when the official nVidia drivers didn't work yet with kernel 2.6.)
The nvidia-kernel-src and nvidia-glx-src packages, which are deprecated. You can also ignore the nvidia-glx-dev package, unless you get complaints from some software (old games?) about missing libGL.so (thanks to Randall Donald for this information).
You can ignore the warning at www.minion.de about carrying along the EXTRAVERSION information if you use --append-to-version with make-kpkg. Because you're using make-kpkg all the way through the build process, it takes care of this for you.
Last updated: 2004-Apr-16 at 16:51
Viewed times since February 18, 2004 |
|