# [SOLVED] nvidia module loading prob

## arathalion

ok, my hdd just failed so i went out and bought  a new one (Serves me right for useing so old a drive for /)

and now im reinstalling gentoo... the only differences with my computer are the hdds, the dvdburner (needed a new one) and psu(needed a new one).

so im installing stuff and when i try to startx it doesn t work... after playing with it a bit i get a few differemt messages, but now im getting:

fatal: module not found

failed to load the nvidia kernel module

screens found, but none have a usable configuration

after checking /var/log/Xorg.0.log

i find (around70% through the file) LoadModule:"nvidia"

Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so

blah

and getting down to the error messages at the bottom

** Enabling render acceleration

ee failed to load the nvidia kernel module!

it unloads nvidia, ramdac & fb

ee screens found, but none have useable cfg

fatal server error:

no screens found

xorgcfg 

works and gives me a screen with some stuff on it... but i dont have a mouse... and it complains in /var/log/Xorg.8.log (i think) that :

||Xinput: adding extended input device "Mouse0" (type:mouse)

ee xf86openserial: cannot open device /dev/mouse

       no such file or dir...

ww mouse0: cannot open input dev

should i try linking /dev/mouse to /dev/input/mice or /dev/input/mouse0?

or what... ive never had this much trouble with nvidia drivers (even compileing kernel & glx for redhat 7 was better than this)Last edited by arathalion on Mon Nov 20, 2006 4:20 am; edited 2 times in total

----------

## jmbsvicetto

Hi.

You need to update your device to /dev/input/mice. Did you emerge nvidia-drivers? Did you add nvidia to /etc/modules.autoload.d/kernel-2.6?

----------

## arathalion

/dev/input/mice is there

... i beilive that is the one im trying to use

yes nvidia-drivers

and i was under the impression that the emerge did that for you... it at least said it was doing it....

ok no, i have now, but i dont think thats going to do much as modprobe just says module not found

----------

## jmbsvicetto

If modprobe says it can't find nvidia, there's some error. You need to emerge -av nvidia-drivers, modprobe nvidia and then /etc/init.d/xdm restart.

----------

## arathalion

except that i was doing startx instaid of /etc/init.d/xdm restart that is what i was doing

----------

## madisonicus

 *arathalion wrote:*   

> except that i was doing startx instaid of /etc/init.d/xdm restart that is what i was doing

 

same difference.  either way you're starting X.

----------

## dmpogo

First guess that your nvidia was not compiled for the same kernel that you have booetd now.

Maybe you have installed the modules while booted into another kernel ?  

Also they may require kernel  support for module versioning.

----------

## arathalion

... maby, i did recompile my kernel at some point, but im sure i was running a genkernel one before that... or maby im still running the genkernel one...

ill check that.

no my question hasnt been answerd...

----------

## dmpogo

 *arathalion wrote:*   

> ... maby, i did recompile my kernel at some point, but im sure i was running a genkernel one before that... or maby im still running the genkernel one...
> 
> ill check that.
> 
> no my question hasnt been answerd...

 

Try reinstalling nvidia-drivers,   and see if they load successfully by hand, with modprobe.  

Again, try enabling module versioning iin kernel,  maybe nvidia-driver requires it

(ALSA 1.0.13 refused to load untiil I enable this, while previous ALSA drivers did not require it).

----------

## arathalion

you have no idea how many times ive tried that... though i forgot to look at that in my kernel last time i tried that...

i riped the run file out of /usr/portage/distfiles and ran it... and got a rather interesting message:

"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 sych as rivafb/nvidiafb is present and prevents the NVIDIA kernel module from obtaining ownership of the NVIDIA graphics device(s)."

interesting, there dont seem to be any modules of those names, 

insmod says -1 invalid module format... which is a little more helpfull than modprobe i guess.

im defenatly running the right kernel now (i recompled just to be sure) 

where is this module versioning?

----------

## dev-urandom

Run the following in a shell prompt:

```
modinfo nvidia | grep `uname -r`
```

and post the output here. Simple rule of thumb - if this does not return any output, you have compiled the driver for the wrong kernel. 

And, if you do get some output, modprobe nvidia and do a dmesg | tail. See whether there are any errors reported, and also attach the output to the post here.

EDIT: I saw your previous post - it looks like you have a gcc mistmatch. Can you post the output of gcc -v and also the entire thing that modinfo nvidia gives?

----------

## arathalion

modinfo: could not find module nvidia

Using built-in specs.

Target i686-pc-linux-gnu

Configured with: /var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.1 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.1.include --datadir=/usr/share/gcc-data/i686-pc-linux/4.1.1 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/man...more stuff with dirs(sorry, glanceing back and forth is herting my eyes cause the ref rate is slow)... --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --diable-libssp --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocal=gnu

Thread model: posix

gcc version 4.1.1 (Gentoo 4.1.1)

should i reemerge kernel-sorces and gcc?

----------

## dev-urandom

 *arathalion wrote:*   

> modinfo: could not find module nvidia

 

Since you have tried installing the nvidia-drivers package, it's strange that the module did not get installed. Can you run this command on your pc? find /lib/modules -name nvidia\*

 *arathalion wrote:*   

> 
> 
> should i reemerge kernel-sorces and gcc?

 

See cat /proc/version and see whether the gcc version there matches 4.1.1. If it doesn't, just recompile your kernel again.

----------

## dmpogo

Do you have   /usr/src/linux symlink pointing at the correct kernel ?

----------

## arathalion

/lib/modules/2.6.18-gentoo-r2/

kernel/drivers/char/agp/nvidia-agp.ko

video/nvidia.ko

ive recompiled my kernel 3 times, it should be right, though ill check next time i boot (couldnt remembre the file name)

Do you have /usr/src/linux symlink pointing at the correct kernel ?

yes .i only have the sources for one kernel.

----------

## dmpogo

 *arathalion wrote:*   

> /lib/modules/2.6.18-gentoo-r2/
> 
> kernel/drivers/char/agp/nvidia-agp.ko
> 
> video/nvidia.ko
> ...

 

OK, good

so what

```

modprobe nvidia

```

says ?

----------

## arathalion

module not found

----------

## dev-urandom

 *arathalion wrote:*   

> module not found

 

Try running depmod -a. That will update your Symbols.map file and probably might help the system to detect the module.

----------

## dmpogo

 *dev-urandom wrote:*   

>  *arathalion wrote:*   module not found 
> 
> Try running depmod -a. That will update your Symbols.map file and probably might help the system to detect the module.

 

If this does not help, could you post the output of 

```

uname -r

```

and 

```

grep nvidia /lib/modules/2.6.18-gentoo-r2/*

```

----------

## arathalion

ahh, i see the problem, but im not sure how to fix it.

uname -r 2.6.17-gentoo-r7

now what i compiled should be 2.6.18-gentoo-r2, so then the drivers are compiled for the wrong kernel

i hope you still dont want the output of 

grep nvidia /lib/modules/2.6.18-gentoo-r2/* as there is a full page of it. will post if wanted

omg i feel like such an idiot, i simpily copied the genkernel grub lines then deleted everything that wasnt needed, forgeting to change the kernel.

im a fool.

thank you all verry much for the help.

----------

## dmpogo

 *arathalion wrote:*   

> ahh, i see the problem, but im not sure how to fix it.
> 
> uname -r 2.6.17-gentoo-r7
> 
> now what i compiled should be 2.6.18-gentoo-r2, so then the drivers are compiled for the wrong kernel
> ...

 

The drivers may be compiled right,   based you having a long output from that 'grep',   however when modprobe loads modules it uses

'uname -r' to deterime the running kernel and tries to load from /lib/modules/`uname -r`  directory, and of course, does not find nvidia module there.

Check your  /boot/grub/grub.conf   for the boot line to see that it does not call the kernel mistakely 2.6.17

EDIT: sorry, I see that you did find the grub error.

----------

