# Nvidia: invalid module format? [SOLVED]

## miqorz

Im using 2.6.7 vanilla from portage and emerged nvidia-kernel and nvidia-glx   .

I am also using Xorg and udev. (Don't know if that matters?)

Well after I emerged that I did "lsmod" and nothing was there.. I expected to just see "nvidia" but nothing was there..

So I tried to load it manually.. and it said invalid format..

Any ideas?Last edited by miqorz on Wed Jul 28, 2004 10:16 am; edited 1 time in total

----------

## miqorz

Allright using nvidia-kernel and nvidia-glx from ~x86 seems to let it load fine but Xorg cant use it.. startx just fails.. 

Reading posts about this just confuses me more.. heh

----------

## miqorz

Here's a part of my Xorg.0.log 

```

(**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32

(==) NVIDIA(0): RGB weight 888

(==) NVIDIA(0): Default visual is TrueColor

(==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)

(--) NVIDIA(0): Linear framebuffer at 0xD8000000

(--) NVIDIA(0): MMIO registers at 0xE4000000

(EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module!

(EE) NVIDIA(0):  *** Aborting ***

(II) UnloadModule: "nvidia"

(II) UnloadModule: "vgahw"

(II) Unloading /usr/X11R6/lib/modules/libvgahw.a

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

Fatal server error:

no screens found

Please consult the The X.Org Foundation support 

    at http://wiki.X.Org

 for help. 

Please also check the log file at "/var/log/Xorg.0.log" for additional information.

```

----------

## miqorz

Could a mod move this to Desktop Enviroments? I think it's more relevant over there and just may get a better responce.

----------

## phranzee

run

```

    mknod -m 660 /dev/nvidia0 c 195 0 > /dev/null 2>&1

    chown root:video /dev/nvidia0 > /dev/null 2>&1

    mknod -m 660 /dev/nvidiactl c 195 255 > /dev/null 2>&1

    chown root:video /dev/nvidiactl > /dev/null 2>&1

```

before X. also chceck NVmakedevices.sh script. it's udev fault

----------

## miqorz

That didn't seem to work.. thanks though.

----------

## phranzee

 *miqorz wrote:*   

> That didn't seem to work.. thanks though.

 provide more info on this error. i use xorg, udev and drivers 5336 work fine with above 'script'  :Smile: 

----------

## miqorz

I don't know what more I can add..

I'm using udev and nvidia drivers from ~x86.. xorg from regular x86...

development-sources kernel.. 

My name is in the "video" group in /etc/group.. *shrugs*

----------

## bennettp

The old (4496) nvidia drivers will fail with the "invalid module format" error message on kernels later than about 2.6.5. This is because they still use the old 2.4 module format which was abandoned in the recent 2.6 kernels.

The solution was to upgrade to either 5336 (which didn't work on my computer anyhow), or to version 6109.

However, if you emerge nvidia-kernel, make sure that you also emerge nvidia-glx, and that the same version is being installed for each. So, if you install the 6109 kernel module, make sure you install nvidia-glx version 6109, or you will get errors!

Finally, exit X, and rmmod nvidia, then start up X again, and hopefully it should work!

----------

## Alapan

I had the same problem recently - when I realised I had not run "modprobe nvidia" after all the updates. Have you done this? Just a thought ...

----------

## placeholder

The sym link /usr/src/linux points to the right kernel sources, correct?

----------

## miqorz

No offence but did anyone read this thread though, heh.

I got it to load with using the updated driver in ~x86 but now it won't startx.

And yes linux -> linux-2.6.7

----------

## miqorz

Sorry.. but bump..

I can't seem to figure this out on my own..

----------

## AstralStorm

Check if you load X.org module 'glx' - it's required.

Also try:

opengl-update nvidia

----------

## miqorz

Yes I am loading glx  :Smile: 

I just noticed when I startx it says something like (I'm paraphrasing..)

API mismatch kernel module is ... (version) .. and X module is ... (version)...

It makes it sound like the nvidia version is too new for my X o_O

----------

## miqorz

Feh. I give up.. I just wont use gentoo / linux for a few more months...

it seems like once one issue is cleared up and I think i can get a good desktop system working again..

Something like this happens.

----------

## miqorz

Grr.. I hope no one gets mad at all this bumping..

I just don't want to give up on this..

Here's everything I've tried..

I've tried like 3 different drivers. I've disabled 4k stacks.

I'm back at step one where nvidia won't load..

If I go to nvidia from ~x86 it WILL load but X won't start with it..

X works with the nv driver but that's really slow.. =\

----------

## b-llwyd

grep EE /var/log/Xorg.0.log ... there could be some hidden explanation in there, but it sounds like you might have a config problem in xorg.conf

----------

## Celtis

I had the same problem with the Kernel version not matching driver version and it turned out that there were two versions of the nvidia drivers in /lib/modules/2.6.X/video directory (IIRC there was nvidia.o and nvidia.ko). I renamed them both and re-emerged the latest nvidia drivers and used modprobe to load it.

----------

## miqorz

 *Celtis wrote:*   

> I had the same problem with the Kernel version not matching driver version and it turned out that there were two versions of the nvidia drivers in /lib/modules/2.6.X/video directory (IIRC there was nvidia.o and nvidia.ko). I renamed them both and re-emerged the latest nvidia drivers and used modprobe to load it.

 

... I love you ....

This worked first try ... wow man! Thank you!

----------

## Celtis

 *miqorz wrote:*   

> 
> 
> ... I love you ....
> 
> This worked first try ... wow man! Thank you!

 

 :Laughing:  Glad it worked, I trust this means you'll be sticking with Gentoo a bit longer then!

----------

## miqorz

You bet! I'm still customizing everything to get "perfect" but wow this was the ONE thing bugging me!   :Cool: 

----------

## sammy

I had such a problem.

I have merged 2.6.5 kernel & nvidia kernel 1.0.4496 + nv glx.

It is working for now(QIII seems to work good).

A new version of kernel is released every mounth or week or day but

drivers & soft....

----------

## lsiden

 *Celtis wrote:*   

> I had the same problem with the Kernel version not matching driver version and it turned out that there were two versions of the nvidia drivers in /lib/modules/2.6.X/video directory (IIRC there was nvidia.o and nvidia.ko). I renamed them both and re-emerged the latest nvidia drivers and used modprobe to load it.

 

Can you explain your response a bit further?  What do you mean by "I renamed them both"?  You mean you renamed them to something other than "nvidia.x" so that "modprobe nvidia" would no longer find them?  

Next, what do you mean by "remerged nvidia drivers".  Do you mean you did "emerge nvidia-kernel" again?

I tried doing "emerge -C nvidia-kerel", then re-merging, but to no avail.

Sorry to bother you.

----------

## Celtis

 *lsiden wrote:*   

> Can you explain your response a bit further? 

 Sure  :Wink:   *lsiden wrote:*   

> What do you mean by "I renamed them both"?  

 As I said, in that directory I had two files (they were called nvidia.ko and nvidia.o if I remember correctly). One was the new driver while one was from the old driver that, for some reason, hadn't been removed when the old nvidia drivers were unmerged. I told miqorz to rename them because I didn't want to be the one responsible for telling him to delete them only to find that he still needed them (you should always keep a backup just in case  :Wink:  ). *lsiden wrote:*   

> You mean you renamed them to something other than "nvidia.x" so that "modprobe nvidia" would no longer find them?

 Correct

 *lsiden wrote:*   

> Next, what do you mean by "remerged nvidia drivers".  Do you mean you did "emerge nvidia-kernel" again?

 Yes.

 *lsiden wrote:*   

> I tried doing "emerge -C nvidia-kerel", then re-merging, but to no avail.

 As I said, the old driver was left over when the old package was unmerged, so running emerge -C nvidia-kernel did nothing as the driver *should* have gone (as far as portage was concerned). 

To make sure you have the right version of the nvidia drivers, do "modprobe nvidia" then "lsmod". You should see that the nVidia drivers size is somewhere in the region of 4819508 (for comparision, the 5336-r2 drivers were 2073640)

 *lsiden wrote:*   

> Sorry to bother you.

 No bother at all.

----------

## lsiden

Still can't get nvidia.ko to load.  Here's a little bit more info:

* nvidia-1.0.4496

* creates nvidia.ko in /lib/modules/.../video

* linux-kernel-2.6.7-r11

* Prints "No module found in object" to dmesg ring.

I don't know what needs to be in a .ko binary in order for the kernel to consider this a "module" but here's a dump of "objdump -fh ..."

```
nvidia.ko:     file format elf32-i386

architecture: i386, flags 0x00000011:

HAS_RELOC, HAS_SYMS

start address 0x00000000

 

Sections:

Idx Name          Size      VMA       LMA       File off  Algn

  0 .text         0013d960  00000000  00000000  00000040  2**4

                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE

  1 .init.text    00000213  00000000  00000000  0013d9a0  2**0

                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE

  2 .exit.text    000000e1  00000000  00000000  0013dbb3  2**0

                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE

  3 .rodata       00014480  00000000  00000000  0013dca0  2**5

                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA

  4 .modinfo      0000001e  00000000  00000000  00152120  2**0

                  CONTENTS, ALLOC, LOAD, READONLY, DATA

  5 .rodata.str1.1 00000670  00000000  00000000  0015213e  2**0

                  CONTENTS, ALLOC, LOAD, READONLY, DATA

  6 .rodata.str1.4 00000b3b  00000000  00000000  001527b0  2**2

                  CONTENTS, ALLOC, LOAD, READONLY, DATA

  7 __param       000000f0  00000000  00000000  001532ec  2**2

                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA

  8 .data         00019510  00000000  00000000  001533e0  2**5

                  CONTENTS, ALLOC, LOAD, RELOC, DATA

  9 .bss          000090ec  00000000  00000000  0016c900  2**5

                  ALLOC

 10 .comment      00003af7  00000000  00000000  0016c900  2**0

                  CONTENTS, READONLY

 11 .note.GNU-stack 00000000  00000000  00000000  001703f7  2**0

                  CONTENTS, READONLY, CODE

 12 .note         00001504  00000000  00000000  001703f7  2**0

                  CONTENTS, READONLY

```

 in case that might help.  I have no idea what to look for.

----------

## lsiden

Curiously, in the 2.6.5-gentoo-r1 kernel, it's not nvidia.ko, but rather .o.  It works fine.  objdump -fh yields the same header info, although I didn't check to see if all the sections match.

----------

## TheBohemian

I am using:

- X.org

- kernel 2.6.7(-r11)

- NVidia Geforce256

- x86: Athlon Tbird

At first I had the 4496 version of nvidia-kernel and nvidia-glx installed which failed to load (modprobe nvidia => invalid module ...)

Then I emerged:

nvidia-kernel-1.0.6106-r1

opengl-update-1.8.1

nvidia-glx-1.0.6106-r3

emerging opengl-update-1.8.1 will fail the first time. but there is a message telling you what to do.

when starting the x server it complains about two missing symbols but it works though.

----------

## lsiden

Hey!  It worked!  Thanks a million!    :Very Happy: 

----------

