What am I missing?

Place to discuss Debian Linux and Debian based distributions
Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

What am I missing?

Post by Ice9 » Mon Aug 08, 2005 2:05 pm

For the life of me I can't get this darn thing (nvidia driver) to compile!!!!!!!!!!!!!!!!!
What I did:
- download the latest source tarball from a kernel.org mirror
- save it in /home/yc/kernel
- unpack it
- make xconfig and change all the bits I wanted to change
- fakeroot make-kpkg --revision=custom.1.0 kernel_image
- dpkg -i kernel-image-2.6.12.3_custom.1.0_i386.deb
- mkinitrd -o /boot/initrd.img-2.6.12.3 2.6.12.3
- rename XF86config and restore original version
- reboot

Everything OK
I logout and go to a console login
I start the building of the driver, it goes until half way and then starts to complain

First about the kernel.h file that's missing, I fixed it, then about the module nvidia.ko it cannot load.
All things related to proper source and header packages, every single post I find tells me to install those.
Now, what am I mssing here?
Is compiling the kernel in my home folder ok?
Is there some kind of hidden directory on kernel.org where I can find kernel headers, the kernel source I placed in /usr/src!?
Which headers do I have to download (I read various posts on the kerneltrap mailing list that mentioned the fact that vanilla kernel headers were of no use in most cases ???)

I feel kinda lost, been a few days that I'm trying all kinds of stuff and still haven't hosed my system but i have a feeling it's getting nearer :?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Aug 08, 2005 3:07 pm

It sounds like it can't find your kernel headers. On my 2.6 systems there are symbolic links to the kernel source tree called "source" and "build" under /lib/modules/`uname -r`. When building modules the module source should look for headers there. Failing that, I would suggest asking on the nVidia forums. I have had a certain amount of luck searching there and asking questions there in the past:

http://www.nvnews.net/vbulletin/forumdi ... forumid=14

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Mon Aug 08, 2005 3:20 pm

Void Main wrote:
It sounds like it can't find your kernel headers. On my 2.6 systems there are symbolic links to the kernel source tree called "source" and "build" under /lib/modules/`uname -r`. When building modules the module source should look for headers there.
That's the problem I think, there are no kernel headers to be found on my system for kernel 2.6.12.3

Code: Select all

Icebox:/usr/src# ls -l
total 184304
drwxr-xr-x  16 root root     4096 Mar 14 20:05 kernel-headers-2.6.10-1
drwxr-xr-x   3 root root     4096 Mar 14 20:05 kernel-headers-2.6.10-1-686
drwxr-xr-x  16 root root     4096 Jun 21 23:33 kernel-headers-2.6.11-1
drwxr-xr-x   3 root root     4096 Jun 21 23:33 kernel-headers-2.6.11-1-686
drwxr-xr-x  16 root root     4096 Dec 20  2004 kernel-headers-2.6.7-1
drwxr-xr-x   3 root root     4096 Dec 20  2004 kernel-headers-2.6.7-1-686
drwxr-xr-x  16 root root     4096 Dec 27  2004 kernel-headers-2.6.9-1
drwxr-xr-x   3 root root     4096 Dec 27  2004 kernel-headers-2.6.9-1-686
drwxr-xr-x  16 root root     4096 Jan 10  2005 kernel-headers-2.6.9-2
drwxr-xr-x   3 root root     4096 Jan 10  2005 kernel-headers-2.6.9-2-686
-rw-r--r--   1 yc   src   8885958 Aug  8 21:57 kernel-image-2.6.12.3_custom.1.0_i386.deb
drwxr-xr-x   3 root root     4096 Dec 20  2004 kernel-kbuild-2.6-3
-rw-r--r--   1 root root 35779826 Mar 11 01:04 kernel-source-2.6.10.tar.bz2
-rw-r--r--   1 root root 36299930 Jun 16 17:08 kernel-source-2.6.11.tar.bz2
-rw-r--r--   1 root root 34343606 Aug  5  2004 kernel-source-2.6.7.tar.bz2
-rw-r--r--   1 root root 35559027 Jan  8  2005 kernel-source-2.6.9.tar.bz2
drwxr-sr-x  20 yc   src      4096 Aug  8 21:56 linux-2.6.12.3
-rw-r--r--   1 root src  37500159 Aug  6 23:56 linux-2.6.12.3.tar.bz2
-rw-r--r--   1 root root    67465 Sep 27  2003 ov511.tar.gz

Code: Select all

Icebox:/lib/modules# ls -l
total 20
drwxr-xr-x  5 root root 4096 Jun  6 23:26 2.6.10-1-686
drwxr-xr-x  5 root root 4096 Aug  3 22:11 2.6.11-1-686
drwxr-xr-x  5 root root 4096 Dec 23  2004 2.6.7-1-686
drwxr-xr-x  5 root root 4096 Dec 30  2004 2.6.9-1-686
drwxr-xr-x  5 root root 4096 Jan 11  2005 2.6.9-2-686
Apart from the kernel I compiled myself there are kernel headers for every kernel I have on my system ...

I thought about asking on the nv forums but I bet they're gonna tell me to install hte kernel-headers package, which I can't because 2.6.12 didn't hit unstable yet and I can't seem to find a way to get the kernel headers out of the source package I downloaded!

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Aug 08, 2005 3:28 pm

No, if you compiled the kernel yourself the headers are part of that source package. Put the symbolic link pointing to the source directory where you built the kernel (usually /usr/src/linux-x.xx.xxx). You said you built it under your home directory so you would have to link to the linux source root directory under your home directory (or move the Linux directory structure to /usr/src and then create the symbolic links). The reason for the seperate kernel-header packages with the binary kernels is so you don't actually have to install the entire 200MB of source code (or whatever the size is up to) just to compile a module. All you need are the headers to compile a module.

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Mon Aug 08, 2005 3:34 pm

Ok, just added
ln -s /usr/src/linux-2.6.12.3 linux and the symlink to linux-2.6.12.3 in /usr/src is present.
Off to reboot and try again to build the module.
Thanks Void.

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Mon Aug 08, 2005 3:50 pm

:cry:

Code: Select all

-> Kernel module compilation complete.
ERROR: Unable to load the kernel module 'nvidia.ko'.  This is most likely
       because the kernel module was built using the wrong kernel source files.
       Please make sure you have installed the kernel source files for your
       kernel; on Red Hat Linux systems, for example, be sure you have the
       'kernel-source' rpm installed.  If you know the correct kernel source
       files are installed, you may specify the kernel source path with the
       '--kernel-source-path' commandline option.
-> Kernel module load error: insmod: error inserting './usr/src/nv/nvidia.ko':
   -1 No such device

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Aug 08, 2005 4:33 pm

That's all the output? What commands are you using to build your module? Does the module exist in /lib/modules/`uname -r`/kernel/drivers/video/nvidia.ko? Did you try using the switch listed in the ERROR message (--kernel-source-path=/kernel/source/path)?

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Tue Aug 09, 2005 12:37 am

No that's not all the output, before there is all the actual compilation of the module, but the compilation ends without error at "Kernel module compilation complete."

The command I'm using to buiold the module is sh NVIDIAdriver.run (I'm not in front of my linux box right now) and yes I tried using the switch top the kernel source path.
In fact this is how I solved the kernel.h file not found problem, by specifying the kernel-source-path.

As I have no access to my box until tonight I can't really tell you if the module is present in /lib/modules but it should be because the installer complains it can't load the driver not that it can't find it.
But I'll check tonight when I get home.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Aug 09, 2005 7:53 am

Ahhh, right you are. It is trying to load it out of the directory that you compiled it in though. The big problem I see is the message "no such device", like it's not actually detecting your card. Maybe there is some sort of hardware conflict?

Actually check this out:
http://www.nvnews.net/vbulletin/showthread.php?t=53845

I don't see where you ever mention what card you have. After trying to load the driver what are the kernel messages? Should be at the end of the output of the "dmesg" command.

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Tue Aug 09, 2005 2:15 pm

Void Main wrote:
Maybe there is some sort of hardware conflict?
I'd buy that if the very same card didn't work flawlessly with the same driver I'm trying to compile but on a different kernel.
I switched cards with my kid's box and I'm using a Geforce 2 MX and at this very moment I'm writing this from my box, booted on kernel 2.6.11 with the nvidia driver loaded! :?
I'm gonna reboot and try to load it again see what dmesg gives me ...

Here's the final output of the nvidia-installer.log though

Code: Select all

-> Kernel module compilation complete.
ERROR: Unable to load the kernel module 'nvidia.ko'.  This is most likely
       because the kernel module was built using the wrong kernel source files.
       Please make sure you have installed the kernel source files for your
       kernel; on Red Hat Linux systems, for example, be sure you have the
       'kernel-source' rpm installed.  If you know the correct kernel source
       files are installed, you may specify the kernel source path with the
       '--kernel-source-path' commandline option.
-> Kernel module load error: insmod: error inserting './usr/src/nv/nvidia.ko':
   -1 No such device
-> Kernel messages:
   NVRM: No NVIDIA graphics adapter probed!
   NVRM: The NVIDIA probe routine was not called for 1 device(s).
   NVRM: This can occur when a driver such as rivafb or rivatv was
   NVRM: loaded and obtained ownership of the NVIDIA device(s).
   NVRM: Try unloading the rivafb (and/or the rivatv) kernel module
   NVRM: (or reconfigure your kernel without rivafb support), then
   NVRM: try loading the NVIDIA kernel module again.
   NVRM: No NVIDIA graphics adapter probed!
   NVRM: The NVIDIA probe routine was not called for 1 device(s).
   NVRM: This can occur when a driver such as rivafb or rivatv was
   NVRM: loaded and obtained ownership of the NVIDIA device(s).
   NVRM: Try unloading the rivafb (and/or the rivatv) kernel module
   NVRM: (or reconfigure your kernel without rivafb support), then
   NVRM: try loading the NVIDIA kernel module again.
   NVRM: No NVIDIA graphics adapter probed!
I compiled the kernel without rivafb support.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Aug 09, 2005 2:39 pm

Could you post the output of an "/sbin/lsmod"? The only other thing I can think of is around 2.6.8 or 9 there became some sort of issue where the kernel had to be compiled a certain way but this doesn't seem like that issue. The only other thing I can think of is maybe it's udev related? Also, after trying to load the module what does dmesg have to say about it? The very last thing I can suggest is the NV forums. :)

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Tue Aug 09, 2005 2:47 pm

The dmesg output is exactly the same as what I posted from the nvidia-installer.log.
I'm gonna reboot 2.6.12.3 to get the output of lsmod :)

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Tue Aug 09, 2005 3:05 pm

Woah, found something incredibly cool :D
I created output.txt with vi and then ran

Code: Select all

r: !lsmod
from within vi and I had the output of lsmod directly piped into my document!!!! :twisted:

Anyway, here it is:

Code: Select all

Module                  Size  Used by
hw_random               4372  0 
emu10k1_gp              2816  0 
gameport               11016  2 emu10k1_gp
snd_emu10k1_synth       6400  0 
snd_emux_synth         32512  1 snd_emu10k1_synth
snd_seq_virmidi         5760  1 snd_emux_synth
snd_seq_midi_emul       6272  1 snd_emux_synth
snd_seq_dummy           2820  0 
snd_seq_oss            30080  0 
snd_seq_midi            6816  0 
snd_seq_midi_event      6272  3 snd_seq_virmidi,snd_seq_oss,snd_seq_midi
snd_seq                44816  9 snd_emux_synth,snd_seq_virmidi,snd_seq_midi_emul,snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_emu10k1           108420  1 snd_emu10k1_synth
snd_rawmidi            19104  3 snd_seq_virmidi,snd_seq_midi,snd_emu10k1
snd_seq_device          6796  8 snd_emu10k1_synth,snd_emux_synth,snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq,snd_emu10k1,snd_rawmidi
snd_ac97_codec         76408  1 snd_emu10k1
snd_pcm_oss            47136  0 
snd_mixer_oss          16512  1 snd_pcm_oss
snd_pcm                76424  3 snd_emu10k1,snd_ac97_codec,snd_pcm_oss
snd_timer              19588  3 snd_seq,snd_emu10k1,snd_pcm
snd_page_alloc          7428  2 snd_emu10k1,snd_pcm
snd_util_mem            3456  2 snd_emux_synth,snd_emu10k1
snd_hwdep               6816  2 snd_emux_synth,snd_emu10k1
snd                    41444  13 snd_emux_synth,snd_seq_virmidi,snd_seq_oss,snd_seq,snd_emu10k1,snd_rawmidi,snd_seq_device,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_hwdep
soundcore               6880  1 snd
e100                   31744  0 
mii                     4736  1 e100
evdev                   7424  0 
usbhid                 32224  0 
uhci_hcd               27920  0 
usbcore               100860  3 usbhid,uhci_hcd
rtc                     9528  0 
slc90e66                4480  0 [permanent]
rz1000                  2304  0 [permanent]
hpt366                 17792  0 [permanent]
hpt34x                  4224  0 [permanent]
generic                 3584  0 [permanent]
cy82c693                3712  0 [permanent]
cmd64x                 10396  0 [permanent]
atiixp                  4880  0 [permanent]
amd74xx                12316  0 [permanent]
aec62xx                 6016  0 [permanent]
I would kinda hate having to give up on this kernel (2.6.12.3) because, unlike what I said before, it IS much faster than the debian-compiled kernels, and twice as light.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Aug 09, 2005 3:32 pm

I don't see anything wrong anywhere. I have no earthly idea why this isn't working, unless it is just something with the new kernel causing the problem. In fact at this point I would say that is LIKELY. This is about as far as I can take it. From here I would have to go ask on the NV forums for you, but it would be better if you did it. :)

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Tue Aug 09, 2005 3:52 pm

I'm about to go and post there but I think I messed it up good now.
I was searching on the nv forums and noticed a post about the new driver and a way to install for Debian.

So I went

Code: Select all

apt-get install module-assistant nvidia-kernel-common
module-assistant prepare auto-install nvidia
apt-get install nvidia-glx
After which I tried to start X, only to find out that it didn't work, and when rebooting my old kernel which used to run mighty fine with the nvidia drivers until now it only give me a black screen.
I guess I messed up by apt-getting the nvidia stuff because now when I try to reinstall the driver on my previous kernel I have a gcc version mismatch and it won't compile unless I set an option somewhere ....

:cry:

Post Reply