# nvidia.ko invalid module format

## someone12345

Hi!

I run kernel 2.6.14-r4 and try no make ~amd64 nvidia (i.e. 8178)  working on it but the module can't be loaded:

FATAL Error inserting nvidia (/lib/.../nvidia.ko): Invalid module format

Failed to load the NVIDIA kernel module!

*** Aborting ***

Can somebody explain (and fix  :Smile: . Invalid module format?

Thanks!

----------

## NeddySeagoon

someone12345,

It probably means that you have updated gcc since you built your kernel.

You need to recompile and reinstall your kernel, since the kernel and all its modules must be built with the same version of gcc.

Ensure you run start with

```
make clean
```

 in the kernel tree to remove all the old binaries.

Sometimes, 

```
emerge module-init-tools
```

is also required. That provides tools like modprobe.

----------

## someone12345

 *NeddySeagoon wrote:*   

> 
> 
> It probably means that you have updated gcc since you built your kernel.

 

Unfortunately no  :Sad:  I rebuild and reinstalled the kernel.

Actually X was working before but I had lots of problems - probably because of the GCC update - so I rebuild the entire system. And now I do have the mentioned nvidia problem...

----------

## someone12345

Oops, sorry, you were right, I'd to reemerge module-init-tools

Thanks

----------

## alamuru420123

This sure helped me out. I was having the same problem and couldn't understand for the life of me, why it wasn't working. But after re-compiling the kernel, and re-emerging module-init-tools, I rebooted and everything is right in the world  :Smile: .

Thanks.

----------

## Karl_R

Thanks for this, I just ran into the same problem after upgrading gcc.

I read the tutorial at http://www.gentoo.org/doc/en/gcc-upgrading.xml but all it said was 

```
Common Pitfalls

It's important to disable distcc during upgrade. Mixing compiler versions on your nodes will cause build issues. This is not required for ccache, as the cache objects will be invalidated anyway.

Always use same GCC version for your kernel and additional kernel modules. Once you rebuild your world with new GCC, external modules (like app-emulation/qemu-softmmu) will fail to load. Please rebuild your kernel with new GCC to fix that.

```

perhaps it would be handy to specifically say that module-init-tools also needs to be recompiled?

Thanks again

Karl  :Wink: 

----------

