# Emerge nvidia-kernel failed, what do i do?

## zecora

```
e/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr/src/nv/os-agp.

ia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr/src/nv/os-agp.c

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

ror: parse error before '*' token

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rning: type defaults to `int' in declaration of `drm_agp_p'

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rning: data definition has no type or storage class

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

nction `KernInitAGP':

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rning: assignment discards qualifiers from pointer target type

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

ror: request for member `acquire' in something not a structure or union

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rning: `inter_module_put' is deprecated (declared at include/linux/module.h:578)

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rror: request for member `copy_info' in something not a structure or union

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rror: request for member `enable' in something not a structure or union

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rror: request for member `release' in something not a structure or union

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

arning: `inter_module_put' is deprecated (declared at include/linux/module.h:578)

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

nction `KernTeardownAGP':

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rror: request for member `release' in something not a structure or union

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

arning: `inter_module_put' is deprecated (declared at include/linux/module.h:578)

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

nction `KernAllocAGPPages':

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rror: request for member `allocate_memory' in something not a structure or union

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rror: request for member `bind_memory' in something not a structure or union

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rror: request for member `unbind_memory' in something not a structure or union

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

rror: request for member `free_memory' in something not a structure or union

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr

nction `KernMapAGPPages':

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/

rror: request for member `unbind_memory' in something not a structure or union

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/

nction `KernFreeAGPPages':

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1

rror: request for member `unbind_memory' in something not a structure or union

/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-

rror: request for member `free_memory' in something not a structure or uni

make[3]: *** [/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux

s-agp.o] Error 1

make[2]: *** [_module_/var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVID

src/nv] 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-r1 failed.

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

!!! Unable to make                                  IGNORE_CC_MISMATCH=yes

UT=/usr/src/linux clean module.

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

```

----------

## Thieving Magpie

I have exactly the same problem.

I tried installing a newer version of nvidia kernel using

```
ACCEPT_KEYWORDS="~x86" emerge nvidia-kernel
```

while that went pretty well I got the next problem when I tried to test-emerge nvidia-glx

```
ACCEPT_KEYWORDS="~x86" emerge -p nvidia-glx will give the following output:

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

Calculating dependencies    ...done!

[blocks B     ] <x11-base/xorg-x11-6.8.0-r4 (is blocking x11-base/opengl-update-2.1.1-r1)

[ebuild     U ] x11-base/opengl-update-2.1.1-r1 [1.8.1]

[ebuild     U ] media-video/nvidia-glx-1.0.7167-r1 [1.0.6629-r1]
```

Now I am unsure how to proceed.

Does that mean I need to install a newer version of xorg-x11 first?

----------

## pilla

moved from IG

----------

## Thieving Magpie

Well, there is a new version of xorg-x11 and I tried to emerge it but it wouldn't let me since the old version was blocking.

So, I unemerged the old-version and then I could emerge the new one.

But sadly, after a while of compiling the system crashed complety. The System hangs with the following screen

```
Unable to handle kernel NULL pointer dereference at virtual address 00000002

printing eip:

c042266a

*pde = 00000000

Ooops: 0002 [#16]

PREEMPT SMP

Modules linked in: nvidia

CPU: 0
```

...and is only rebootable with a hardware reset.

I never experienced something even remotely similar before

One thing I know for sure: Never update a kernel until it's absolutely necessary.

----------

## deternal

I got the same problem after updating to the newest kernel - namely 2.6.11-r4.

Obviously I suppose you guys kept your old kernel so you can still boot with that? :P

Untill this is resolved I'll just 

```
rm /usr/src/linux

cd /usr/src/

ln -s /usr/src/linux-2.6.10-gentoo-r6 linux

```

This of course solved my problem getting the nvidia-kernel working.

I suggest all of you having problems also file 2 bug-reports with nvidia.

One for it not working with the 2.6.11 kernel and one for the kernel not being open source so we don't need to wait around for them to fix it :)

----------

## pste

Could it be that the portage nvidia driver is too old??? Just sync'ed and the nvidia kernel is 1.0-6629-r1 but on nvidia's driver page they have 1.0-7167 with this release highlight (among others...)

- Fixed NvAGP incompatibility with recent Linux 2.6 kernels.

That is, since the error comes as:

[/var/tmp/portage/nvidia-kernel-1.0.6111-r3/work/NVIDIA-Linux-x86-1.0-6111-pkg1/usr/src/nv/os-agp.o] Error 1

make[3]: *** [_module_/var/tmp/portage/nvidia-kernel-1.0.6111-r3/work/NVIDIA-Linux-x86-1.0-6111-pkg1/usr/src/nv] Error 2

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

NVIDIA: left KBUILD.

nvidia.ko failed to build!

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

make: *** [module] Error 2

I figure it has something to do with the agp functionality... Just wait for a new ebuild for nvidia-kernel then...

Or, uninstall the nvidia-kernel ebuild and manually install the nvidia driver...

Happy hunting!

/ste

----------

## cn.mota

I have managed to get the 6629 dirvers emerging and compiling with 2.6.11, by disabling agpgart in the kernel configuration, recompiling the kernel.

After this I was able to emerge nvidia-kernel

One thing you have to add the following option to your xorg.conf

Option      "NvAGP" "1"

```

        Driver      "nvidia"

        Option      "NvAGP" "1"

```

----------

## pste

And I tried my own suggestion, namely to unmerge nvidia-glx and nvidia-kernel and run nvidia's 7167 driver manually...

... works like a charm!

/ste

----------

## Thieving Magpie

Hmm, I got my problem solved, but I am not the starter of this thread.

The problem resulted from two different things:

1. The newly compiled kernel seems to be not working to well with my system (linux-2.6.11-gentoo-r4).

When I tried to compile the latest xorg-x11 it would definitely crash with the error message in my second post.

This also happened when I tried to recompile the kernel itself.

So I switched back to the old kernel (linux-2.6.7-gentoo-r11) and compiled xorg-x11 again. Worked like a charm.  But then I couldn't get the newly emerged nvidia-drivers to work.  I read almost everything I could find on the forums regarding nvidia-drivers but nothing seemed to work for me. I always had the same error again and again.

```
(EE) No devices detected.

Fatal server error:

no screens found 
```

Xorg did not seem to find the nvidia drivers on my system although I knew they were loaded. (lsmod would show nvidia loaded)

2.Then I took a look at my make.conf and realized I still had "static" in my use flags from an earlier installation. I removed that, recompiled xorg-x11 once more, and to my surprise the nvidia-drivers worked like a charm.

Now I'd really like to know what exactly does this "static" flag? I would be very grateful if somebody could please link me to an explanation.

Then I switched to the new kernel again, reemerged the nvidia drivers (nvidia-kernel-1.0.7167-r1, nvidia-glx-1.0.7167-r1) and everything worked just fine even with the new kernel.

----------

## lambroger

 *Thieving Magpie wrote:*   

> I have exactly the same problem.
> 
> I tried installing a newer version of nvidia kernel using
> 
> ```
> ...

 

what you have to do is:

unmerge the opengl and the old xorg

then emerge the new xorg and finally the new opengl

the problem is caused by your opengl already being upto date while your xorg isn't

----------

## Godsmacker777

hey guys,

I recently ran into the same problem, after upgrading to the 2.6.11-r4 kernel. Someone on the irc channels mentioned that there has been a known issue with 2.6.1x kernels and the nvidia kernel. He suggested trying to use the unstable nvidia kernel. He also mentioned that agpart could be involved. I shy away from unstable packages when given a choice, so I dug into the agpart issue.

I disabled agpart in the kernel and the nvidia kernel compiled just fine. I then set xorg to use nvidia's agp driver, as mentioned previously in this thread. All has been well.  :Laughing: 

goodluck

----------

