# [SOLVED] nvidia-kernel wont compile...

## m4tu-

hi!

i hope this went in the right section.

well, to my problem:

i have a nvidia fx5200 graphics card and i recently tried to install the nvidia drivers.

before i used slackware and with it the drivers were running fine but now as i switched to gentoo i have major problems installing the drivers.

i did just as in the nvidia-guide and i have genkernel so i already have thos kernel modules. so i start to emerge the nvidia-glx package. but then i get this:

```
cripts/mod/modpost -m  -i /usr/src/linux-2.6.16-gentoo-r3/Module.symvers /var                      /tmp/portage/nvidia-kernel-1.0.6629-r5/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr/src/nv/nvidia.o

/bin/sh: scripts/mod/modpost: No such file or directory

make[3]: *** [__modpost] Error 127

make[2]: *** [modules] Error 2

NVIDIA: left KBUILD.

nvidia.ko failed to build!

make[1]: *** [module] Error 1

make: *** [module] Error 2

!!! ERROR: media-video/nvidia-kernel-1.0.6629-r5 failed.

!!! Function linux-mod_src_compile, Line 512, Exitcode 2

!!! Unable to make                

IGNORE_CC_MISMATCH=yes V=1 S                      YSSRC=/usr/src/linux SYSOUT=/usr/src/linux clean module.
```

any ideas?

oh, and i also tried the .run file from nvidia.com it didn't help either, came up with an error

EDIT: searched in some log files and i found this:

```
WARNING: Symbol version dump /usr/src/linux-2.6.16-gentoo-r3/Module.symvers

           is missing; modules will have no dependencies and modversions.
```

Last edited by m4tu- on Sun May 07, 2006 10:17 am; edited 1 time in total

----------

## NeddySeagoon

m4tu-,

You are trying to build the NVIDIA-Linux-x86-1.0-6629 driver, which is too old for your card.

You need to unmask the testing nVidia drivers by adding

```
media-video/nvidia-kernel ~<your-arch>

media-video/nvidia-glx ~<your-arch>
```

to the file /etc/portage/package.keywords. These testing packages may depend on other testing packages. Look out for an error when you try to 

```
emerge nvidia-glx
```

If it relates to making by package keywords, add the package name here too.

Uninstall the .bin file you found on the nVidia site. Gentoo patches the Open Source part of the nVidia driver, so you must not have both versins installed.

----------

## m4tu-

still the same error even when i tried with the "1.0.8178" version :/

----------

## NeddySeagoon

m4tu-,

8178 is old too, newest is 8756 (approx) but it should build for you.

Is the kernel source tree pointed to by the /usr/src/linux symbolic link configured?

The nVidia module builds agaist that kernel (which need not be the one you are running) to do that the kernel needs to have been configured, if not built.

----------

## m4tu-

ok, thx. il try with the 8756 version.

yep, the kernel tree is appointed to /usr/src/linux.

if this doesn't work ill commit suiside  :Very Happy: 

----------

## wolfbite_aus

secret

sometimes better to emerge nvidia-kernel nvidia-glx

sometimes better to run installer from nvidia

and visa versa

recently forgot my own advise (been awhile since any trouble with nvidia drivers)

sure enough currently been bashing my head with emerge (black screens)

suddendly remembered my old advise

used nvidia installer

yayyyyyy screen back from black death

----------

## m4tu-

ok.

now i get the same error message as before.

i tried the 8756 version (i tried to emerge it and run the .run fiel from nvidia, neither of them worked)

help needed!

----------

## NeddySeagoon

m4tu-,

Run the remove option on the .run file from nVidia. You need Gentoos patches to the open source glue code. 

Is your kernel made with module support ?

In make menuconfig, its called Enable loadable module support 

In its submenu you  also need Module versioning support.

The options Module unloading and Automatic kernel module loading are a good idea but not essential.

While you are poking about in the kernel, be sure that if you use a framebuffer console, you choose (in order of preferemce) vesa-tng or vesa.

Others conflict with the nvidia driver for xorg.

----------

## dark-wulf

I get the same error when i try to install the 2.6.16 kernel   :Mad:  with lates Nvidia driver or lates driver from portage, with 2.6.15 everything works fine.

If any one has an idea i would be very happy  :Smile: 

----------

## m4tu-

neddyseagon,

i have all the kernel modules right, so the problem probably doesn't lye there.

the remove option of the .run fiel?? whuuts this? never heard of such thing, ples tell me more. it would bo most warmly welcome.

----------

## NeddySeagoon

m4tu-,

I have not used it for a long time, since before 1.0.6629 was new.

If you execute the nvidia .run file with -h or --help it tells you lots of options.

The remove option was listed there.

----------

## m4tu-

thx, for all the help, managed to solve the problem.

oh, btw. the command was NVIDA - <yda yda yda>.run --unisntall

after that emerge nvidia-glx. it didn't work but it suggested to do the following:

```
cd /usr/src/linux

make oldconfig

make modules_prepare
```

atfer that it emerged nvidia-glx cleanly.

----------

## dark-wulf

for me it did't work  :Sad:  The only thing works is kernel 2.6.15 and nvidia driver 1.0.6629

```

>>> Unpacking source...

>>> Unpacking NVIDIA-Linux-x86-1.0-8756-pkg1.run to /var/tmp/portage/nvidia-glx-1.0.8756/work

unpack NVIDIA-Linux-x86-1.0-8756-pkg1.run: file format not recognized. Ignoring.

>>> Unpacking NVIDIA-FreeBSD-x86-1.0-8756.tar.gz to /var/tmp/portage/nvidia-glx-1.0.8756/work

/usr/portage/media-video/nvidia-glx/nvidia-glx-1.0.8756.ebuild: line 70: cd: /var/tmp/portage/nvidia-glx-1.0.8756/work/NVIDIA-Linux-x86-1.0-8756-pkg1: No such file or directory

/usr/portage/media-video/nvidia-glx/nvidia-glx-1.0.8756.ebuild: line 71: cd: /var/tmp/portage/nvidia-glx-1.0.8756/work/NVIDIA-Linux-x86-1.0-8756-pkg1/doc: No such file or directory

 * Applying NVIDIA_glx-1.0.6629-defines.patch ...

 * Failed Patch: NVIDIA_glx-1.0.6629-defines.patch !

 *  ( /usr/portage/media-video/nvidia-glx/files/1.0.6629/NVIDIA_glx-1.0.6629-defines.patch )

 *

 * Include in your bugreport the contents of:

 *

 *   /var/tmp/portage/nvidia-glx-1.0.8756/temp/NVIDIA_glx-1.0.6629-defines.patch-9591.out

!!! ERROR: media-video/nvidia-glx-1.0.8756 failed.

!!! Function epatch, Line 339, Exitcode 0

!!! Failed Patch: NVIDIA_glx-1.0.6629-defines.patch!

!!! If you need support, post the topmost build error, NOT this status message.

```

----------

## Tortue

 *NeddySeagoon wrote:*   

> 
> 
> You are trying to build the NVIDIA-Linux-x86-1.0-6629 driver, which is too old for your card.
> 
> You need to unmask the testing nVidia drivers by adding
> ...

 

Thanks NeddySeagoon, it worked for me! (kernel 2.6.16-r3)

J-M

----------

## TheWhiteKnight

Well I just installed my NVidia fx5200 card, emerged the nvidia module.  I do not have anything but a fresh install of Gentoo on my system (no GUI on my system as of right now).  When I went to modprobe nvidia:

FATAL:  error inserting nvidia (/lib/modules/2.6.16-gentoo-r9/videao/nvidia.ko): Unknown symbol in module, or unknown parameter (see dmesg)

So I decided to run dmesg nvidia and got the following as well...

nvidia: module license 'NVIDIA' taints kernel.

nvidia: Unknown symbol remap_page_range

nvidia: Unknown symbol pci_find_class

input: PC Speaker as /class/input/input2

0000:00:0a:0: tulip_stop_rxtx() failed

eth0: Setting full duplex based on MII!I link parameter capability of 45e1

nvidia: Unknown symbol remap_page_range

nvidia: Unknown symbol pci_find_class

nvidia: Unknown symbol remap_page_range

nvidia: Unknown symbol pci_find_class

nvidia: Unknown symbol remap_page_range

nvidia: Unknown symbol pci_find_class

What in the world happened?

My kernel is 2.6.16.  If there is anything else you need to be able to help, I will try to provide.  Thank you.

P.S. also now that I did this I am getting a TON of recalculating dependancy messages on boot and reboot.  What did I not do correctly?

----------

## NeddySeagoon

TheWhiteKnight,

Have you done the unmasking further up the thread ?

Run 

```
emerge nvidia-kernel -s
```

and check your nvidia version.

Stable is version 1.0.6629 which is no use to you.

----------

## TheWhiteKnight

Neddy, 

where do I get the updated nvidia drivers from?  They didn't come on the cd that came with card.

----------

## NeddySeagoon

TheWhiteKnight,

You don't use the drivers that came with the card, I didn't know nVidia put linux drivers on their CDs. ... and you must uninstall them if they are installed, before you emerge the new ones.

Portage will get the new drivers from the web and install them for you.

See my post to m4tu- dated Thu May 04, 2006 4:40 pm (UTC) further up this thread.

----------

## TheWhiteKnight

:: makes the duh face ::  my version is 1.0.8762  It's been a LONG last 12 hours.  Ok, I followed your thread here and I modprobe nvidia but it tried loading agpgart.ko and tells me invalid module format.  I might have to restart from the beginning.

----------

## NeddySeagoon

TheWhiteKnight,

Thet invalid module format suggests that you have changed a major configuration item in the kernel, that affects all modules, since you compiled the kernel, or you have has a gcc update.

The fix for either is to recompile and reinstall the kernel and all its modules (including emerge nvidia-kernel)

```
cd /usr/src/linux

make clean 
```

before you start, to get rid of all the old compiled files in the kernel tree.

You don't start Gentoo from scratch.

----------

## TheWhiteKnight

Hey, you might laugh, but since I re-installed my Gentoo, I have had zero problems.  I have the new version of nvidia-kernel installed and it seems to load just fine.  I do not have any GUI interfaces as of right now so I am emerging fluxbox and kdm here.  Thank you for all your help.  I really appreciate it!  Now on to my stupid sound driver...

----------

