Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Failed auto build of nvidia modules on new kernel

0 views
Skip to first unread message

David Mathog

unread,
May 16, 2007, 3:41:01 PM5/16/07
to
Mandriva 2007.1. Got it mostly working with the stock kernel. Put in a
copy of 2.6.21.1 from kernel.org which had been previously compiled on
another machine (identical hardware), along with it's corresponding:

/usr/src/linux-2.6.21.1
/lib/modules/2.6.21.1
/boot/ (various 2.6.21.1) files

and rebooted to 2.6.21.1. The OS came up ok, but the HAL layer tried to
build the 9755 Nvidia driver and it did:

Build failed, Installation skipped.

(Note, could not find these messages anywhere in /var/log later.)

For a positive control rebooted to the stock kernel and did:

cd /usr/src/nvid*
make module
make install

which worked and X11 would use that. Removed all the nvidia bits from
/lib/modules/2.6.21.1 and rebooted to the 2.6.21.1 kernel. Again, it
tried and failed to build the module. Logged in (ssh) and did:

% cd /usr/src/nvid*
% make module
sh ./conftest.sh "cc" "cc" /lib/modules/2.6.21.1/source
/lib/modules/2.6.21.1/build cc_sanity_check full_output
sh ./conftest.sh "cc" "cc" /lib/modules/2.6.21.1/source
/lib/modules/2.6.21.1/build select_makefile full_output
If you are using a Linux 2.4 kernel, please make sure
you either have configured kernel sources matching your
kernel or the correct set of kernel headers installed
on your system.

(etc.)

Nope, how about:

% make SYSSRC=/usr/src/linux-2.6.21.1 module

same error as before

% uname -r
2.6.21.1
%ls -al /lib/modules/2.6.21.1 | grep /usr/src
lrwxrwxrwx 1 root root 23 May 15 16:21 build ->
/usr/src/linux-2.6.21.1/
lrwxrwxrwx 1 root root 23 May 15 16:21 source ->
/usr/src/linux-2.6.21.1/
% ls -al /usr/src/linux-2.6
(as expected)
% cd /usr/src
% ls -al | grep linux
lrwxrwxrwx 1 root root 14 May 16 11:57 linux -> linux-2.6.21.1/
drwxr-xr-x 8 root root 1024 May 14 12:05 linux-2.6.17-14mdv/
drwxrwxr-x 19 root root 2048 May 16 11:52 linux-2.6.21.1/

Finally in desperation:

% cd /usr/src/linux-2.6.21.1
% make
% make modules_install
% make install

reboot to 2.6.21.1

% cd /usr/src/nvid*
% make module

failed as before.

At which point I ran out of ideas.

The oddest part about this is that the 9755 Nvidia driver from Nvidia
installed just fine on a different Mandriva 2007.1 system which had been
upgraded from 2006.0, the only difference being that that other system
had no nvidia rpm packages installed.

So what's the magic incantation to use the package
dkms-nvidia97xx-1.0-9755.1mdv2007.1
to build an Nvidia driver for another kernel?

Thanks,

David Mathog

David Mathog

unread,
May 16, 2007, 4:16:00 PM5/16/07
to
Tried copying in the prebuilt nvidia modules from /lib/modules/2.6.21.1
on the other 2.6.21.1 system. Also mdules.dep.

Tried again to start X11 and it couldn't find libGLcore.so.1.
Sure enough, on the other system (placed by standard nvidia installer)
these were in /usr/lib, whereas on Mandriva 2007.1 placed by Mandriva's
variant of the nvidia installer it's in /usr/lib/nvidia97xx/. Tried
putting links to all the *.so.1 in /usr/lib/nvidia97xx from /usr/lib and
it still wouldn't start. Which is strange, since it starts just fine
when booting with the 2.6.17-14mdv kernel.

Among other things, Xorg.0.log complains that:

(II) LoadModule: "nvidia"
(WW) Warning, couldn't open module nvidia

which is just bizarre as:

% find /lib/modules | grep nvidia.ko
/lib/modules/2.6.17-14mdv/kernel/drivers/video/nvidia.ko
/lib/modules/2.6.21.1/kernel/drivers/video/nvidia.ko

The one difference I see is that the stock kernel came with:

/lib/modules/2.6.17-14mdv/kernel/drivers/char/drm/nvidia97xx.ko.gz

WAY too much magic going on here for my taste, especially since it seems
to be very, very picky magic.

Regards,

David Mathog

David Mathog

unread,
May 16, 2007, 7:18:00 PM5/16/07
to
This is probably relevant:

% dkms status
nvidia97xx, 9755, 2.6.17-14mdv, i586: installed

Shows the nvidia module available for 2.6.17, but not for 2.6.21.1.
Makes sense, since so far no way to build that module in a way
compatible with both 2.6.21.1 and Mandriva 2007.1.

Has anybody managed to do this???

Thanks,

David Mathog

Jim Beard

unread,
May 16, 2007, 8:45:10 PM5/16/07
to

Not me. But your problem is familiar. I have had little
luck with the dkms rebuild of Nvidia drivers since Mandrake
8.1. Eventually, I simply kept an installer from the
Nvidia website on my machine, and ran it manually whenever
needed.

I am in the throes of getting Spring 2007.1 working
on my new 64-bit AMD machine, and decided to live dangerously
by upgrading to the 2.6.17-14mdv kernel, and the Nvidia drivers
compiled and installed.

I have yet to try for the 3d effects or other fancy stuff.
I am just happy I can load X-windows.

Cheers!

David Mathog

unread,
May 17, 2007, 11:31:36 AM5/17/07
to
Jim Beard wrote:
> David Mathog wrote:
>> This is probably relevant:
>> % dkms status
>> nvidia97xx, 9755, 2.6.17-14mdv, i586: installed
>>
>> Shows the nvidia module available for 2.6.17, but not for 2.6.21.1.
>> Makes sense, since so far no way to build that module in a way
>> compatible with both 2.6.21.1 and Mandriva 2007.1.
>>
>> Has anybody managed to do this???
>
> Not me. But your problem is familiar. I have had little
> luck with the dkms rebuild of Nvidia drivers since Mandrake
> 8.1.

There is an issue with older nvidia drivers (from Nvidia) not being able
to build on newer kernels, and the error message that appears is the
same. The odd thing is that 9755 is a newer driver and yet it's giving
the exact same error message as triggered by that "reverse" bug. I
guess I'll have to hack the script to make it accept the fact that the
kernel tree really is ok to use.

Thanks,

David Mathog

Kevin the Drummer

unread,
May 17, 2007, 11:50:05 AM5/17/07
to

I just ran into this yesterday. I installed a desktop multimedia
smp version of the the kernel. The booted kernel name doesn't
match the /usr/src/... kernel source tree name and dkms complains
that it can't find the source. In the past I managed to solve
that by creating a symlink that has the name that dkms looks for
when that kernel boots.

Like you I couldn't find any messages in the log files about
this. I made a symlink based on what I remembered about the dkms
error I saw on the console, which might not have been right. I
might have remembered the boot kernel name wrong as dkms didn't
do the build. I ran out of time to work on this yesterday. But,
I'll keep at it. If it does turn out to be a symlink issue, then
maybe the kernel source RPM needs a %trigger (or would it be the
desktop multimedia smp RPM?) to create the symlink in /usr/src ?

If I knew more dkms commands, then maybe I could try this from an
xterm, rather than needing to keep rebooting.

G'luck....

--
PLEASE post a SUMMARY of the answer(s) to your question(s)!
Show Windows & Gates to the exit door.
Unless otherwise noted, the statements herein reflect my personal
opinions and not those of any organization with which I may be affiliated.

Kevin the Drummer

unread,
May 17, 2007, 1:03:46 PM5/17/07
to

I made a copy of the /etc/init.d/dkms script and changed to this

output_loc="/dev/pts/1"

so that I could see the messages in my xterm. 'tty' in my xterm
gave me the correct setting. Then I found out that dkms believes
my kernel to be 2.6.17.14-mm-desktop-6mdvsmp and I did this

cd /lib/modules/2.6.17.14-mm-desktop-6mdvsmp
ln -s /usr/src/kernel-multimedia-2.6.17.14-6mdv build

I don't know if it's needed, but I also made this link in /usr/src

linux-2.6.17.14-mm-desktop-6mdvsmp -> kernel-multimedia-2.6.17.14-6mdv

dkms was nice enough to build the nVidia kernel module now.
'dkms status' shows:

nvidia, 8774, 2.6.17-5mdv, i586: installed
nvidia, 8774, 2.6.17-10mdv, i586: installed
nvidia, 8774, 2.6.17-11mdv, i586: installed
nvidia, 8774, 2.6.17.13-mm-desktop-3mdv, i586: installed
nvidia, 8774, 2.6.17.13-mm-desktop-3mdvsmp, i586: installed
nvidia, 8774, 2.6.17-8mdv, i586: installed
nvidia, 8774, 2.6.17-13mdv, i586: installed
nvidia, 8774, 2.6.17.14-mm-desktop-6mdvsmp, i586: installed

After rebooting 'lsmod' shows the "nvidia" kernel module loaded.

I hope this helps....

P.S.: I'm running Mandriva 2007.0, not 2007.1. But, I don't
think that matters much for this exercise.

David Mathog

unread,
May 17, 2007, 3:38:23 PM5/17/07
to
Mine isn't having that particular problem.

I went through a lot of different things and it finally dawned on me
that maybe the Mandriva variant of the nvidia driver had done something
evil to the 2.6.21.1 kernel tree. So I tossed /usr/src/linux-2.6.21.1
and built it clean from a freshly downloaded tar ball from
www.kernel.org, using the previous .config. Rebooted. Did

urpmi dkms-nvidia97xx-1.0-9755.1mdv2007.1

and it failed.

Then tried

sh NVIDIA-Linux-x86-1.0-8756-pkg1.run

and it failed too! Not a good sign.

rpm -e dkms-nvidia97xx-1.0-9755.1mdv2007.1

restore /usr/src/linux-2.6.21.1 from the clean copy

sh NVIDIA-Linux-x86-1.0-8756-pkg1.run

and it installed with no problem.

Conclusion: dkms-nvidia97xx-1.0-9755.1mdv2007.1 is a dangerous
hack - it works in some instances (the kernels Mandriva ships) and
actually damages the kernel source tree in others. Stick with the
driver straight from Nvidia for now.

The Nvidia nvidia driver sometimes removes the nvidia.ko from
/lib/modules of kernel A when installing on kernel B. This probably
has something to do with the message about it finding the driver already
installed and removing it. Doesn't do it all the time though. I'm
keeping copies of these files under /root, so that they can be restored.

What a lot of work this has been!

Thanks,

David Mathog

David Mathog

unread,
May 25, 2007, 12:57:02 PM5/25/07
to
David Mathog wrote:

> Conclusion: dkms-nvidia97xx-1.0-9755.1mdv2007.1 is a dangerous
> hack - it works in some instances (the kernels Mandriva ships) and
> actually damages the kernel source tree in others. Stick with the
> driver straight from Nvidia for now.

Just for kicks I tried this again with the PLF variants and they did
exactly the same thing as the ones in Mandriva 2007.1. It's really
disconcerting to see dkms start hacking away at a working kernel src
tree in /usr/src/linux_2.6.21.1. That kernel is just as I want it after:

make all
make modules_install
make install

and then dkms starts up and trashes it, without so much as a "mind if I
stomp all over your /usr/src/linux?" dialog or warning. Nor is there
any, "oops, that went badly, I'll restore /usr/src/linux to it's
previous state". I've seen other tools before for intalling kernel
modules "automatically" but this is the first that trashes the kernel
source tree. Most of them do all their work elsewhere in /usr/src
specifically to avoid that possibility.

Regards,

David Mathog


0 new messages