# fglrx invalid module format [SOLVED]

## Alvin

I compiled the most recent stable ati-drivers in portage, but when I try and load fglrx, it says:

```
# modprobe fglrx

FATAL: Error inserting fglrx (/lib/modules/2.6.17-gentoo-r8/kernel/drivers/char/drm/fglrx.ko): Invalid module format
```

dmesg returns:

```
# dmesg | grep fglrx

fglrx: disagrees about version of symbol struct_module

fglrx: disagrees about version of symbol struct_module

fglrx: disagrees about version of symbol struct_module
```

..and fglrxinfo:

```
# fglrxinfo

display: :0.0  screen: 0

OpenGL vendor string: Mesa project: www.mesa3d.org

OpenGL renderer string: Mesa GLX Indirect

OpenGL version string: 1.2 (1.5 Mesa 6.5.1)
```

I get no errors when I run, but it's very choppy and slow. I've recompiled my kernel and the drivers various times. Any ideas?

Thanks.Last edited by Alvin on Sat Nov 04, 2006 8:51 am; edited 1 time in total

----------

## NeddySeagoon

Alvin,

It looks like you are not using the ATI driver.

First, 

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

sometimes that fixes it and its quick to do.

If that doesn't help, rebuild your kernel and all its modules and all your third party kernel modules starting with 

```
make clean
```

in the kernel tree. This gets rid of all the old binaries, so make cannot reuse them.

You are now confident that everything is built with the same gcc version and the same major configuration options that affect the kernel and all the modules. The driver should load now.

----------

## Alvin

 *NeddySeagoon wrote:*   

> Alvin,
> 
> It looks like you are not using the ATI driver.
> 
> First, 
> ...

 

Thanks for the quick reply! I'll try this out in a bit - emerging some other things right now.

----------

## wynn

"Invalid module format" is usually due to a mismatch between the vermagic string for running kernel and for the module. Again, usually caused by the module not being compiled against the source for the running kernel.

You will find more information and where to check at "FATAL: invalid module format" and vermagic

----------

## Alvin

I tried recompiling my kernel with make clean, and the compiling ati-drivers against it - it didn't do anything though  :Sad: 

My problem isn't an outdated gcc (I've always used 3.4.4-r1), and I get no errors that suggest so either. I haven't rebooted since I built the drivers, I did reboot after a kernel compile though.

----------

## wynn

 *Alvin wrote:*   

> I tried recompiling my kernel with make clean, and the compiling ati-drivers against it - it didn't do anything though 
> 
> My problem isn't an outdated gcc (I've always used 3.4.4-r1), and I get no errors that suggest so either. I haven't rebooted since I built the drivers, I did reboot after a kernel compile though.

 After a modprobe which fails with "Invalid module format" there will be an error message like this

```
Nov  3 17:44:04 lightfoot [ 8005.937546] ath_pci: version magic '2.6.17-gentoo-r7 SMP preempt mod_unload PENTIUM4 gcc-4.1' should be '2.6.18-gentoo-r1 SMP preempt mod_unload PENTIUM4 REGPARM gcc-4.1'
```

in /var/log/messages â it should be the last message so you can do "tail /var/log/messages" to see it.

Could you post this error message â or whatever error message it gives?

----------

## Alvin

 *wynn wrote:*   

>  *Alvin wrote:*   I tried recompiling my kernel with make clean, and the compiling ati-drivers against it - it didn't do anything though 
> 
> My problem isn't an outdated gcc (I've always used 3.4.4-r1), and I get no errors that suggest so either. I haven't rebooted since I built the drivers, I did reboot after a kernel compile though. After a modprobe which fails with "Invalid module format" there will be an error message like this
> 
> ```
> ...

 

```
Nov  3 17:53:07 localhost sudo:    alvin : TTY=pts/0 ; PWD=/home/alvin ; USER=root ; COMMAND=/sbin/modprobe fglrx

Nov  3 17:53:07 localhost fglrx: disagrees about version of symbol struct_module
```

That's all it says.

----------

## NeddySeagoon

Alvin,

You are not running your new kernel, or new ati-drivers or both.

```
Nov  3 17:44:04 lightfoot [ 8005.937546] ath_pci: version magic '2.6.17-gentoo-r7 SMP preempt mod_unload PENTIUM4 gcc-4.1' should be '2.6.18-gentoo-r1 SMP preempt mod_unload PENTIUM4 REGPARM gcc-4.1'
```

shows that your kernel was made with the REGPARM option in effect and the module, in this case ath_pci, was not.

What time/date does uname -a show ? Is it the time/date of you most recent kernel compile ?

Thats the build time of the running kernel. Look at the kernel name there too. Compare the name with 

```
ls -l /usr/src/linux
```

The kernel pointed to by the symlink is the kernel you are building third party modules for. Its normal for it to be the same as the running kernel. 

If that all looks ok, did you rum make modules_install to install the newly made kernel modules into /lib/modules/`uname -r`/ ?

----------

## Alvin

It works! Thanks very much to both of you. Turns out my bootloader was loading the old kernel by default. Everything works nicely now.

----------

