# nvidia-drivers fails on latest kernel

## 0x001A4

I just updated my kernel today - 2.6.23_rc1

Once that was done, I re-emerged nvidia-drivers and it failed with this error:

```

/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.c: In function 'nvidia_init_module':

/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.c:1326: error: too many arguments to function 'kmem_cache_create'

/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.c:1435: error: too many arguments to function 'kmem_cache_create'

/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.c:1569: error: void value not ignored as it ought to be

/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.c: In function 'nvidia_exit_module':

/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.c:1601: error: void value not ignored as it ought to be

make[4]: *** [/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.o] Error 1

make[3]: *** [_module_/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/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

 *

 * ERROR: x11-drivers/nvidia-drivers-100.14.11 failed.

 * Call stack:

 *   ebuild.sh, line 1648:   Called dyn_compile

 *   ebuild.sh, line 988:   Called qa_call 'src_compile'

 *   ebuild.sh, line 44:   Called src_compile

 *   nvidia-drivers-100.14.11.ebuild, line 212:   Called linux-mod_src_compile

 *   linux-mod.eclass, line 516:   Called die

 *

 * Unable to make  IGNORE_CC_MISMATCH=yes V=1 SYSSRC=/usr/src/linux SYSOUT=/lib/modules/2.6.23-rc1/build clean module.

 * If you need support, post the topmost build error, and the call stack if relevant.

 * A complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/temp/build.log'.

 *

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------

LOG FILE = "/var/log/sandbox/sandbox-x11-drivers_-_nvidia-drivers-100.14.11-6849.log"

open_wr:   /usr/src/linux-2.6.23-rc1/null.gcda

open_wr:   /usr/src/linux-2.6.23-rc1/null.gcda

open_wr:   /usr/src/linux-2.6.23-rc1/null.gcda

open_wr:   /usr/src/linux-2.6.23-rc1/null.gcda

open_wr:   /usr/src/linux-2.6.23-rc1/null.gcda

--------------------------------------------------------------------------------
```

Any ideas?

----------

## Autie

Same here on amd64

----------

## 0x001A4

Sorry I didnt specify that. I am amd64 as well.

----------

## romu88

I have the same problem.

This seems to be due to a change of the function kmem_cache_create, whose definition

changes ...

(http://kernel.org/pub/linux/kernel/v2.6/testing/ChangeLog-2.6.23-rc1 :

commit 20c2df83d25c6a95affe6157a4c9cac4cf5ffaac

Author: Paul Mundt <lethal@linux-sh.org>

Date:   Fri Jul 20 10:11:58 2007 +0900

    mm: Remove slab destructors from kmem_cache_create().

    Slab destructors were no longer supported after Christoph's

    c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been

    BUGs for both slab and slub, and slob never supported them

    either.

    This rips out support for the dtor pointer from kmem_cache_create()

    completely and fixes up every single callsite in the kernel (there were

    about 224, not including the slab allocator definitions themselves,

    or the documentation references).

    Signed-off-by: Paul Mundt <lethal@linux-sh.org>)

Looks like nvidia hasn't changed its driver to comply to this yet  :Smile: 

----------

## dch24

 *romu88 wrote:*   

> This seems to be due to a change of the function kmem_cache_create

 That's half the problem. Note that 0x001A4's problem is with sandbox. You can disable sandbox (a bad idea) by using this command line:

```
FEATURES="-sandbox" emerge nvidia-drivers
```

But for a real solution to that problem, watch bug #135745: gcc tries to write gcda files in wrong dir (read-only by sandbox)

I agree with you, romu88. Hopefully nvidia will release a new driver that can handle the change in kmem_cache_create. This thread explains why disabling sandbox is bad, and it looks like the sandbox problem has been around since at least 2.6.19, although I ran into it when I tried to compile the 2.6.23-rc1 kernel.

----------

## 0x001A4

Well I knew about the sandbox issue. But even with the sandbox disabled it still fails to compile. I guess I'll just be using the kernel prior to 2.6.23 until nvidia releases a fixed version.

----------

## Naib

your not using ccache are you?

----------

## Autie

thats without ccache and sandbox:

```
/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.c:1569: error: void value not ignored as it ought to be

/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.c: In function 'nvidia_exit_module':

/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.c:1601: error: void value not ignored as it ought to be

make[3]: *** [/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.o] Error 1

make[2]: *** [_module_/var/tmp/portage/x11-drivers/nvidia-drivers-100.14.11/work/NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv] Error 2

NVIDIA: left KBUILD.

nvidia.ko failed to build!

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

make: *** [module] Error 2

 * 

 * ERROR: x11-drivers/nvidia-drivers-100.14.11 failed.

 * Call stack:

 *   ebuild.sh, line 1648:   Called dyn_compile

 *   ebuild.sh, line 988:   Called qa_call 'src_compile'

 *   ebuild.sh, line 44:   Called src_compile

 *   nvidia-drivers-100.14.11.ebuild, line 212:   Called linux-mod_src_compile

 *   linux-mod.eclass, line 516:   Called die

 * 

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

```

----------

## dch24

This topic points to this bug. What you want to do is download this patch for the nVidia linux driver. You'll have to modify your ebuild with this patch so it will apply the previous patch. Here are the commands I used to do both so that I can emerge nvidia-drivers (remember that you have to add FEATURES="-sandbox" as shown below)

Tested on vanilla linux-2.6.23-rc1, 2.6.23-rc2, and 2.6.23-rc3:

```
cd /usr/portage/x11-drivers/nvidia-drivers/files

wget http://bugs.gentoo.org/attachment.cgi?id=126674 -O NVIDIA_kernel-2.6.23.patch

cd ..

wget http://bugs.gentoo.org/attachment.cgi?id=126233 -O nvidia-drivers_ebuild_100.14.11_to_100.14.11-r1.patch

patch -p5 -i nvidia-drivers_ebuild_100.14.11_to_100.14.11-r1.patch

ebuild nvidia-drivers-100.14.11.ebuild digest

ebuild nvidia-drivers-100.14.11.ebuild manifest

emerge -p nvidia-drivers
```

The last command checks that the ebuild is ready to build:

```
# emerge -p nvidia-drivers

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] x11-drivers/nvidia-drivers-100.14.11
```

If you aren't building a version later than 100.14.11, nVidia has already fixed the problem and you shouldn't apply the patch in the first place. If you've done it right, you'll be able to build nvidia-drivers-100.14.11 like this:

```
# FEATURES="-sandbox" emerge nvidia-drivers

Calculating dependencies... done!

>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) x11-drivers/nvidia-drivers-100.14.11 to /

 * NVIDIA-Linux-x86_64-100.14.11-pkg2.run MD5 ;-) ...                     [ ok ]

 * NVIDIA-Linux-x86_64-100.14.11-pkg2.run RMD160 ;-) ...                  [ ok ]

 * NVIDIA-Linux-x86_64-100.14.11-pkg2.run SHA1 ;-) ...                    [ ok ]

 * NVIDIA-Linux-x86_64-100.14.11-pkg2.run SHA256 ;-) ...                  [ ok ]

 * NVIDIA-Linux-x86_64-100.14.11-pkg2.run size ;-) ...                    [ ok ]

 * checking ebuild checksums ;-) ...                                      [ ok ]

 * checking auxfile checksums ;-) ...                                     [ ok ]

 * checking miscfile checksums ;-) ...                                    [ ok ]

 * checking NVIDIA-Linux-x86_64-100.14.11-pkg2.run ;-) ...                [ ok ]

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.23-rc1

 * Checking for MTRR support ...                                          [ ok ]

>>> Unpacking source...

Creating directory NVIDIA-Linux-x86_64-100.14.11-pkg2

Verifying archive integrity... OK

Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 100.14.11.....................................................................................................................................

 * Applying NVIDIA_glx-defines.patch ...                                  [ ok ]

 * Applying NVIDIA_glx-glheader.patch ...                                 [ ok ]

 * Applying NVIDIA_i2c-hwmon.patch ...                                    [ ok ]

 * Applying NVIDIA_kernel-2.6.23.patch ...                                [ ok ]

 * Converting Makefile.kbuild to use M= instead of SUBDIRS= ...           [ ok ]

>>> Source unpacked.
```

That new line is what the patch added: * Applying NVIDIA_kernel-2.6.23.patch

Remember that putting files in /usr/portage means they will be deleted the next time you emerge --sync, but hopefully by then nVidia will have updated their driver.

----------

## Autie

Thanks man,

Works great

----------

## 0x001A4

Awesome. I havent been able to mess around with this stuff for a while and I just checked if this thread had been updated.

That worked perfectly. Thanks man. But yeah, hopefully Nvidia updates their drivers soon :s

----------

