Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 608264 - sys-kernel/gentoo-sources-4.9 breaks nvidia-drivers
Summary: sys-kernel/gentoo-sources-4.9 breaks nvidia-drivers
Status: RESOLVED DUPLICATE of bug 602844
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-05 00:37 UTC by jorgicio
Modified: 2017-02-12 08:34 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Working kernel config (.config,107.41 KB, text/plain)
2017-02-07 14:16 UTC, David Hallas
Details
Xorg.0.log (Xorg.0.log,4.88 KB, text/x-log)
2017-02-07 14:52 UTC, orionbelt2
Details
dmesg output (nvidia-error-dmesg.txt,30.76 KB, text/plain)
2017-02-07 14:53 UTC, orionbelt2
Details
The patch for the legacy drivers (legacy_drivers_nvidia.patch,454 bytes, patch)
2017-02-10 05:26 UTC, jorgicio
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jorgicio 2017-02-05 00:37:55 UTC
Hi!

gentoo-sources stable hit the 4.9 branch. However, it breaks the nvidia-drivers when it tries to load it:

 * Updating module dependencies for 4.9.6-gentoo-r1 ...
depmod: WARNING: //lib/modules/4.9.6-gentoo-r1/video/nvidia-uvm.ko needs unknown symbol memset
depmod: WARNING: //lib/modules/4.9.6-gentoo-r1/video/nvidia-uvm.ko needs unknown symbol memcpy
depmod: WARNING: //lib/modules/4.9.6-gentoo-r1/video/nvidia.ko needs unknown symbol memset  

After that, it won't load. Then, nvidia optimus does not work.

hackenherr:~# dmesg | tail                                                                                                                                                             [21:37:27]
[ 4650.119349] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: false (implement)
[ 4650.119358] brcmsmac bcma0:1: brcms_ops_config: change power-save mode: false (implement)
[ 4650.119516] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 4966.098835] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: false (implement)
[ 4966.098843] brcmsmac bcma0:1: brcms_ops_config: change power-save mode: false (implement)
[ 4966.098984] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 5282.086799] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: false (implement)
[ 5282.086807] brcmsmac bcma0:1: brcms_ops_config: change power-save mode: false (implement)
[ 5282.086968] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 5462.508988] nvidia: Unknown symbol memset (err 0)

Reverting to 4.4 works fine.

Reproducible: Always
Comment 1 David Hallas 2017-02-06 08:17:53 UTC
Did you remember to rebuild the nvidia kernel module after the kernel upgrade? You can use emerge @module-rebuild for this
Comment 2 jorgicio 2017-02-06 12:07:58 UTC
(In reply to David Hallas from comment #1)
> Did you remember to rebuild the nvidia kernel module after the kernel
> upgrade? You can use emerge @module-rebuild for this

Of course I did, indeed, this report came after I did the rebuild. Tried twice and the same happens.
Also,I read elsewhere and I noticed there's some kind of incompatibility between the kernel and the privative driver.
Comment 3 Sven B. 2017-02-06 13:27:48 UTC
Did you enable:
# CONFIG_TRIM_UNUSED_KSYMS is not set
?
Comment 4 jorgicio 2017-02-06 13:33:00 UTC
(In reply to Sven B. from comment #3)
> Did you enable:
> # CONFIG_TRIM_UNUSED_KSYMS is not set
> ?

Nope, doing a grep returned nothing.
Comment 5 jorgicio 2017-02-06 15:48:35 UTC
Well... I enabled that configuration (CONFIG_TRIM_UNUSED_KSYMS) and this happens:

 *   CONFIG_TRIM_UNUSED_KSYMS:	 should not be set. But it is.
 * Please check to make sure these options are set correctly.
 * Failure to do so may cause unexpected problems.
 * Once you have satisfied these options, please try merging
 * this package again.
 * ERROR: x11-drivers/nvidia-drivers-375.26::gentoo failed (setup phase):
 *   Incorrect kernel configuration options
 * 
 * Call stack:
 *                      ebuild.sh, line 115:  Called pkg_setup
 *   nvidia-drivers-375.26.ebuild, line 135:  Called linux-mod_pkg_setup
 *               linux-mod.eclass, line 572:  Called linux-info_pkg_setup
 *              linux-info.eclass, line 922:  Called check_extra_config
 *              linux-info.eclass, line 816:  Called die
 * The specific snippet of code:
 *   		die "Incorrect kernel configuration options"
 * 
 * If you need support, post the output of `emerge --info '=x11-drivers/nvidia-drivers-375.26::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-drivers/nvidia-drivers-375.26::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-375.26/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-375.26/temp/die.env'.
 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-375.26/homedir'
 * S: '/var/tmp/portage/x11-drivers/nvidia-drivers-375.26/work/'

>>> Failed to emerge x11-drivers/nvidia-drivers-375.26, Log file:

>>>  '/var/tmp/portage/x11-drivers/nvidia-drivers-375.26/temp/build.log'

 * Messages for package x11-drivers/nvidia-drivers-375.26:

 *   CONFIG_TRIM_UNUSED_KSYMS:	 should not be set. But it is.
 * Please check to make sure these options are set correctly.
 * Failure to do so may cause unexpected problems.
 * Once you have satisfied these options, please try merging
 * this package again.
 * ERROR: x11-drivers/nvidia-drivers-375.26::gentoo failed (setup phase):
 *   Incorrect kernel configuration options
 * 
 * Call stack:
 *                      ebuild.sh, line 115:  Called pkg_setup
 *   nvidia-drivers-375.26.ebuild, line 135:  Called linux-mod_pkg_setup
 *               linux-mod.eclass, line 572:  Called linux-info_pkg_setup
 *              linux-info.eclass, line 922:  Called check_extra_config
 *              linux-info.eclass, line 816:  Called die
 * The specific snippet of code:
 *   		die "Incorrect kernel configuration options"
 * 
 * If you need support, post the output of `emerge --info '=x11-drivers/nvidia-drivers-375.26::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-drivers/nvidia-drivers-375.26::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-375.26/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-375.26/temp/die.env'.
 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-375.26/homedir'
 * S: '/var/tmp/portage/x11-drivers/nvidia-drivers-375.26/work/'
Comment 6 jorgicio 2017-02-06 17:25:55 UTC
I had to disable it again (and disable the unused ksyms), and compilation went fine, but with the same errors as the beginning. Kernel >=4.7 and nvidia-drivers may not fit together.
Comment 7 David Hallas 2017-02-07 08:09:17 UTC
I am using gentoo-sources-4.9.6-r1 and nvidia-drivers-375.26 and it works fine. I do not get any errors when insmodding the drivers. If you want I can attach my kernel config?
Comment 8 jorgicio 2017-02-07 14:12:51 UTC
(In reply to David Hallas from comment #7)
> I am using gentoo-sources-4.9.6-r1 and nvidia-drivers-375.26 and it works
> fine. I do not get any errors when insmodding the drivers. If you want I can
> attach my kernel config?

Well.. it may be a good idea. Also, I patched the kernel to build with ld.gold, I don't know if that's the culprit.
Comment 9 David Hallas 2017-02-07 14:16:22 UTC
Created attachment 462796 [details]
Working kernel config
Comment 10 David Hallas 2017-02-07 14:17:26 UTC
I think it is a good idea to re-compile the kernel with the GNU linker to test. I have experienced similar problems when mixing libraries build with Gold and the GNU linker.
Comment 11 jorgicio 2017-02-07 14:19:30 UTC
(In reply to David Hallas from comment #10)
> I think it is a good idea to re-compile the kernel with the GNU linker to
> test. I have experienced similar problems when mixing libraries build with
> Gold and the GNU linker.

I'm working on my memoir about Clang/LLVM and it recommends to use the Gold linker. I think it's better to make the kernel building to force to use the default linker instead.
Comment 12 orionbelt2 2017-02-07 14:52:39 UTC
Created attachment 462802 [details]
Xorg.0.log
Comment 13 orionbelt2 2017-02-07 14:53:42 UTC
Created attachment 462804 [details]
dmesg output
Comment 14 orionbelt2 2017-02-07 15:02:50 UTC
I am having the same problem with sys-kernel/gentoo-sources-4.9.6-r1 compiled with genkernel. Above i just uploaded Xorg.0.log and the dmesg output.

Upon the end of the booting process, sddm crashes with this error message:

login: sddm[5272]: segfault at 7c0 ip 00000000000007c0 sp 00007ffea701a638 error 14 in sddm[400000+6d000]


The bug probably concerns only older "legacy" nVidia cards such as my GeForce 8600 GT:

https://www.nvidia.com/object/IO_32667.html

This probably explains why David Hallas did not experience the bug with his newer driver, in comment #7 . 

Look also here for more information, and a possible patch:

https://bbs.archlinux.org/viewtopic.php?id=222417
Comment 15 orionbelt2 2017-02-07 15:06:17 UTC
Sorry, i forgot to mention my nvidia driver: x11-drivers/nvidia-drivers-340.101-r1:0/340
Comment 16 jorgicio 2017-02-07 15:36:52 UTC
Well, my Nvidia Card is a GeForce GT 540M, which is not legacy. Also, I compiled the kernel with genkernel. As a reference.
Comment 17 Gleb 2017-02-07 15:50:38 UTC
issues with legacy cards are in another bug report with the patch: https://bugs.gentoo.org/show_bug.cgi?id=602844
Comment 18 orionbelt2 2017-02-07 16:05:40 UTC
Thanks Gleb, sorry about the noise in here... I don't see how i can delete my attachments, so i marked them as obsolete...

Looks like my bug has been resolved in the other thread, best of luck for this one, too... ;-)
Comment 19 jorgicio 2017-02-10 05:24:06 UTC
I found that my video card (Nvidia GeForce GT 540M) is now a legacy card. Tried with 340.xx version and working fine. (Also I found a patch that I'll submit then)

(In reply to David Hallas from comment #7)
> I am using gentoo-sources-4.9.6-r1 and nvidia-drivers-375.26 and it works
> fine. I do not get any errors when insmodding the drivers. If you want I can
> attach my kernel config?

Just in case, what's your card model?
Comment 20 jorgicio 2017-02-10 05:26:09 UTC
Created attachment 463074 [details, diff]
The patch for the legacy drivers

This patch is working. Also, as a suggestion, the [compat] as a dependency in the x11-misc/primus package is not needed because it works fine without the [compat] feature.
Comment 21 David Hallas 2017-02-10 08:56:44 UTC
(In reply to jorgicio from comment #19)
> I found that my video card (Nvidia GeForce GT 540M) is now a legacy card.
> Tried with 340.xx version and working fine. (Also I found a patch that I'll
> submit then)
> 
> (In reply to David Hallas from comment #7)
> > I am using gentoo-sources-4.9.6-r1 and nvidia-drivers-375.26 and it works
> > fine. I do not get any errors when insmodding the drivers. If you want I can
> > attach my kernel config?
> 
> Just in case, what's your card model?

My card is a NVIDIA GPU GeForce 940MX (GM108-A)
Comment 22 Gleb 2017-02-10 13:13:19 UTC
GT 540M is definitely not a legacy card, it's a Fermi based chip so it's relatevely new. At least it is not listed nowhere on these pages:

https://nvidia.custhelp.com/app/answers/detail/a_id/3142
https://www.nvidia.com/object/IO_32667.html

I may have missed some news sources, though.
Comment 23 jorgicio 2017-02-10 13:18:15 UTC
(In reply to Gleb from comment #22)
> GT 540M is definitely not a legacy card, it's a Fermi based chip so it's
> relatevely new. At least it is not listed nowhere on these pages:
> 
> https://nvidia.custhelp.com/app/answers/detail/a_id/3142
> https://www.nvidia.com/object/IO_32667.html
> 
> I may have missed some news sources, though.

Well... I thought so, but this page gets me confused:
http://www.nvidia.com/page/legacy.html
Also, with 340.xx, the card works fine, but not with recent versions (tried with 370.xx too)
Comment 24 jorgicio 2017-02-10 13:23:14 UTC
(In reply to David Hallas from comment #21)
> (In reply to jorgicio from comment #19)
> > I found that my video card (Nvidia GeForce GT 540M) is now a legacy card.
> > Tried with 340.xx version and working fine. (Also I found a patch that I'll
> > submit then)
> > 
> > (In reply to David Hallas from comment #7)
> > > I am using gentoo-sources-4.9.6-r1 and nvidia-drivers-375.26 and it works
> > > fine. I do not get any errors when insmodding the drivers. If you want I can
> > > attach my kernel config?
> > 
> > Just in case, what's your card model?
> 
> My card is a NVIDIA GPU GeForce 940MX (GM108-A)

Definitively your card is not legacy, so that's may explain why you don't have this problem. Thanks.
Comment 25 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2017-02-12 08:34:44 UTC
this legacy driver patch is added and is solved in >4.9.6 

and we cannot support tainted kernel with propietary module

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