# nvidia troubles

## blommethomas

Hi,

it had been a while since I lastly updated my kernel so I made a new kernel.  After that I had to reconfigure nvidia as always.  But nvidia failed to work, I noticed that my card: TNT2 was not supported.

P.S.: I'm using the old kernel again now

I tried to maks all packages that don't work on that card but after having installed nvidia and running modprobe, I get:

 *Quote:*   

> 
> 
> FATAL: Error inserting nvidia (lib/modules/2.6.14-gentoo-r5/video/nvidia.ko): Invalid module format
> 
> 

 

and when looking at dmesg:

 *Quote:*   

> 
> 
> nvidia: version magic '2.6.14-gentoo-r5 SMP preempt K7 4STACKS gcc-3.3' should be '2.6.14-gentoo-r5 SMP preempt K7 gcc-3.3'
> 
> 

 

----------

## erik258

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

Check it out, I am afraid your card appears to be no longer supported ; (

----------

## blommethomas

that's what I'm saying, it's not indeed.

But downgrading does not work

----------

## Aries-Belgium

Try to remove all the modules from you system:

```
rm -Rf /lib/modules/*
```

Then build your kernel:

```
cd /usr/src/linux

make clean && make modules && make modules_install && make install
```

Then try to reemerge the nvidia-kernel

----------

## blommethomas

wouldn't that install the upgraded kernel instead of the old one?

----------

## Aries-Belgium

 *blommethomas wrote:*   

> wouldn't that install the upgraded kernel instead of the old one?

 

It will use the kernel that is symlinked to /usr/src/linux

----------

## blommethomas

[/code]OK,

here is what exactly happened chronologically.

I wanted to install vmware-player but when I run vmplayer I got the following error:

```

# vmplayer 

vmware is installed, but it has not been (correctly) configured 

for this system. To (re-)configure it, invoke the following command: 

/opt/vmware/player/bin/vmware-config.pl.

```

and when I run that config file:

```

/opt/vmware/player/bin/vmware-config.pl 

Making sure services for VMware Player are stopped. 

/etc/vmware/init.d/vmware: line 726: [: -: integer expression expected 

 * ERROR:  "vmware" has not yet been started. 

Configuring fallback GTK+ 2.4 libraries. 

Trying to find a suitable vmmon module for your running kernel. 

None of the pre-built vmmon modules for VMware Player is suitable for your 

running kernel.  Do you want this program to try to build the vmmon module for 

your system (you need to have a C compiler installed on your system)? [yes] y 

Using compiler "/usr/bin/gcc". Use environment variable CC to override. 

What is the location of the directory of C header files that match your running 

kernel? [/lib/modules/2.6.14-gentoo-r5/build/include] 

Extracting the sources of the vmmon module. 

Building the vmmon module. 

Building for VMware Player 1.0.x or VMware Workstation 5.5.x. 

Using 2.6.x kernel build system. 

make: Entering directory `/tmp/vmware-config2/vmmon-only' 

make -C /lib/modules/2.6.14-gentoo-r5/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules 

make[1]: Entering directory `/usr/src/linux-2.6.14-gentoo-r5' 

  CC [M]  /tmp/vmware-config2/vmmon-only/linux/driver.o 

  CC [M]  /tmp/vmware-config2/vmmon-only/linux/hostif.o 

  CC [M]  /tmp/vmware-config2/vmmon-only/common/cpuid.o 

  CC [M]  /tmp/vmware-config2/vmmon-only/common/hash.o 

  CC [M]  /tmp/vmware-config2/vmmon-only/common/memtrack.o 

  CC [M]  /tmp/vmware-config2/vmmon-only/common/phystrack.o 

  CC [M]  /tmp/vmware-config2/vmmon-only/common/task.o 

cc1plus: warning: "-ffreestanding" is valid for C/ObjC but not for C++ 

In file included from include/linux/bitops.h:77, 

                 from include/linux/kernel.h:15, 

                 from /tmp/vmware-config2/vmmon-only/common/task.c:27: 

include/asm/bitops.h: In function `int find_first_bit(const long unsigned int*, 

   unsigned int)': 

include/asm/bitops.h:339: warning: comparison between signed and unsigned 

   integer expressions 

  CC [M]  /tmp/vmware-config2/vmmon-only/common/vmx86.o 

  CC [M]  /tmp/vmware-config2/vmmon-only/vmcore/compat.o 

  CC [M]  /tmp/vmware-config2/vmmon-only/vmcore/moduleloop.o 

  LD [M]  /tmp/vmware-config2/vmmon-only/vmmon.o 

  Building modules, stage 2. 

  MODPOST 

  CC      /tmp/vmware-config2/vmmon-only/vmmon.mod.o 

  LD [M]  /tmp/vmware-config2/vmmon-only/vmmon.ko 

make[1]: Leaving directory `/usr/src/linux-2.6.14-gentoo-r5' 

cp -f vmmon.ko ./../vmmon.o 

make: Leaving directory `/tmp/vmware-config2/vmmon-only' 

Unable to make a vmmon module that can be loaded in the running kernel: 

insmod: error inserting '/tmp/vmware-config2/vmmon.o': -1 File exists 

There is probably a slight difference in the kernel configuration between the 

set of C header files you specified and your running kernel.  You may want to 

rebuild a kernel based on that directory, or specify another directory. 

For more information on how to troubleshoot module-related problems, please 

visit our Web site at "http://www.vmware.com/download/modules/modules.html" and 

"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html". 

Execution aborted. 

```

I updated my kernel from 2.6.14 to 2.6.16 and I got help saying that I should do:

```

rm -rf /tmp/*vmware*

rmmod --force vmmon

rmmod --force vmnet

```

I don't know which one of them did it, but it worked.

But in my new kernel I got the error my nvidia module was not loaded, I remembered that you had to recompile this for each new kernel and wen't to 

[url] 

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

[/url]

Unfortunately, I did not see my card was no longer supported

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

Now, I get the following errors on 2.6.14:

```

# modprobe nvidia

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

# dmesg

...

nvidia: version magic '2.6.14-gentoo-r5 SMP preempt K7 4STACKS gcc-3.3' should be '2.6.14-gentoo-r5 SMP preempt K7 gcc-3.3' 

```

On 2.6.16 I get no errors when modprobing but when starting up X:

```

# startx

...

Using vt 7

Error: API mismatch: the NVIDIA kernel module is version 7.1.0, but this X module is version 1.0.7174.  Please be sure that your kernel module and all NVIDIA drivers have the same driver version.

(EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module

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

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

Fatal server error:

no screens found

...

XIO: fatal IO error 104 (Connection reset by peer) on X server ":0.0" after 0 requests (O known processed) with 0 event remaining.

```

In my /etc/portage/package.keywords, I have:

```

...

=sys-app/gentoo-sources-2.6.14-r5 ~x86

```

This is in there because I tried to re-install the nvidia kernel module with my old kernel(2.6.14) and not with the at that moment emerged 2.6.16 sources.

IN my /etc/portage/portage.mask, I have:

```

>media-video/nvidia-kernel-1.0.6629-r5

>media-video/nvidia-glx-1.0.6629-r7

```

see

[url] 

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

[/url]

for details

In /usr/src:

```

# ls -l

lrwxrwxrwx 1 root root 22 Jun 29 17:54 linux -> linux-2.6.14-gentoo-r5

...

```

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

Most likely I would like to have a solution for the second kernel, I think that's the easiest thing too.  But if you find the solution for the other kernel I'll be happy too.

----------

## Freekazonid

after working for one session, i have the same error as you. but my card is still supported

----------

## blommethomas

I unmerged both nvidia-glx and nvidia-kernel now.

When I try to re-emerge them, I get:

```

# emerge --pretend nvidia-glx

...

!!!! All ebuilds that could satisfy "~media-video/nvidia-kernel-1.0.7174" have been masked

!!!! One of the following masked packages is required to complete your request:

- media-video/nvidia-kernel-1.0.7174-r2 (maked by: ~x86 keyword)

For more information, see MASKED PACKAGES section in the emerge man page refer to the Gentoo Handbook.

(dependecy required by "media-video/nvidia-glx-1.0.7174-r5" [ebuild])

```

Maybe someone could help me to get X running without nvidia support so I have at least that

----------

## Aries-Belgium

Did you masked higher an lower versions of nvidia-kernel?

I believe you have to have the same version of nvidia-kernel and nvidia-glx.

----------

## blommethomas

yes, apparently I missed some lines in package.keywords

----------

## blommethomas

I managed to get nvidia working on my 2.6.16 kernel by re-emerging it, I get the startup screen with nvidia now but if freezes!!!

Is it possible that the newer kernel will never work with my nvidia card?

----------

## blommethomas

same errors keep on returning while I'm trying to get this back working on my old kernel

----------

## blommethomas

A while ago, I upgraded my kernel to 2.6.16-r9.  Therefore I needed to update my nvidia-kernel too.

My card is only supported till version 6629 of the nvidia drivers(Riva TNT2 Model 64/Model 64 Pro) as you can see at:

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

so I managed the follwoing command

# echo ">media-video/nvidia-kernel-1.0.6629-r5" >> /etc/portage/package.mask

# echo ">media-video/nvidia-glx-1.0.6629-r7" >> /etc/portage/package.mask

This caused an error, nvidia failed to load.

I cleaned /lib/modules and re-installed my kernel:

# rm -R /lib/modules/*

# cd /usr/src/linux

# make menuconfig

# make && make modules_install

# cp arch/i386/boot/bzImage /boot/kernel-2.6.16-gentoo-r9

# cp System.map /boot/System.map-2.6.16-gentoo-r9

# cp .config /boot/config-2.6.16-gentoo-r9

and tried to re-emerge nvidia-kernel:

# emerge nvidia-kernel

during emerge, I noticed a few errors:

...

WARNING: //lib/modules/2.6.16-gentoo-r9/nvidia.ko needs unknown symbol remap_page_range

WARNING: //lib/modules/2.6.16-gentoo-r9/nvidia.ko needs unknown symbol pci_find_class

...

I modprobed nvidia and did modules-update and looked at the output of dmesg

#modprobe nvidia

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

# dmesg

...

[17180633.744000] nvidia: Unknown symbol remap_page_range

[17180633.744000] nvidia: Unknown symbol pci_find_class

# modules-update

(no errors)

next thing I did, was looking in my Xorg.0.Log:

...

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

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

(II) UnloadModule: "nvidia"

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

Fatal server error:

no screens found

I searched for the remap_page_range and pci_find_class errors on the gentoo forums and found the following:

gentoo forums 1(https://forums.gentoo.org/viewtopic-t-476921-highlight-remappagerange.html)

gentoo forums 2(https://forums.gentoo.org/viewtopic-t-465358-highlight-.html)

gentoo forums 2(https://forums.gentoo.org/viewtopic-t-470060-highlight-.html)

nvnews forum(http://www.nvnews.net/vbulletin/showthread.php?s=bff16370a1c3dad8a2be6f2e4de3fa86&t=72488)

nvidia(http://www.nvidia.org)

and I noticed that the following bug is causing this:

bugreport(https://bugs.gentoo.org/show_bug.cgi?id=137000)

It looks like there is a problem in the ebuild of the nvidia drivers for the newer kernels, this should be solved by manually installing the nvidia driver:

sh /usr/portage/distfiles/NVIDIA-Linux-x86-1.0-8762-pkg1.run

I'm using an older version so I did:

sh /usr/portage/distfiles/NVIDIA-Linux-x86-1.0-6629-pkg1.run

Unfortunately this produced errors too:

# nano /var/log/nvidia-installer.log

...

   nvidia.ko failed to build!

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

   make: *** [module] Error 2

-> Error.

ERROR: Unable to build the NVIDIA kernel module.

ERROR: Installation has failed.  Please see the file

       '/var/log/nvidia-installer.log' for details.  You may find suggestions

       on fixing installation problems in the README available on the Linux

       driver download page at www.nvidia.com.

...

I'm stuck now, can anyone help me?

----------

## erik258

 *Quote:*   

> Is it possible that the newer kernel will never work with my nvidia card?

 

to be specific, I think you can't use the nvidia drivers with your card.  But guess what?  You can still use the vesa drivers for any card and your TNT is no exception.  So you have that option.  furthermore you can maybe use the old 'nv' driver.  the 'nvidia-glx' driver is hardware accellerated and all but comeon, it's a tnt2, it should be ok without hardware accelleration too.  

stick with the new kernel.  that problem is a  lot easier to solve I think ... read up about using vesa drivers and getting things going.  now if you still can't do your vmware thing maybe going back to 2.6.13 or whatever is a good idea, but for now i think it's more feasable to use software-accellerated rendering.  sorry ; )

----------

## blommethomas

looks like nvidia noticed the problem, and on 6 july they added nvidia-legacy-drivers which works perfect

----------

