# [SOLVED]nvidia-driver

## grumpy.biatch

I installed nvidia driver as per  *Quote:*   

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

 

I've followed all the steps as per guide and at the end I get this error -

```
#lsmod | grep nvidia && rmmod nvidia

#modprobe nvidia

Fatal: Error inserting nvidia (/lib/modules/2.6.34-gentoo-r12/video/nvidia.ko): Invalid module format
```

How to fix thisLast edited by grumpy.biatch on Thu Nov 11, 2010 3:15 pm; edited 1 time in total

----------

## rndusr

First of all, make sure that you use the same kernel that nvidia-drivers were built against. That is,

```
uname -r
```

and

```
eselect kernel show
```

should refer to the same kernel. (nvidia-drivers are compiled against the "eselected" kernel, and if you try to use it with another one there will likely be breakage.)

----------

## chithanh

This error can also come if you upgraded gcc or changed your kernel config since the kernel was built. Check dmesg for a more detailed error message.

----------

## grumpy.biatch

 *chithanh wrote:*   

> This error can also come if you upgraded gcc or changed your kernel config since the kernel was built. Check dmesg for a more detailed error message.

 

Yeah I updated gcc and have changed kernel config for removing nvidia fb and revafb. How do i fix it.

----------

## grumpy.biatch

 *PanzerKanzler wrote:*   

> First of all, make sure that you use the same kernel that nvidia-drivers were built against. That is,
> 
> ```
> uname -r
> ```
> ...

 

I am compiling kde atm, will get back shortly.

----------

## grumpy.biatch

 *PanzerKanzler wrote:*   

> First of all, make sure that you use the same kernel that nvidia-drivers were built against. That is,
> 
> ```
> uname -r
> ```
> ...

 

```

# uname -r

2.6.34-gentoo-r12

# eselect kernel show

usr/src/linux-2.6.34-gentoo-r12

```

----------

## grumpy.biatch

I tried to install latest nvidia driver by doing -

```
wget http://uk.download.nvidia.com/XFree86/Linux-x86_64/260.19.12/NVIDIA-Linux-x86_64-260.19.12.run

chmod a+x NVIDIA*.run

./!$
```

It bought NVIDIA screen with license agreement and stuff, I went thru and at the time of loading kernel module it returned error. I checked /var/log/nvidia....

It confirms conflicts with nvidiafb, gcc

Here is the log -

 *Quote:*   

> Error: Unable to load kernel module 'nvidia.ko'. This happens most frequently when this kernel module was built against the wrong or improperly configured kernel sources with a version of gcc that differs from the one used to build the target kernel, or if a driver such as rivafb, nvidiafb, or nouveau is present and prevents the NVIDIA kernel module from obtaining ownership of the NVIDIA graphics device(s), or NVIDIA GPU installed in this system is not supported by this NVIDIA Linux graphics driver release.
> 
> --> kernel module load error: insmod: error in starting './kernel/nvidia.ko': -1
> 
>      Invalid module format
> ...

 

----------

## grumpy.biatch

Is it a bug with gcc 4.4, how i can downgrade to gcc 4.3 and later link it to 4.4

----------

## chithanh

 *grumpy.biatch wrote:*   

> Yeah I updated gcc and have changed kernel config for removing nvidia fb and revafb. How do i fix it.

 You need to compile your kernel again and install to /boot . Verify with "uname -a" (build date and time) that you are running the kernel that you just built.

----------

## grumpy.biatch

 *chithanh wrote:*   

>  *grumpy.biatch wrote:*   Yeah I updated gcc and have changed kernel config for removing nvidia fb and revafb. How do i fix it. You need to compile your kernel again and install to /boot . Verify with "uname -a" (build date and time) that you are running the kernel that you just built.

 

Can I just downgrade gcc by doing  *Quote:*   

> emerge -av gcc

  and  *Quote:*   

> emerge -e world

 

----------

## chithanh

No, this won't work. What you can try is to switch back to the old gcc with gcc-config, then build nvidia-drivers, then switch to new gcc again.

But all this is more work than a simple kernel recompile.

----------

## grumpy.biatch

 *chithanh wrote:*   

> No, this won't work. What you can try is to switch back to the old gcc with gcc-config, then build nvidia-drivers, then switch to new gcc again.
> 
> But all this is more work than a simple kernel recompile.

 

Ok, I will just enable something in kernel and run make or I need to get new source and build from there.

----------

## grumpy.biatch

I recompiled the kernel and installed nvidia 260.19.12. I added nvidia in autoload modules and stuff. When I run 'startx' it returns error 

 *Quote:*   

> Failed to load module "dri"
> 
> Failed to load module "dri2'
> 
> /etc/X11/xinit/xinitrc: line 58:twm: command not found
> ...

 

Should I manually edit xorg.conf or how. I have all details for xorg.conf from other linux on the same box.

Secondly, kernel doesnt load alsa, how to check whats keeping it from loading. 

Best,

David

----------

## chithanh

Don't mix different issues in one forum thread.

Your X starts ok, the missing dri/dri2 are normal as Nvidia does not use dri.

If you had installed twm and xterm, you would have seen some windows. You can proceed to install and start a login manager like gdm or kdm now.

----------

## grumpy.biatch

 *chithanh wrote:*   

> Don't mix different issues in one forum thread.
> 
> Your X starts ok, the missing dri/dri2 are normal as Nvidia does not use dri.
> 
> If you had installed twm and xterm, you would have seen some windows. You can proceed to install and start a login manager like gdm or kdm now.

 

Please correct me if I am wrong -

 *Quote:*   

> # emerge kdebase-startkde                      
> 
> # emerge kmenuedit                                  
> 
> # emerge kate kcontrol knetattach konqueror konsole 
> ...

 

----------

## Chiitoo

As mentioned, it would seem like X works, it's just not doing anything because you don't have the default apps installed.

Though you are telling it to exec kdestart there, but before the exit during the set-up, as david, what did startx do then?

After the reboot, you were starting it as 'david', and not as 'root' or somet other user, yes?

Oh, wait a sec.

Just noticed, perhaps it's the xdm part doing it?

The X Display Manager needs xterm to work, if I'm not wrong...

I do not use xdm or any other manager for that matter, nor have I specified the XSESSION anywhere else than xinitrc, where I only have 'exec startkde' and I use startx to go to KDE.

That said, I'm just guessing here since I don't use it myself, I can't be certain.

----------

## grumpy.biatch

 *Chiitoo wrote:*   

> As mentioned, it would seem like X works, it's just not doing anything because you don't have the default apps installed.
> 
> Though you are telling it to exec kdestart there, but before the exit during the set-up, as david, what did startx do then?
> 
> After the reboot, you were starting it as 'david', and not as 'root' or somet other user, yes?
> ...

 

Well I got it sorted out, was initially confused since 260.19.12 onwards do not use glx module and the xorg.conf had no mention of it. I installed xterm and on startx it took me to gui.

----------

