# nvidia : Failed to load nvidia kernel module

## lexflex

Hi, I need help and I wondered if someone recognizes the following problem

X won't start with the following error :

```
(II) Module already built-in

FATAL: Error inserting nvidia (/lib/modules/2.6.24-gentoo-r3/kernel/drivers/video/nvidia.ko): Invalid module format

(EE) NVIDIA(0) Failed to load the NVIDIA kernel module!

(EE) NVIDIA(0) *** aborting ***

(EE) Screen(s) found, but none have a usable configuration
```

It says: 'Invalid Module Format', how can that be ?

I tried to recompile the nvidia-drivers; this looks fine , however it still doesn't work.

Somewhere in the output it says:

```
WARNING: Couldn't find symtab and strtab in module //lin/modules/2.6.24-gentoo-r3/kernel/drivers/video/nvidia.ko
```

Can someone help me ?

More info : I update my whole system this  morning, including updating to kernel 2.6.25-r3. I re-emerge the nvidia-drivers, but later it appeared they are not yet supported by this kernel, so i moved back to use the 2.6.24-r3 kernel, re-emerge, did 'revdep-rebuild' , but can't get it back to work.....

Everything worked fine with NVIDIA/xorg untill this morning...

Thanks so much ! 

Lex.

----------

## toddles13

Hi Lexflex,

Try doing

```
cd /usr/src/linux

make clean

make modules

make modules_install

```

Then re-emerge the nvidia-drivers.

Also check the symlink for your kernel (/usr/src/linux) is pointed at the source for the kernel you are currently booting.

----------

## lexflex

Hi, thanks so far. 

I did as you said, and some things seemed to have changed... It now seems to have loaded the GLX-module, and the 'failed to load' wrror is gone now.

However, i still can't get X to work again...

It ends with ( and no errors somewhere in the logfile):

```

(==) Log file: "/var/log/Xorg.0.log", Time: Sun May 11 23:06:44 2008

(==) Using config file "/etc/X11/xorg.conf"

(II) Module already built-in

Backtrace:

0: X(xf86SignHandler+0x6d) [0x47f83d]

1: /lib/linc/so.6 [0x2b9dcac4f30]

2: /usr/lib/tls/libnvidia-tls.so.1 [0x2b9dcbe8d67e]

Fatal server error:

Caught signal 11. Server aborting.

XIO: fatal IO error 104 ( Connection reset by peer) on X server ":0.0"

       after 0 requests (0 known processed) with 0 events remaining.

 

```

If i try gdm or xglinfo it gives:

 *Quote:*   

> Segmentation fault
> 
> 

 

Have you got any more tips for me to try ? I also reemerge xorg-server, and the symlink is pointing to the current kernel.....  

thanks !

Lex.

 *toddles13 wrote:*   

> Hi Lexflex,
> 
> Try doing
> 
> ```
> ...

 

----------

## jfp

Is it possible that you have accidently configured the in-kernel nvidia drivers into your new kernel?

http://www.gentoo.org/doc/en/nvidia-guide.xml

----------

## lexflex

Hi , 

 *jfp wrote:*   

> Is it possible that you have accidently configured the in-kernel nvidia drivers into your new kernel?
> 
> 

 

No, i checked and even recompiled the kernel but is is not in there... 

I also get some strange errors about 'not an ELF file' when unmerging/reemergin some files ( f.e. gdm ):

```

/sbin/ldconfig: /usr/lib/libcuda.so.1 is not an ELF file - it has the wrong magic bytes at the start

/sbin/ldconfig: /usr/lib/libcuda.so is not an ELF file - it has the wrong magic bytes at the start

/sbin/ldconfig: /usr/lib/libcuda.so.173.08 is not an ELF file - it has the wrong magic bytes at the start

/sbin.ldcinfig:  /usr/lib32/ is not a symbolic link

```

Now, the strange thing is: This 173- driver is the NVDIA driver number i tried to install with the 2.6.25 kernel !!! 

It looks like some part of my attempt to install those drivers are still on the system

When i (re)install the drivers now using emerge, i install the nvidia-drivers-100.14.09 ...

Thanks ,

Lex.Last edited by lexflex on Mon May 12, 2008 7:08 am; edited 1 time in total

----------

## lexflex

Hi,

It is more-or-less solved for me, but it is not the way it is supposed to be:

- Since there seemed to be parts of the nvidia-drivers-173.08 (beta) drivers on the system , 

i reinstalled those Nvidia-drivers-173 using the NVIDIA-script available on their homepage (NVidia-linux-x86_64-173.08.pkg2.run)  against the old kernel (2.6.24), and now it works. 

The (ELF)-errors are gone, and X starts, so i am happy for now !

However:

- The drivers are now not installed using portage

- I could not get back to the situation in which i used the old kernel with the stable nvidia-100.14 drivers

So it is is not really the best situation i am in right now; Guess i will wait until the NVIDIA drivers suitable for the 2.6.25 kernel are in portage before switching to the new kernel...

Thanks,

Lex.

----------

## duryodhana

Kernel 2.6.25-r3 and nvidia-drivers 173.08 work perfectly here whereas nvidia-drivers 169.12 refused to do so. I had no choice left, so I unmasked the 173.08.

----------

## lexflex

 *duryodhana wrote:*   

> Kernel 2.6.25-r3 and nvidia-drivers 173.08 work perfectly here whereas nvidia-drivers 169.12 refused to do so. I had no choice left, so I unmasked the 173.08.

 

Hi, thanks, i did the same and this works fine indeed with the 2.6.25-r3 kernel ! ( didn't realise the nvidia 173-driver  was in portages, but indeed it was, only 'hard-masked' )

----------

## petty123

 *lexflex wrote:*   

> Hi,
> 
> It is more-or-less solved for me, but it is not the way it is supposed to be:
> 
> - Since there seemed to be parts of the nvidia-drivers-173.08 (beta) drivers on the system , 
> ...

 

Is a small consolation coz that you did is exactly what I recommended about a week ago in another thread. Unfortunately a brain dead moderator called i92guboj locked the thread, saying that he does not agree with the procedure.

I just want emphasize once for all: the role of moderators is not to censor the postings...they are here to ensure the rules and regulations of the forum are respected!

----------

## jody

Hi

When i also get the invalid module format" message:

```
aim-rush ~ # modprobe nvidia

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

I tried what toddles13 suggested:

```
cd /usr/src/linux

make clean

make modules

make modules_install 
```

and reemerged nvidia drivers:

```
emerge x11-drivers/nvidia-drivers

(... loads of output ...)

 * Messages for package x11-drivers/nvidia-drivers-173.14.09:

 * 

 * /lib/modules/2.6.15-gentoo-r1/build/System.map not found.

 * You must manually update the kernel module dependencies using depmod.

 * 

 * You must be in the video group to use the NVIDIA device

 * For more info, read the docs at

 * http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6

 * 

 * This ebuild installs a kernel module and X driver. Both must

 * match explicitly in their version. This means, if you restart

 * X, you most modprobe -r nvidia before starting it back up

 * 

 * To use the NVIDIA GLX, run "eselect opengl set nvidia"

 * 

 * nVidia has requested that any bug reports submitted have the

 * output of /usr/bin/nvidia-bug-report.sh included.

 * 

 * To work with compiz, you must enable the AddARGBGLXVisuals option.

 * 

 * If you are having resolution problems, try disabling DynamicTwinView.

 * GNU info directory index is up-to-date.

```

So i did the "depmod" and 

```
modprobe -r nvidia
```

 and still,

```
aim-rush ~ # modprobe nvidia

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

```

Can anybody help me out here?

Thanks in advance

  Jody

----------

## shadowknight

Sorry I can't help out any.....I just wanted to add to the list here, though my trouble was with the masked 177.13 on kernel 2.6.25-r6  gentoo-sources.   I'm wondering if it's the drivers or the kernel or a combination of both since multiple people are having problems with multiple versions?     I'm back to using the 173.14.09 nvidia-drivers and the same kernel as previously stated on amd64 system.  My problem was the same as the OP.  Maybe I'll try the make clean method, but I'll probably just keep using these till the next set come out.....

----------

## jody

Hi

I have solved my problem in the mean time.

The following part of dmesg

```

aim-rush ~ # dmesg | grep nvidia

nvidia: version magic '2.6.15-gentoo-r1 SMP preempt K8 gcc-4.3' should be '2.6.15-gentoo-r1 SMP preempt K8 gcc-4.1'

nvidia: version magic '2.6.15-gentoo-r1 SMP preempt K8 gcc-4.3' should be '2.6.15-gentoo-r1 SMP preempt K8 gcc-4.1'

...

(6 more of these)

```

indicates that kernel and nvidia module were not compiled with the same compilers.

What solved the problem was compiling a newer kernel, recompiling nvidia, and now it's ok.

Jody

----------

## jazzi

I also got the problem of inserting nvidia module too.

I just install my gentoo 4 days before, so the kernel is always 2.6.24-r8

I emerge nvidia-drivers and it is ok

when I 

```
modprobe nvidia
```

It shows:

 *Quote:*   

> FATAL:Error inserting nvidia (/lib/modules/2.6.24-gentoo-r8/video/nvidia.ko): No such device

 

But

```
#ls /lib/modules/2.6.24-gentoo-r8/video

#nvidia.ko
```

I don't know what's the problem, how to solve it.

----------

## coolsnowmen

no such device means the modules didn;t recognize it, you should post the relevent lspci -v

----------

