# Problem with "nvidia" module [SOLVED]

## djpenguin

I'm in the final phases of a gentoo install with the 2.6.9 kernel, and I can't seem to get the "nvidia" module to load.  I can get X to start using the older "nv" driver, but every time I try to modprobe the "nvidia" module, I get an error message.

I've tried recompiling the kernel, switched the stack size from 4K to 8K (because the nvidia-kernel install said something about it only working with 8K stacks), tried re-emerging nvidia-kernel several times, ran env-update, the whole deal.

Here's the error message I get when I try 'modprobe nvidia'

```
Error inserting module (/lib/modules/2.6.9-gentoo-r1/video/nvidia.ko)  Invalid module format.
```

Any thoughts on this?Last edited by djpenguin on Fri Oct 29, 2004 5:23 am; edited 2 times in total

----------

## drutten

did you run "opengl-update nvidia"

remember you have to compile nvidia-kernel after you've compiled the kernel you are going to run, and reboot to that kernel before you modprobe.

----------

## djpenguin

Yes, I did all those things.

I still get the same result.

----------

## cs02rm0

All I did to get it working today was:

Add these three lines to /etc/portage/package.keywords:

media-video/nvidia-kernel ~x86

media-video/nvidia-glx ~x86

x11-base/opengl-update ~x86

Then as root:

emerge nvidia-kernel

emerge opengl-update

emerge nvidia-glx

opengl-update nvidia

modules-update

Change the driver in xorg.conf to nvidia and restart X.

----------

## maxcow

djpenguin: I had the same problem:

this new kernel has an option called "local name" or something, which is a string appended to the kernel name. I was make'ing oldconfig and typed 'n' to this option. Unfortunately, this didn't deactivate it, my "local name" was set to 'n'.

So, the built modules went into /lib/modules/2.6.9-gentoon instead of /lib/modules/2.6.9-gentoo, and the kernel looked for modules in gentoon and not gentoo.

Maybe you have the same problem, in that case either rebuild the kernel making sure that option is empty, or move the nvidia modules to the right folder.

----------

## dsd

check "dmesg". does it complain about _vmalloc_reserve ?

----------

## djpenguin

Here is the output of dmesg:

```
bash-2.05b# dmesg | grep nvidia

nvidia: version magic '2.6.9-gentoo-r1 SMP preempt PENTIUM4 gcc-3.3' should be '2.6.9-gentoo-r1 SMP preempt PENTIUM4 4KSTACKS gcc-3.3'
```

However, it did complain about _VMALLOC_RESERVE before I recompiled the kernel with 8K stacks.Last edited by djpenguin on Fri Oct 29, 2004 5:24 am; edited 1 time in total

----------

## dsd

you need to re-merge nvidia-kernel as you are currently trying to load one that was compiled with 4k stacks.

you may well get the vmalloc_reserve message back, in which case you need to emerge sync and use the very latest 6111 version in portage.

----------

## djpenguin

I did emerge sync and then emerge nvidia-kernel after cleaning the previous nvidia-kernel package.

I'm back to the VMALLOC error, and a tad confused.  Do I need to do something to force portage to use the latest nvidia-kernel version?  Shouldn't it do that on it's own after the 'emerge sync' command?

I downloaded a patch from a link I found in another post on this topic...should I just install that?  Would that fix the problem?  (the forum linked to said something about gentoo already including this patch, and the last thing I want to do is make things worse)

----------

## djpenguin

Okay, I've tried putting a tilde in front of the x86 flag, and the svga flag in the make.conf file.  Neither one results in portage trying to emerge anything more recent than nvidia-kernel 1.0.5334-r4

What the hell am I doing wrong here?

This is quite frustrating, to say the least

----------

## dsd

sometimes the latest version available isnt in the default "stable" portage branch, because we dont think its had enough testing or whatever.

now would be a good time for me to point you to the *all new* portage section of the handbook.

see: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3&chap=3

and revert those changes you made to make.conf

----------

## djpenguin

Thanks !

I've got the nvidia driver working fine thanks to the advice and help of dsd and cs02rm0.  You guys are great!

The guide really explained things very well, in fact, I'm compiling ardour (another masked ebuild) as we speak.

The more I learn about this OS, the more I love it, and the forums make problem-solving so easy.

----------

## ez1L3

Also big thanks to cs02rm0 ... Thanks !!

Had the same prob.

----------

## codezero

it works!!

thanx!!!

but do i have to add nvidia to /etc/modules.autoload.d/kernel-2.6 ?

----------

## dsd

if you use udev, yes

if you use devfs, probably not

----------

## Lanthanum

Worked for me too thanks!!!

----------

