[SLUG] Debian, XFree86 and Nvidia Geforce 4

Gavin Baker za at supercowpowers.org
Sat Jan 25 22:45:00 GMT 2003


On 24 Jan 2003 15:50:36 +0000
Chris Sutcliffe <chris at chrissut.worldonline.co.uk> wrote:

> Everything is now working thanks to Gav. He popped round and sorted
> it. It feels a bit like cheating but what the heck its up and running
> now and I am as happy as a very happy person can be :) Cheers Gav.
> 
> I know he installed a kernel more relevant to my machine (optimised
> for a Athlon K7) and installed kernel headers, then installed the
> Nvidia drivers but for exactly how he did it, I'll leave it up to him
> to eplain. I tried to take note of what he was doing but he types so
> fast and uses shortcuts 'n' stuff and my poor eyesight did n't help,
> plus I had to make the tea...and..and...and....I've run out of excuses
> :/

It's really simple! :)

Nvidia's binary nvdriver needs to look at a few of your kernel config
options[1] to be able to compile itself (well, wrap the binary driver up
into a kernel module) to work with your running kernel.

The first error you will get if it can't find your configured kernel
source is one that complains about modversions.h[2], which is only
created when you do "make dep" in a kernel source tree.

To be able to "make dep" you need to have configured your kernel source,
ie, have a .config file in your linux kernel source dir. "make
(config|menuconfig|xconfig)" creates this.

Debian's (and some other distro's) binary kernel-images come with the
.config that was used to build the kernel-image, and puts this in
/boot/config-<kernel-version>.

So all we need to do to configure our kernel source the same way as our
running kernel is to copy /boot/config-<kernel-version> to
kernel-source-dir/.config and run "make oldconfig" (to be safe) and
"make dep".

We can then just type "make" in the nvidia-kernel-module dir to compile
and install the nvidia module.[3]

If you want it to load on boot, just add it to /etc/modules.

Simple, right? :)

Regards,
Gav


[1] It's very hard to determine whether some features have been enabled
in your currently running kernel. 2.6.x will have a feature to dump a
.config from a binary kernel image. Good idea that.

[2] Shows whether or not you have enabled CONFIG_MODVERSIONS. From
Documentation/Configure.help

CONFIG_MODVERSIONS
  Usually, modules have to be recompiled whenever you switch to a new
  kernel.  Saying Y here makes it possible, and safe, to use the
  same modules even after compiling a new kernel; this requires the
  program modprobe. All the software needed for module support is in
  the modutils package (check the file <file:Documentation/Changes>
  for location and latest version).  NOTE: if you say Y here but don't
  have the program genksyms (which is also contained in the above
  mentioned modutils package), then the building of your kernel will
  fail.  If you are going to use modules that are generated from
  non-kernel sources, you would benefit from this option.  Otherwise
  it's not that important.  So, N ought to be a safe bet

[3] Watch out for extraversions additions to the kernel name. If you are
running 2.4.20-k7 and get the source for 2.4.20. You will probably want
to add -k7 to the EXTRAVERSION of the kernel MAKEFILE. Otherwise the 
nvidia module will be installed in /lib/modules/2.4.20 instead of
/lib/modules/2.4.20-k7 where you want it if you want modprobe to work :)





More information about the Scarborough mailing list