# [SOLVED] nvidia and kernel 2.6.12-gentoo-r10

## majoron

Hi!

I'm having troubles installing nvidia drivers in my sweet vaio with a GForce Go 6200.

I read in another threads that the modules I need for such kernel are masked so I added the following lines in /etc/portage/package.keywords:

```
media-video/nvidia-kernel ~x86

media-video/nvidia-glx ~x86

app-admin/eselect-opengl ~x86

app-admin/eselect ~x86

```

However I still get errors (in fact, I cannot emerge). When I do 

```
emerge nvidia-kernel nvidia-glx
```

I get

```
...

echo \#define NV_COMPILER \"`cc -v 2>&1 | tail -n 1`\" > nv_compiler.h

cc -c -Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wpointer-arith  -Wno-multichar  -Werror -O -fno-common -UDEBUG -U_DEBUG -DNDEBUG -MD -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DNTRM -D_GNU_SOURCE -D_LOOSE_KERNEL_NAMES -D__KERNEL__ -DMODULE  -DNV_MAJOR_VERSION=1 -DNV_MINOR_VERSION=0 -DNV_PATCHLEVEL=7676  -DNV_CHANGE_PAGE_ATTR_PRESENT -DNV_PCI_DISABLE_DEVICE_PRESENT -DNV_VMAP_4_PRESENT  -I. -I/usr/src/linux/include -Wsign-compare -Wno-cast-qual -Wno-error nv.c

In file included from /usr/src/linux/include/linux/list.h:7,

                 from /usr/src/linux/include/linux/wait.h:23,

                 from /usr/src/linux/include/asm/semaphore.h:41,

                 from /usr/src/linux/include/linux/sched.h:20,

                 from /usr/src/linux/include/linux/module.h:10,

                 from nv-linux.h:49,

                 from nv.c:14:

/usr/src/linux/include/linux/prefetch.h: In function `prefetch_range':

/usr/src/linux/include/linux/prefetch.h:62: warning: pointer of type `void *' used in arithmetic

In file included from /usr/src/linux/include/asm/smp.h:18,

                 from /usr/src/linux/include/linux/smp.h:19,

                 from /usr/src/linux/include/linux/sched.h:26,

                 from /usr/src/linux/include/linux/module.h:10,

                 from nv-linux.h:49,

                 from nv.c:14:

/usr/src/linux/include/asm/mpspec.h:6:25: mach_mpspec.h: No such file or directory

In file included from /usr/src/linux/include/asm/smp.h:18,

                 from /usr/src/linux/include/linux/smp.h:19,

                 from /usr/src/linux/include/linux/sched.h:26,

                 from /usr/src/linux/include/linux/module.h:10,

                 from nv-linux.h:49,

                 from nv.c:14:

/usr/src/linux/include/asm/mpspec.h: At top level:

/usr/src/linux/include/asm/mpspec.h:8: error: `MAX_MP_BUSSES' undeclared here (not in a function)

/usr/src/linux/include/asm/mpspec.h:9: error: `MAX_MP_BUSSES' undeclared here (not in a function)

/usr/src/linux/include/asm/mpspec.h:10: error: `MAX_MP_BUSSES' undeclared here (not in a function)

/usr/src/linux/include/asm/mpspec.h:12: error: `MAX_MP_BUSSES' undeclared here (not in a function)

/usr/src/linux/include/asm/mpspec.h:20: error: `MAX_MP_BUSSES' undeclared here (not in a function)

/usr/src/linux/include/asm/mpspec.h:20: error: conflicting types for `mp_bus_id_to_type'

/usr/src/linux/include/asm/mpspec.h:8: error: previous declaration of `mp_bus_id_to_type'

/usr/src/linux/include/asm/mpspec.h:22: error: `MAX_IRQ_SOURCES' undeclared here (not in a function)

/usr/src/linux/include/asm/mpspec.h:24: error: `MAX_MP_BUSSES' undeclared here (not in a function)

/usr/src/linux/include/asm/mpspec.h:24: error: conflicting types for `mp_bus_id_to_pci_bus'

/usr/src/linux/include/asm/mpspec.h:12: error: previous declaration of `mp_bus_id_to_pci_bus'

In file included from /usr/src/linux/include/asm/smp.h:20,

                 from /usr/src/linux/include/linux/smp.h:19,

                 from /usr/src/linux/include/linux/sched.h:26,

                 from /usr/src/linux/include/linux/module.h:10,

                 from nv-linux.h:49,

                 from nv.c:14:

/usr/src/linux/include/asm/io_apic.h:158: error: `MAX_IRQ_SOURCES' undeclared here (not in a function)

/usr/src/linux/include/asm/io_apic.h:158: error: conflicting types for `mp_irqs'

/usr/src/linux/include/asm/mpspec.h:22: error: previous declaration of `mp_irqs'

In file included from /usr/src/linux/include/linux/smp.h:19,

                 from /usr/src/linux/include/linux/sched.h:26,

                 from /usr/src/linux/include/linux/module.h:10,

                 from nv-linux.h:49,

                 from nv.c:14:

/usr/src/linux/include/asm/smp.h:71:26: mach_apicdef.h: No such file or directory

In file included from /usr/src/linux/include/linux/smp.h:19,

                 from /usr/src/linux/include/linux/sched.h:26,

                 from /usr/src/linux/include/linux/module.h:10,

                 from nv-linux.h:49,

                 from nv.c:14:

/usr/src/linux/include/asm/smp.h: In function `hard_smp_processor_id':

/usr/src/linux/include/asm/smp.h:75: warning: implicit declaration of function `GET_APIC_ID'

In file included from /usr/src/linux/include/linux/dmapool.h:14,

                 from /usr/src/linux/include/linux/pci.h:864,

                 from nv-linux.h:72,

                 from nv.c:14:

/usr/src/linux/include/asm/io.h: In function `check_signature':

/usr/src/linux/include/asm/io.h:253: warning: wrong type argument to increment

In file included from /usr/src/linux/include/linux/irq.h:21,

                 from /usr/src/linux/include/asm/hardirq.h:6,

                 from /usr/src/linux/include/linux/hardirq.h:6,

                 from /usr/src/linux/include/linux/interrupt.h:11,

                 from nv-linux.h:73,

                 from nv.c:14:

/usr/src/linux/include/asm/irq.h:16:25: irq_vectors.h: No such file or directory

In file included from /usr/src/linux/include/asm/hardirq.h:6,

                 from /usr/src/linux/include/linux/hardirq.h:6,

                 from /usr/src/linux/include/linux/interrupt.h:11,

                 from nv-linux.h:73,

                 from nv.c:14:

/usr/src/linux/include/linux/irq.h: At top level:

/usr/src/linux/include/linux/irq.h:72: error: `NR_IRQS' undeclared here (not in a function)

In file included from /usr/src/linux/include/linux/irq.h:74,

                 from /usr/src/linux/include/asm/hardirq.h:6,

                 from /usr/src/linux/include/linux/hardirq.h:6,

                 from /usr/src/linux/include/linux/interrupt.h:11,

                 from nv-linux.h:73,

                 from nv.c:14:

/usr/src/linux/include/asm/hw_irq.h:28: error: `NR_IRQ_VECTORS' undeclared here (not in a function)

/usr/src/linux/include/asm/hw_irq.h:32: error: `NR_IRQS' undeclared here (not in a function)

In file included from /usr/src/linux/include/asm/hardirq.h:6,

                 from /usr/src/linux/include/linux/hardirq.h:6,

                 from /usr/src/linux/include/linux/interrupt.h:11,

                 from nv-linux.h:73,

                 from nv.c:14:

/usr/src/linux/include/linux/irq.h:79: error: `NR_IRQS' undeclared here (not in a function)

In file included from nv.c:14:

nv-linux.h:649:2: warning: #warning "conftest.sh failed, assuming remap_page_range(4)!"

nv.c: In function `nvos_get_agp_device_by_class':

nv.c:467: warning: implicit declaration of function `pci_find_class'

nv.c:467: warning: assignment makes pointer from integer without a cast

nv.c:481: warning: assignment makes pointer from integer without a cast

nv.c: In function `nvidia_init_module':

nv.c:1073: warning: `pm_register' is deprecated (declared at /usr/src/linux/include/linux/pm.h:106)

nv.c:1170: warning: `pm_unregister' is deprecated (declared at /usr/src/linux/include/linux/pm.h:111)

nv.c: In function `nvidia_exit_module':

nv.c:1227: warning: `pm_unregister' is deprecated (declared at /usr/src/linux/include/linux/pm.h:111)

nv.c: In function `nv_kern_mmap':

nv.c:1711: warning: implicit declaration of function `remap_page_range'

nv.c: In function `nv_agp_init':

nv.c:3311: error: too few arguments to function `agp_backend_acquire'

nv.c:3311: warning: assignment makes integer from pointer without a cast

nv.c:3313: error: too few arguments to function `agp_backend_release'

nv.c: In function `nvos_count_devices':

nv.c:3451: warning: assignment makes pointer from integer without a cast

nv.c:3457: warning: assignment makes pointer from integer without a cast

make[1]: *** [nv.o] Error 1

make[1]: *** Waiting for unfinished jobs....

make: *** [module] Error 2

!!! ERROR: media-video/nvidia-kernel-1.0.7676 failed.

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

!!! Unable to make                                  IGNORE_CC_MISMATCH=yes V=1 SYSSRC=/usr/src/linux SYSOUT=/usr/src/linux clean module.

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

```

Any help will be appreciated.

TIA

Regards

PS sorry for so long postLast edited by majoron on Thu Oct 13, 2005 9:25 am; edited 1 time in total

----------

## Crisis

Try 7174 and see if that one works.

----------

## majoron

Hi again; thanks for the reply.

I tried, but no luck!

The error is not exactly the same, but almost.

If necessary I post the error.

----------

## Crisis

any chance the kernel you are running is different then the source that /usr/src/linux currently points to?

----------

## majoron

Don't think so. I only have one kernel.

Maybe it's a problem with the kernel, but I followed the canonical instructions in configuring the kernel (MTRR, no fb_nvidia, etc).

 :Question: 

----------

## Crisis

Just to make sure can you post the output of this:

```
uname -a; ls -lah /usr/src/linux
```

----------

## majoron

Here comes:

```
Linux primo 2.6.12-gentoo-r10 #9 SMP Wed Oct 12 14:20:42 CEST 2005 i686 Intel(R) Pentium(R) M processor 1.73GHz GenuineIntel GNU/Linux

lrwxrwxrwx  1 root root 23 Sep 15 19:49 /usr/src/linux -> linux-2.6.12-gentoo-r10
```

----------

## Crisis

Somewhere around here is where the problem is:

```

nv-linux.h:649:2: warning: #warning "conftest.sh failed, assuming remap_page_range(4)!" 
```

It's assuming remap_page_range, however 2.6.12 should be using remap_pfn_range

I'm wondering if perhaps your kernel headers are not up to date?

What does this give you?

```
emerge -p linux-headers
```

----------

## majoron

```
These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] sys-kernel/linux-headers-2.6.11-r2

```

Doesn't look a good answer...

----------

## Crisis

Hmm..  I don't really know where to suggest going from here, other then to maybe try 2.6.13 kernel which seems to be gentoo's "stable" kernel right now

----------

## majoron

Thank you for the help anyway.

At least it's nice to have something to try. I'll try a new kernel.

What is misleading me is that the higher version number for the headers is lower than the kernel itself. Is this how it should be?

I'm new to gentoo and I don't understand why the headers are separated from the kernel itself.

Thank you for the help.

----------

## Crisis

[/code]The headers issue is a bit complicated.  The headers already come with the kernel source.  However seperate headers somemtimes are needed to be compiled against.

Example, if your version of gcc was compiled against certain headers, then those headers should be available to use when compiling other programs.

Are all your other packages 9such as gcc?) up to date?  Does 

```
emerge -upD
```

 give you any interesting output?

----------

## majoron

I cannot believe!!!

I did

```
emerge gentoo-sources
```

then it installed the sources; afterwards it tells that it will remove portage version 2.0.51.22-r3 and it says it will leave 2.0.51.22-r2.

However an error occurs and now I don't have emerge!!!

I will have to solve it before anything...

----------

## majoron

I'm back after this nasty trip.    :Evil or Very Mad: 

When I do "emerge -upD world" it says:

```
localhost bin # emerge -upD world

These are the packages that I would merge, in order:

Calculating world dependencies ...done!

[blocks B     ] dev-libs/9libs (is blocking net-libs/libwww-5.4.0-r3)

[blocks B     ] <mail-client/pine-4.64-r1 (is blocking net-mail/uw-mailutils-2004g)

[ebuild     U ] sys-devel/automake-1.9.6-r1 [1.9.6]

[ebuild     U ] sys-apps/shadow-4.0.7-r4 [4.0.7-r3]

[ebuild     U ] sys-apps/util-linux-2.12r [2.12i-r1]

[ebuild     U ] x11-base/xorg-x11-6.8.2-r4 [6.8.2-r3]

[ebuild     U ] x11-terms/xterm-204 [200-r3]

[ebuild     U ] sys-libs/gdbm-1.8.3-r2 [1.8.3-r1]

[ebuild  NS   ] dev-python/python-docs-2.4.1

[ebuild  NS   ] dev-lang/python-2.4.1-r1

[ebuild     U ] dev-lang/perl-5.8.6-r6 [5.8.6-r5]

[ebuild     U ] sys-libs/glibc-2.3.5-r2 [2.3.5-r1]

[ebuild     U ] dev-libs/libIDL-0.8.6 [0.8.5]

[ebuild     U ] gnome-base/orbit-2.12.3 [2.12.2]

[ebuild     U ] gnome-base/libbonobo-2.10.1 [2.10.0]

[ebuild     U ] x11-libs/qt-3.3.4-r8 [3.3.4-r3]

[ebuild     U ] media-libs/svgalib-1.9.21-r1 [1.9.19-r3]

[ebuild     U ] www-client/links-2.1_pre18 [2.1_pre17-r1]

[ebuild  NS   ] app-text/docbook-xml-dtd-4.4

[ebuild  N    ] dev-db/qt-unixODBC-3.3.4-r1

[ebuild     U ] gnome-base/gnome-vfs-2.10.1-r2 [2.10.1-r1]

[ebuild     U ] gnome-base/libbonoboui-2.10.1 [2.10.0]

[ebuild     U ] x11-themes/gtk-engines-2.6.5 [2.6.4-r2]

[ebuild     U ] sys-apps/texinfo-4.8-r2 [4.8]

[ebuild  N    ] app-i18n/man-pages-es-1.55

[ebuild  N    ] app-i18n/man-pages-de-0.4

[ebuild     U ] app-misc/mime-types-4 [3]

[ebuild  N    ] net-mail/uw-mailutils-2004g

[ebuild     U ] mail-client/pine-4.64-r1 [4.63-r3]

[ebuild     U ] kde-base/kde-env-3-r4 [3-r3]

[ebuild     U ] net-libs/gecko-sdk-1.7.12-r1 [1.7.8]

[ebuild     U ] media-libs/xine-lib-1.0.1-r4 [1.0.1-r3]

[ebuild     U ] sys-apps/eject-2.0.13-r2 [2.0.13-r1]

[ebuild     U ] kde-base/kregexpeditor-3.4.1-r1 [3.4.1]

[ebuild  NS   ] app-text/docbook-sgml-dtd-4.4

[ebuild     U ] sci-libs/gdal-1.2.6-r4 [1.2.6-r3]

[ebuild     U ] media-gfx/xv-3.10a-r12 [3.10a-r11]

[ebuild     U ] app-editors/nvu-0.90-r2 [0.90-r1]

[ebuild     U ] www-client/mozilla-firefox-1.0.7-r2 [1.0.6-r5]

```

Appart from blocked dependences (which I don't know how to solve yet), it seems that glibc is included in the list. Maybe is the root of the problem???

----------

## majoron

Hi again!

It's amazing but I got it. Now nvidia modules are correctly installed.

What happened is that I had mounted the /var partition as "noexec". Althought I did know that portage used this place (/var/tmp/portage) to install things, what I didn't know is that it needed "exec" permissions. Why didn't it break up to yesterday? Because yesterday was when I put /var in a new partition.

How did i find out that?

It turned out that I began to see that when I tried to install one package it always complained saying that /bin/bash was a bad interpreter.

I thought it was a specific problem of this package, but after having troubles with portage (see my previous posts), to test that it worked again, I tried to emerge another thing. Then the same error showed up and when I searched the "bad interpreter" thing (not relating the search with a specific package name), I found the solution.

Best regards.

----------

## Crisis

Glad to hear you got it working.

----------

