# solution: nvidia driver + gcc 3.4

## haz3l

hello. I had a problem and found an odd solution that I wished to share (incase others were in my same position)- and possibly get insight on what's wrong? (Someone may have already posted this. If so, I apologize.)

My system is a 2ghz p4 running kernel version 2.6.7.

I had mistakenly unmerged nvidia-kernel, no biggy. I then 'emerge -uD world' and merged nvidia-kernel again. I found that nvidia.ko didn't work.  The nvidia module was giving me an odd "invalid module format" error when I attempted to modprobe it and xorg said it couldn't load it.. hmm.   In /var/log/messages I was seeing:

```
korea nvidia: version magic '2.6.7-gentoo-r6 preempt PENTIUM4 4KSTACKS gcc-3.4' should be '2.6.7-gentoo-r6 preempt PENTIUM4 4KSTACKS gcc-3.3
```

Seemed kinda stupid to me. I opened up nvidia.ko with nano and found a line in the middle that had:

```
(other stuff) vermagic=2.6.7-gentoo-r6 preempt PENTIUM4 4KSTACKS gcc-3.4^@depends= (other stuff)
```

I simply changed the 3.4 to 3.3 and viola  :Very Happy:  Is there something I'm missing here or is it as stupid as it looks?

----------

## blaster999

And does 3d work? If everything is ok, then you are right, it is as stupid as it looks.

----------

## desertstalker

The version magic errors are because the kernel and ALL modules need to be compiled with the same version of gcc.  In your case when you did emerge -uD world you emerged a new version of gcc and in this situation should recompile the kernel.

----------

## blaster999

Then it is strange that it works.

----------

## AstralStorm

It's not strange, there had been no ABI changes between gcc-3.3 and 3.4 yet.

Anyway, your gcc got updated and you ought to recompile the kernel with it.  :Wink: 

----------

## graadz

True. But even then nvidia-kernel-1.0.6111-r1 does not insert into a 2.6.9 kernel (using GCC 3.3.4). Everything works with 2.6.8 though. The error I get is:

```

root@blahnik # insmod nvidia.ko

insmod: error inserting 'nvidia.ko': -1 Unknown symbol in module

root@blahnik #

```

G

 *AstralStorm wrote:*   

> It's not strange, there had been no ABI changes between gcc-3.3 and 3.4 yet.
> 
> Anyway, your gcc got updated and you ought to recompile the kernel with it. 

 

----------

## MetatronX99

dont use -r1 for vanilla kernels, use vanilla 1.0.6111

```

emerge =nvidia-kernel-1.0.6111

```

----------

## graadz

I am not using vanilla sources, I am using mm-sources. In anycase, found the solution here.

G

 *MetatronX99 wrote:*   

> dont use -r1 for vanilla kernels, use vanilla 1.0.6111
> 
> ```
> 
> emerge =nvidia-kernel-1.0.6111
> ...

 

----------

## coondog

who's the chick in the picture ?

OH and I'm experiencing the same problems ?

I think a developer needs to take a look at this shite!

----------

## AstralStorm

Get this, includes remap_pfn_range patch.

http://geki.ath.cx/nvidia-kernel-1.0.6111-r1.tar.bz2

(it got updated)

Works fine here with 2.6.9-rc3-mm1.

Another option: http://kernel.damouse.co.uk/nvidia-kernel-1.0.6111-r3.tar.bz2

(haven't tried that)

----------

## coondog

i saw both those earlier and I have not had success with either one.  Oh yeah that's cause they give us files but don't tell us what to do with them.

----------

## tj

there are instructions in this thread https://forums.gentoo.org/viewtopic.php?t=216985

you need to create a portage overlay directory so that you don't wipe out your changes at the next emerge sync

add the overlay directory to /etc/make.conf

download and extract one of the tarballs linked above to your overlay directory

create the digest then emerge /path/to/extracted/ebuild/in full

All of the code is in the link above on the 2nd page, see logic's post

----------

## graadz

 :Smile:   :Smile: 

The chick in the picture is Shahrzad Sepanlou. I confess: I have a weekness for middle-eastern women  :Wink: 

The post from me a little further in this thread should solve your problem if you are running mm-sources. If you run GCC 3.4.2, then you might want to rebuild your kernel image, modules and re-merge nvidia-kernel...-r2 with GCC 3.3.4 and see if that will help.

G

 *coondog wrote:*   

> who's the chick in the picture ?
> 
> OH and I'm experiencing the same problems ?
> 
> I think a developer needs to take a look at this shite!

 

----------

## coondog

same nothing like a middle eastern woman.  Anyway I fixed the problem for me atleasat.  I just downloaded the binary file right from NVIDIA.  Then said no to the download a module for my kernel.  Then told it to build a custom one for my kernel and it worked like a charm.

----------

