Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 610110

Summary: x11-drivers/nvidia-drivers-378.13 fails to compile with kernel 4.10.0: error: ‘CPU_DOWN_FAILED’ undeclared
Product: Gentoo Linux Reporter: Mark Nowiasz <mark+gentoobugs>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal CC: ganthore, johu, maffblaster, tsmksubc
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
Ebuild patch
Kernel patch for nvidia drivers to work with kernel 4.10.0

Description Mark Nowiasz 2017-02-20 19:35:21 UTC
Created attachment 464456 [details]
build.log

When trying to install nvidia-drivers-378.13 after updating the kernel to 4.10.0, nvidia-drivers-378.13 fails to compile:

/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia/nv-pat.c: In function ‘nvidia_cpu_callback’:
/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia/nv-pat.c:213:14: error: ‘CPU_DOWN_FAILED’ undeclared (first use in this function)
         case CPU_DOWN_FAILED:
              ^
/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia/nv-pat.c:213:14: note: each undeclared identifier is reported only once for each function it appears in
/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia/nv-pat.c:220:14: error: ‘CPU_DOWN_PREPARE’ undeclared (first use in this function)
         case CPU_DOWN_PREPARE:
              ^
In file included from /var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia/nv-pat.c:15:0:
/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia/nv-pat.c: In function ‘nv_init_pat_support’:
/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/common/inc/nv-linux.h:391:34: error: implicit declaration of function ‘register_cpu_notifier’ [-Werror=implicit-function-declaration]
 #define register_hotcpu_notifier register_cpu_notifier
                                  ^
/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia/nv-pat.c:258:17: note: in expansion of macro ‘register_hotcpu_notifier’
             if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0)
                 ^
/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia/nv-pat.c: In function ‘nv_teardown_pat_support’:
/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/common/inc/nv-linux.h:388:36: error: implicit declaration of function ‘unregister_cpu_notifier’ [-Werror=implicit-function-declaration]
 #define unregister_hotcpu_notifier unregister_cpu_notifier
                                    ^
/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia/nv-pat.c:283:9: note: in expansion of macro ‘unregister_hotcpu_notifier’
         unregister_hotcpu_notifier(&nv_hotcpu_nfb);
         ^
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-4.10.0-gentoo/scripts/Makefile.build:295: /var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia/nv-pat.o] Error 1
make[2]: *** [/usr/src/linux-4.10.0-gentoo/Makefile:1490: _module_/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel] Error 2
make[2]: Leaving directory '/usr/src/linux-4.10.0-gentoo'
make[1]: *** [Makefile:150: sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-4.10.0-gentoo'
make: *** [Makefile:81: modules] Error 2
Comment 1 Spoiler 2017-02-21 12:54:44 UTC
Confirmed this:
...
In file included from /var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia-drm/nvidia-drm.c:27:0:
/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/kernel/nvidia-drm/nvidia-drm-priv.h:37:25: фатальная ошибка (fatal error): linux/fence.h: Нет такого файла или каталога (no file or folder)
 #include <linux/fence.h>
компиляция прервана (compilation terminated)
...
Comment 2 ganthore 2017-02-21 13:18:12 UTC
Created attachment 464508 [details, diff]
Ebuild patch

Patches ebuild to include needed kernel patch for kernel versions that are >=4.10.0
Comment 3 ganthore 2017-02-21 13:19:41 UTC
Created attachment 464510 [details, diff]
Kernel patch for nvidia drivers to work with kernel 4.10.0

Fixes issues with latest nvidia-drivers failing to compile against kernels >= 4.10.0
Comment 4 Matthew Marchese Gentoo Infrastructure gentoo-dev 2017-02-23 16:24:56 UTC
Attached Nvidia drivers patch in comment 3 worked for me against kernel 4.10.0.
Comment 5 Brian Evans (RETIRED) gentoo-dev 2017-02-23 17:24:03 UTC

*** This bug has been marked as a duplicate of bug 610058 ***