# [SOLVED]nvidia.ko: Invalid module format

## jody

Hi

I am sitting in /usr/src/linux (which is usr/src/linux-3.0.6-gentoo)

I have cleaned up with 'make mrproper'

I copied a backup of my configuration to .config 

I did 'make menuconfig' but didn't change anything.

I recompiled my kernel (3.0.6) with 'make && make_install'

i copied arch/x86/boot/bzImage to /boot/kernel-3.0.6-gentoo

Immediately afterwards i emerged x11-drivers/nvidia-drivers.

There are no error messages.

But lsmod does not list nvidia.

If i try to modprobe it, i get the error:

```
linux # modprobe -v  nvidia 

insmod /lib/modules/3.0.6-gentoo/video/nvidia.ko NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=27 NVreg_ModifyDeviceFiles=1

FATAL: Error inserting nvidia (/lib/modules/3.0.6-gentoo/video/nvidia.ko): Invalid module format

```

I have used the same compiler for kernel and nvidia (gcc version 4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5)),

Can anybody help me here?

Thank You

  JodyLast edited by jody on Thu Jan 05, 2012 3:03 pm; edited 1 time in total

----------

## Jaglover

```
uname -vr
```

You are probably not running your new kernel, forgot to mount /boot perhaps?

----------

## jody

Hi Jaglover

```
~ # uname -vr

3.0.6-gentoo #1 SMP PREEMPT Tue Nov 22 09:34:31 CET 2011

```

I did copy the kernel to the mounted /boot (on /dev/sda1):

```
~ # ls -l /usr/src/linux/arch/x86_64/boot/bzImage 

lrwxrwxrwx 1 root root 22 Jan  4 16:33 /usr/src/linux/arch/x86_64/boot/bzImage -> ../../x86/boot/bzImage

~ # ls -l /usr/src/linux/arch/x86/boot/bzImage 

-rw-r--r-- 1 root root 4775504 Jan  4 16:33 /usr/src/linux/arch/x86/boot/bzImage

~ # ls -l /boot/kernel-3.0.6-gentoo

-rw-r--r-- 1 root root 4775504 Jan  4 16:40 /boot/kernel-3.0.6-gentoo

```

I have also restarted the machine several times

and re-emerged nvidiadrivers but the result is the same:

nvidia.ko is no loaded and it is not possible to modprobe it 

Jody

----------

## krinn

 *Jaglover wrote:*   

> forgot to mount /boot perhaps?

 

 *Quote:*   

> ls -l /boot/kernel-3.0.6-gentoo
> 
> -rw-r--r-- 1 root root 4775504 Jan  4 16:40 /boot/kernel-3.0.6-gentoo 

 

 *Quote:*   

> 3.0.6-gentoo #1 SMP PREEMPT Tue Nov 22 09:34:31 CET 2011 

 

----------

## jody

This is really strange!

I actually did a first try of building a kernel last November,

but ran into a different problem then (mouse didn't move in X).

Ok - so now i mounted boot, deleted kernel-3.0.6-gentoo from there,

then did mrproper & rebuilt the kernel with 'make && make modules_install'

and copied it to /boot.

After rebooting the machine 'uname -vr' *still* returns the date "Nov 22"!

(and nvidia still can't be loaded)

But in the man page of uname it says that the option -v returns the kernel version -

is this really the time of the kernels compilation?

Because in my /boot here is no file anymore with a date from 2011...

Thank You

  jody

----------

## Jaglover

That's strange ...

```
umount /boot

ls -l /boot
```

Perhaps you reinstalled your bootloader and it is not using your boot partition any more.

----------

## jody

(*kick-self-in-a$$*)

The problem is solved...

Kernel story:On my machine there was a disk with an old fedora installation. 

Because this was a production machine i wanted to keep the working horse,

so i added another disk and started to install gentoo on the new disk.

I don't remember my reasoning, but i saved the kernel 3.0.6 on sdb1, and used

hd(1,0) in the grub on sda1 to address it. Had i looked more closely, i could have 

found this much sooner, but it took jaglover's last comment to make me look...

So now built a new 3.0.6-kernel sitting in sda1, which can be booted. 

When i reemerged nvidia ther were some warnings

```
WARNING: //lib/modules/3.0.6-gentoo/video/nvidia.ko needs unknown symbol kmem_cache_alloc_trace

WARNING: //lib/modules/3.0.6-gentoo/video/nvidia.ko needs unknown symbol [ ok ]epoint_module_get

```

(i guess the '[ok]' came over stdout and the warnings over stderr')

but i nonetheless i could modprobe nvidia, and now everything's as it needs to be.

Thanks again for making me look in the right place!

Jody

----------

