# [Solved] NVIDIA kernel module not found.

## neggard

After a successful installation of my new kernel with help in this thred https://forums.gentoo.org/viewtopic-p-5929697.html#5929697

I got some problem with my Nvidia card.

My genkernel still works good but my new kernel have some problem.

When I boot the graphics dont start, and the error log tell me "Failed to load the Nvidia kernel module"

If I add nvidia in  nano /etc/modules.autoload.d/kernel-2.6

my genkernal loads it and also vboxdrv but when starting my new kernel it wont load.

I dont know how to start to get this solved...Last edited by neggard on Thu Aug 20, 2009 1:52 pm; edited 1 time in total

----------

## Xarthisius

If you installed new kernel you have to reemerge nvidia-drivers, but prior to that make sure that /usr/src/linux points to the right directory, i.e. your new kernel

Cheers,

Xarthisius

----------

## neggard

I have reemerge the nvidia drivers but after that the same error.

The  /usr/src/linux points to right directory.

But in  /usr/src/linux could I edit some file to load the nvidia module?

----------

## Xarthisius

To automatically load module you can add nvidia to /etc/modules.autoload.d/kernel-2.6 (or /etc/conf.d/modules if you have baselayout-2) but if it fails to load manually that won't do much.

Can you post exact error message after 

```
modprobe nvidia
```

, your dmesg, output of 

```
 grep NVRM /var/log/messages
```

 and

```
ls -l /lib/modules/`uname -r`/video
```

Xarthisius

----------

## neggard

modprobe nvidia

FATAL: Module nvidia not found

grep NVRM /var/log/messages

This command dont print any text.

ls -l /lib/modules/`uname -r`/video

ls: cannot access /lib/modules.....

No such file or directory

----------

## Xarthisius

After successful installation of nvidia-drivers you should be able to reproduce the following:

```
shakuras xarth # uname -r

2.6.30-gentoo-r3

shakuras xarth # ls -l /usr/src/linux

lrwxrwxrwx 1 root root 22 Jul 22 14:04 /usr/src/linux -> linux-2.6.30-gentoo-r3

shakuras xarth # ls -l /lib/modules/2.6.30-gentoo-r3/video/

-rw-r--r-- 1 root root 12247533 Aug  2 19:21 nvidia.ko
```

uname returns version of kernel your are running. When you install external kernel module, it checks symbolic link /usr/src/linux and put compiled module to the dir /lib/modules/KERNEL_VER_POINTED_BY_SYMLNK/.

Could you emerge the following:

```
emerge app-portage/gentoolkit
```

Afterwards execute:

```
equery f nvidia-drivers | grep "nvidia.ko"
```

this will allow you to find where is nvidia module created during last emerge of nvidia-drivers.

If there are no results, as a last resort you can always try to install the driver manually.

```
shakuras xarth # find /usr/portage/distfiles -name "NVIDIA*"

/usr/portage/distfiles/NVIDIA-Linux-x86_64-185.18.31-pkg2.run

shakuras xarth # sh /usr/portage/distfiles/NVIDIA-Linux-x86_64-185.18.31-pkg2.run
```

Cheers,

Xarthisius

----------

## neggard

Still some problem.

When I reinstall the nvidia drivers it installs in my old  2.6.29-r5 but not in my 2.6.30-r4

How can I install in the right directory?

----------

## Xarthisius

Could paste output of following commands?

```
uname -r
```

and

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

Best regards,

Xarthisius

----------

## krinn

 *neggard wrote:*   

> modprobe nvidia
> 
> FATAL: Module nvidia not found
> 
> grep NVRM /var/log/messages
> ...

 

your nvidia driver can't install, because you fail to properly install your kernel.

try

```
cd /usr/src/linux

make modules_install && emerge nvidia-drivers && modprobe nvidia

```

----------

## neggard

uname -r

2.6.30-gentoo-r4

ls -l /usr/src/linux

lrwxrwxrwx 1 root root 22 jul  2  04:22  /usr/src/linux -> linux-2.6.29-gentoo-r5

cd /usr/src/linux

make modules_install && emerge nvidia-drivers && modprobe nvidia 

this make my genkernel stop working with same error that my other with graphics problem,

but it also dstroy networkdriver for genkernal.

----------

## Xarthisius

 *neggard wrote:*   

> uname -r
> 
> 2.6.30-gentoo-r4
> 
> ls -l /usr/src/linux
> ...

 

This is your problem, which I've suggested at the very beginning... Read carefully everything that was written here so far, please...

Best regards,

Xarthisius

P.s. Please read http://www.gentoo.org/doc/en/kernel-upgrade.xml especially 4. and 6.

----------

## krinn

check also eselect kernel list

but as xarthisius suggest, read the kernel guide.

----------

## pappy_mcfae

Definitely. The only time this is an issue is when the nvidia module is compiled against a different version of the kernel than the one you're trying to load.

Blessed be!

Pappy

----------

## vincent-

```
rm /usr/src/linux

ln -s /usr/src/linux-2.6.30-gentoo-r4/ /usr/src/linux

emerge --oneshot nvidia-drivers
```

----------

## neggard

The problem was the symbolic link.

thanks for all help.

----------

## pappy_mcfae

Awesome! Happy Gentooing.

Blessed be!

Pappy

----------

