# Problem with nVidia and my kernel :(

## KqMi

Hi everyone,

First, I apologize for every language fault I'm probably going to make  :Wink: 

So, I'm trying to install X-org, and as many users before me, I'm in trouble with kernel/nvidia drivers ect...

I read many topics about nvidia but none resolved my problem  :Sad:  so I'm asking help to you :

I've read that lastest version of xorg isn't stable or compatible with nvidia-drivers so I had this to my  /etc/portage/packages.mask file :

```

>=x11-base/xorg-server-1.1.0

>=x11-base/xorg-x11-7.1

>=x11-drivers/xf86-video-vesa-1.2.1

>=x11-drivers/xf86-video-vesa-1.2.0

>=x11-drivers/xf86-input-keyboard-1.1.0

>=x11-drivers/xf86-input-joystick-1.1.0

>=x11-drivers/xf86-input-mouse-1.1.1

>=x11-drivers/xf86-video-nv-1.1.2

```

as the french wiki suggest.

One of my biggest problem after that is that I've tried so many things so many times that I'm kinda lost in it... I know that I've tried to

```
emerge nvidia-glx
```

 which must emerge nvidia-kernel as a depedence but that didn't solve anything  :Sad: 

I've also think about make my kernel "by hand" and not with gen-kernel... that must be the best solution by I'm a little frightened with it... and I don't want to re-install everything from the very-beggining once again  :Very Happy: 

For this kernel i've just followed http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#manual and adding the http://www.gentoo.org/doc/fr/nvidia-guide.xml nvidia modification after it.

After 

```
make && make modules_install
```

 I received this :

```
WARNING: /lib/modules/2.6.17-gentoo-r4/video/nvidia.ko needs unknown symbol pm_unregister

WARNING: /lib/modules/2.6.17-gentoo-r4/video/nvidia.ko needs unknown symbol remap_page_range

WARNING: /lib/modules/2.6.17-gentoo-r4/video/nvidia.ko needs unknown symbol pci_find_class

```

and that's why I didn't set this new kernel as my system kernel.

I've also tried out the nvidia utilities,

It said :

```
 No matching precompiled kernel interface was found on the NVIDIA ftp site; this means

  that the installer will need to compile a kernel interface for your kernel. 

ERROR: Unable to load the 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 is present and prevents

         the NVIDIA kernel module from obtaining ownership of the NVIDIA graphics                   device(s).

         Please see the log entries 'Kernel module load error' and 'Kernel messages' at             the end of the file '/var/log/nvidia-installer.log' for more information.
```

When I tried to "Xorg -configure" it made a config file and just specified that my mouse wasn't detected. I resolved it by replacing /dev/mouse with /dev/input/mouse0 but when I try X -config ....../xorg.conf it says "No screens detected" (sorry i havn't write the message)

Right now, i've unmerge nvidia-glx and nvidia-kernel in order to try starting installing X from the "beggining" (Xorg is still merged on my system) but I would really apprecied if you give me a hand  :Smile: 

----------

## wynn

If you've got xorg-x11-7.0-r1 installed then

```
emerge x11-drivers/nvidia-drivers
```

should install 1.0.8762-r1 (stable on amd64 and x86) which works here.

The old media-video/nvidia-glx and media-video/nvidia-kernel are deprecated in favour of the new x11-drivers/nvidia-drivers.

```
WARNING: /lib/modules/2.6.17-gentoo-r4/video/nvidia.ko needs unknown symbol pm_unregister
```

means you've got an old version of the nvidia kernel module which hasn't been changed to work with the 2.6.17 kernel.

----------

## KqMi

 *wynn wrote:*   

> If you've got xorg-x11-7.0-r1 installed then
> 
> 

 

Hmmmm... in fact I think I've add stuff in packages.mask AFTER merging xorg >_<

should I unmerge and emerge it again ? And if I've to, should I unmerge all depedencies which had been installed with it ?

and by the way, another newbie question : If I've a AMD64 but installed a x86, I must consider my system as a i686 system and not a amd64 one right ?

----------

## KqMi

so,

I've try the command you suggested :

```

emerge --unmerge nvidia-kernel

emerge x11-drivers/nvidia-drivers

etc-update

Xorg -configure

emacs /root/xorg.conf.new

 X -config /root/xorg.conf.new

```

and it results :

```

_XSERVTransSocketOpenCOTSServer: Unable to open socket for inet6

_XSERVTransOpen: transport open failed for inet6/marvin:0

_XSERVTransMakeAllCOTSServerListeners: failed to open listener for inet6

X Window System Version 7.0.0

Release Date: 21 December 2005

X Protocol Version 11, Revision 0, Release 7.0

Build Operating System:Linux 2.6.17-gentoo-r4 i686

Current Operating System: Linux marvin 2.6.17-gentoo-r4 #1 SMP Wed Aug 9 01:09:41 Local time zone must be set--see zic m i686

Build Date: 12 August 2006

        Before reporting problems, check http://wiki.x.org

        to make sure that you have the latest version.

Module Loader present

Markers: (--) probed, (**) from config file, (==) default setting,

        (++) from command line, (!!) notice, (II) informational,

        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.

(==) Log file: "/var/log/Xorg.0.log", Time: Sun Aug 13 16:30:31 2006

(++) Using config file: "/root/xorg.conf.new"

(EE) NVIDIA(0): Failed to initialize the GLX module; please check in your X

(EE) NVIDIA(0):     log file that the GLX module has been loaded in your X

(EE) NVIDIA(0):     server, and that the module is the NVIDIA GLX module.  If

(EE) NVIDIA(0):     you continue to encounter problems, Please try

(EE) NVIDIA(0):     reinstalling the NVIDIA driver.

FATAL: Error inserting nvidia (/lib/modules/2.6.17-gentoo-r4/video/nvidia.ko): Invalid module format

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

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

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

Fatal server error:

no screens found

```

----------

## wynn

Sorry, I think you're missing

```
eselect opengl set nvidia
```

----------

## Headrush

Un-merging nvidia-kernel doesn't always remove the kernel module. Try

```
rm /lib/modules/2.6.17-gentoo-r4/video/nvidia.ko
```

and then try emerging nvidia-drivers. After that don't forget to eselect opengl set nvidia

Edit:  *KqMi wrote:*   

> Current Operating System: Linux marvin 2.6.17-gentoo-r4 #1 SMP Wed Aug 9 01:09:41 Local time zone must be set--see zic m i686

 

You may want to set you timezone too to avoid future issues.

----------

## KqMi

ok so:

```

emerge --unmerge nvidia-glx

emerge --unmerge nvidia-kernel

```

(in order to be sure ^^)

then :

```

emerge --unmerge x11-drivers/nvidia-drivers

rm /lib/modules/2.6.17-gentoo-r4/video/nvidia.ko

emerge nvidia-glx

etc-update

```

and then, according to the http://www.gentoo.org/doc/fr/nvidia-guide.xml tutorial :

```

modprobe nvidia

```

but I'received :

```

marvin ~ # modprobe nvidia

FATAL: Error inserting nvidia (/lib/modules/2.6.17-gentoo-r4/video/nvidia.ko): Invalid module format

```

I'm really starting to think that my kernel has a problem with my video card  :Sad: 

----------

## Headrush

Are you sure your kernel and nvidia-drivers were compiled with the exact same version of gcc? (No gcc updates lately)

----------

## KqMi

I suppose so because I havn't touch gcc since first compilation on my system  :Sad: 

----------

## wynn

In your first reply to Headrush you said

```
emerge --unmerge x11-drivers/nvidia-drivers

rm /lib/modules/2.6.17-gentoo-r4/video/nvidia.ko

emerge nvidia-glx

etc-update 
```

shouldn't that have been

```
emerge --unmerge x11-drivers/nvidia-drivers

rm /lib/modules/2.6.17-gentoo-r4/video/nvidia.ko

emerge x11-drivers/nvidia-drivers

etc-update 
```

not emerging nvidia-glx?

----------

## Headrush

 *wynn wrote:*   

> In your first reply to Headrush you said
> 
> ```
> emerge --unmerge x11-drivers/nvidia-drivers
> 
> ...

 

Which is strange also because the error said invalid format, not not found. 

So I'm guessing he did nvidia-kernel and nvidia-glx but then screwed up his post. Hopefully you are right and it is that simple.   :Smile: 

----------

## wynn

 *Quote:*   

> Which is strange also because the error said invalid format, not not found.

 Yes, I thought it might have been a catch-all error message.

 *Quote:*   

> Hopefully you are right and it is that simple

 Fingers crossed...

----------

## KqMi

yeah you was right I screwed up when merging.

Unfortunally with 

```

emerge x11-drivers/nvidia-drivers

etc-update

modprobe nvidia

```

give this :

```

FATAL: Error inserting nvidia (/lib/modules/2.6.17-gentoo-r4/video/nvidia.ko): Invalid module format

```

 :Sad: 

----------

## wynn

Isn't Google wonderful!

You should be able to find a more detailed error message in the kernel log, probably /var/log/messages. You can also try

```
modprobe -vv nvidia
```

```
modinfo nvidia
```

will also give useful information like "vermagic".

----------

## KqMi

I honnestly don't understand a line in /var/log/message ^^

```
modprobe -vv nvidia
```

gives me :

```

insmod /lib/modules/2.6.17-gentoo-r4/video/nvidia.ko

FATAL: Error inserting nvidia (/lib/modules/2.6.17-gentoo-r4/video/nvidia.ko): Invalid module format

```

i'm going to try on google but I'm really lost in this :/

----------

## KqMi

Wow i've juste found the english wiki for installing nvidia drivers it's much more complete that the french one  :Surprised: 

I really think I'm going to have my kernel rebuild

----------

## wynn

It should just be the last line or two in /var/log/messages just after you have tried "modprobe -vv nvidia".

----------

## jackgentoo

 *wynn wrote:*   

> 
> 
> The old media-video/nvidia-glx and media-video/nvidia-kernel are deprecated in favour of the new x11-drivers/nvidia-drivers.
> 
> 

 

Why does the nvidia how-to not reflect this? Should I file a bug against it so no more people like me have to suffer with using the wrong proceedure?

----------

## wynn

I think it came out in the notice (which can be read after it has scrolled by using enotice) when emerging nvidia-kernel and nvidia-glx.

From /usr/portage/media-video/nvidia-kernel/nvidia-kernel-1.0.8762-r1.ebuild

```
ewarn ""

ewarn "The NVIDIA drivers found in media-video/nvidia-kernel and"

ewarn "media-video/nvidia-glx are being combined and moved to x11-drivers."

ewarn "There will be two new ebuilds available:"

ewarn ""

ewarn "    x11-drivers/nvidia-drivers - The latest drivers from NVIDIA for"

ewarn "                                 video cards newer than GeForce 2 or"

ewarn "                                 Quadro 2 video cards."

ewarn ""

ewarn "    x11-drivers/nvidia-legacy-drivers - A special release of NVIDIA"

ewarn "                                 graphics drivers to support cards"

ewarn "                                 as old or older than the GeForce 2"

ewarn "                                 or Quadro 2 video cards."

ewarn ""

ewarn "Please test these new drivers packages on your system.  The packages"

ewarn "found in media-video will be phased out."

ewarn ""

ewarn "Note: the two package system (nvidia-kernel and nvidia-glx) is being"

ewarn "phased out to make driver installation more straight forward and to"

ewarn "aid in ebuild up keep."

ewarn ""
```

----------

## luqas

Just upgraded to gcc 4.1.1 and getting the invalid format error on my nvidia driver.   Here is the message from /var/log/messages after doing modprobe -vv nvidia.

```

nvidia: version magic '2.6.7-ck1 preempt mod_unload K8 gcc 4.1' should be '2.6.7-ck1 preempt mod_unload K8 gcc-3.4'

```

I am assuming that means this nvidia source does not like some of the ABI changes from gcc 3.4 to 4.1?  Either way I don't have a resolution yet.   btw using nvidia-drivers version 1.0.8774

Steps of upgrade:

--------------------------------------------------------------

echo sys-devel/gcc >> /etc/portage/package.keywords

echo dev-libs/gmp >> /etc/portage/package.keywords

emerge -uav gcc

gcc-config i686-pc-linux-gnu-4.1.1

source /etc/profile

emerge --oneshot -av libtool

emerge -eav system

emerge -eav world

re-compiled my kernel

booted the new kernel

recompiled the nvidia driver

gcc --version

-------------------------------------

gcc (GCC) 4.1.1 (Gentoo 4.1.1)

gcc-config -l

--------------------------------------------------------

[1] i686-pc-linux-gnu-3.4.6

[2] i686-pc-linux-gnu-3.4.6-hardened

[3] i686-pc-linux-gnu-3.4.6-hardenednopie

[4] i686-pc-linux-gnu-3.4.6-hardenednopiessp

[5] i686-pc-linux-gnu-3.4.6-hardenednossp

[6] i686-pc-linux-gnu-4.1.1  *

Edit:  Resolved.  I was  stupid and accidentally edited the kernel line in my grub.conf that was remarked out instead of the correct line, thus I was still booting off of the 3.4.6 compiled kernel.

----------

