# Cannot re-emerge nvidia-drivers for new kernel-4.6.0

## sheep204

Greetings!

I just updated a new kernel(gentoo-sources-4.6.0) and complied it.After that I don't foget input command "eselect kerne set“ to create a  new kernel  symlink  and "emerge @module-rebuild"  to re-emerge nvidia-drivers for new kernel.But I get an error when re-emerge.Here are some error logs

```
 * Package:    x11-drivers/nvidia-drivers-364.19

 * Repository: gentoo

 * Maintainer: jer@gentoo.org hardened@gentoo.org

 * USE:        X abi_x86_64 amd64 driver elibc_glibc kernel_linux kms tools userland_GNU

 * FEATURES:   ccache preserve-libs userpriv usersandbox

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found kernel object directory:

 *     /lib/modules/4.6.0-gentoo/build

 * Found sources for kernel version:

 *     4.6.0-gentoo

>>> Unpacking source...

>>> Unpacking NVIDIA-Linux-x86_64-364.19.run to /var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work

>>> Unpacking nvidia-settings-364.19.tar.bz2 to /var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work

>>> Source unpacked in /var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work

>>> Preparing source in /var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work ...

>>> Source prepared.

>>> Configuring source in /var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work ...

>>> Source configured.

>>> Compiling source in /var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work ...

 * Preparing nvidia module

make -j1 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' ARCH=x86_64 IGNORE_CC_MISMATCH=yes V=1 SYSSRC=/usr/src/linux SYSOUT=/lib/modules/4.6.0-gentoo/build CC=x86_64-pc-linux-gnu-gcc NV_VERBOSE=1 clean module

rm -f -r conftest

make "CC=x86_64-pc-linux-gnu-gcc" KBUILD_OUTPUT=/lib/modules/4.6.0-gentoo/build KBUILD_VERBOSE=1 -C /usr/src/linux M=/var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work/kernel ARCH=x86_64 NV_KERNEL_SOURCES=/usr/src/linux NV_KERNEL_OUTPUT=/lib/modules/4.6.0-gentoo/build NV_KERNEL_MODULES="nvidia nvidia-uvm nvidia-modeset nvidia-drm" INSTALL_MOD_DIR=kernel/drivers/video Q= clean

make[1]: Entering directory '/usr/src/linux-4.6.0-gentoo'

make -C /lib/modules/4.6.0-gentoo/build KBUILD_SRC=/usr/src/linux-4.6.0-gentoo \

-f /usr/src/linux-4.6.0-gentoo/Makefile clean

make[2]: Entering directory '/usr/src/linux-4.6.0-gentoo'

make -f /usr/src/linux-4.6.0-gentoo/scripts/Makefile.clean obj=/var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work/kernel

rm -rf /var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work/kernel/.tmp_versions

  rm -f /var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work/kernel/Module.symvers

make[2]: Leaving directory '/usr/src/linux-4.6.0-gentoo'

make[1]: Leaving directory '/usr/src/linux-4.6.0-gentoo'

make "CC=x86_64-pc-linux-gnu-gcc" KBUILD_OUTPUT=/lib/modules/4.6.0-gentoo/build KBUILD_VERBOSE=1 -C /usr/src/linux M=/var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work/kernel ARCH=x86_64 NV_KERNEL_SOURCES=/usr/src/linux NV_KERNEL_OUTPUT=/lib/modules/4.6.0-gentoo/build NV_KERNEL_MODULES="nvidia nvidia-uvm nvidia-modeset nvidia-drm" INSTALL_MOD_DIR=kernel/drivers/video Q= modules

make[1]: Entering directory '/usr/src/linux-4.6.0-gentoo'

make -C /lib/modules/4.6.0-gentoo/build KBUILD_SRC=/usr/src/linux-4.6.0-gentoo \

-f /usr/src/linux-4.6.0-gentoo/Makefile modules

make[2]: Entering directory '/usr/src/linux-4.6.0-gentoo'

test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \

echo >&2;                                                       \

echo >&2 "  [color=red]ERROR: Kernel configuration is invalid.[/color]";           \

echo >&2 "        [color=red] include/generated/autoconf.h or include/config/auto.conf are missing."[/color];\

echo >&2 "         [color=red]Run 'make oldconfig && make prepare' on kernel src to fix it.[/color]";      \

";      \

echo >&2 ;                                                      \

/bin/false)

mkdir -p /var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work/kernel/.tmp_versions ; rm -f /var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work/kernel/.tmp_versions/*

make -f /usr/src/linux-4.6.0-gentoo/scripts/Makefile.build obj=/var/tmp/portage/x11-drivers/nvidia-drivers-364.19/work/kernel

......
```

I have a symlink in /usr/src as follows: linux -> linux-4.6.0

The kernel in linux-4.6.0 has been prepared, compiled and configured.I have attempted to run the suggested commands "make oldconfig && make prepare" and as suspected it has no effect since I've already compiled the kernel and installed it.

----------

## i4dnf

For kernel 4.6.0 you need a patch for nvidia-drivers. There's no official release to support it yet.

You can put the patch from here (devtalk.nvidia.com) in a file named for example 01-kernel4.6.0-compat.patch in /etc/portage/patches/x11-drivers/nvidia-drivers-364.19/

Portage will then pick it up when emerging nvidia-drivers.

P.S. I've reported this as the thread might need to go to Unsupported Software.

----------

## sheep204

 *i4dnf wrote:*   

> For kernel 4.6.0 you need a patch for nvidia-drivers. There's no official release to support it yet.
> 
> You can put the patch from here (devtalk.nvidia.com) in a file named for example 01-kernel4.6.0-compat.patch in /etc/portage/patches/x11-drivers/nvidia-drivers-364.19/
> 
> Portage will then pick it up when emerging nvidia-drivers.
> ...

 

Thanks for answer.

----------

## pilla

Moved from Desktop Environments to Kernel & Hardware.

----------

