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

Bug 591766

Summary: x11-drivers/nvidia-drivers-370.23 with CONFIG_DEBUG_MUTEXES=y - FATAL: modpost: GPL-incompatible module nvidia-drm.ko uses GPL-only symbol 'mutex_destroy'
Product: Gentoo Linux Reporter: Louis Sautier (sbraz) <sbraz>
Component: Current packagesAssignee: Jeroen Roovers (RETIRED) <jer>
Status: RESOLVED FIXED    
Severity: normal CC: anton.gubarkov, bkohler, josef64, kroemmelbein, marat, O01eg, Oliver, rei4dan
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
kernel_mutex_debug_no_gpl.patch

Description Louis Sautier (sbraz) gentoo-dev 2016-08-21 00:09:00 UTC
Created attachment 443808 [details]
build.log

Emerging nvidia-drivers-370.23 with kernel 4.7.0 having CONFIG_DEBUG_MUTEXES enabled results in an error:
FATAL: modpost: GPL-incompatible module nvidia-drm.ko uses GPL-only symbol 'mutex_destroy'
Recompiling the kernel with CONFIG_DEBUG_MUTEXES=n fixed the issue.

AFAIK this did not happen with 367.35. 

Relevant forum post: https://forums.gentoo.org/viewtopic-p-7955752.html
Comment 1 jorgicio 2016-08-21 03:06:46 UTC
Also happens with previous kernels, happened to me with 4.4.

This may explain that:

https://twitter.com/Cynede/status/765879300348342272?lang=es

Workaround: install the previous version (367.35-r1) with this patch:

http://pastebin.com/cw1tncgm

Works fine with kernel 4.7.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2016-08-21 12:26:38 UTC
(In reply to jorgicio from comment #1)
> Also happens with previous kernels, happened to me with 4.4.
> 
> This may explain that:
> 
> https://twitter.com/Cynede/status/765879300348342272?lang=es
> 
> Workaround: install the previous version (367.35-r1) with this patch:

That's not a workaround. It's doing something completely different. The best workaround is apparently to disable CONFIG_DEBUG_MUTEXES.

Your best bet for a fix is to report this to Nvidia to get an official fix.
Comment 3 Louis Sautier (sbraz) gentoo-dev 2016-08-21 12:30:47 UTC
Couldn't we at least add a preinst check?
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2016-08-21 13:04:12 UTC
(In reply to Louis Sautier (sbraz) from comment #3)
> Couldn't we at least add a preinst check?

Depends on what the scope is in nvidia-drivers versions.
Comment 5 jorgicio 2016-08-21 14:59:24 UTC
I must remember you just one thing: Nvidia-drivers 370.23 is a BETA version. The 367.35 is the latest stable version.

This may explain lot of things.

At least create a beta slot or mention such versions when beta.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2016-08-21 15:53:35 UTC
(In reply to jorgicio from comment #5)
> I must remember you just one thing: Nvidia-drivers 370.23 is a BETA version.

I happen to know this.

> The 367.35 is the latest stable version.

Yes.

> This may explain lot of things.

For example?

> At least create a beta slot or mention such versions when beta.

You don't appear to know what SLOTs are for.

How do you suggest I "mention" this?
Comment 7 jorgicio 2016-09-13 18:33:21 UTC
(In reply to Jeroen Roovers from comment #6)
> (In reply to jorgicio from comment #5)
> > I must remember you just one thing: Nvidia-drivers 370.23 is a BETA version.
> 
> I happen to know this.
> 
> > The 367.35 is the latest stable version.
> 
> Yes.
> 
> > This may explain lot of things.
> 
> For example?
> 
> > At least create a beta slot or mention such versions when beta.
> 
> You don't appear to know what SLOTs are for.
> 
> How do you suggest I "mention" this?

That's the point: there's NOT a beta slot. Period.
Comment 8 jorgicio 2016-09-13 18:35:18 UTC
Created attachment 445616 [details, diff]
kernel_mutex_debug_no_gpl.patch

There's a workaround for this and does NOT need to set CONFIG_DEBUG_MUTEXES=n: just patch the kernel, rebuild, and then try to install the latest version of nvidia-drivers.

Also, this is NOT solved in upstream, so it must NOT to mark this bug as such.
Comment 9 stqn 2016-12-15 23:11:07 UTC
Still an issue for nvidia-drivers 375.26 (and linux 4.4.38) which is the latest stable nvidia driver (stable according to nvidia).

It would be great if the ebuild did a preinstall check to warn about this.
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2016-12-17 07:15:45 UTC
Comment on attachment 445616 [details, diff]
kernel_mutex_debug_no_gpl.patch

Kernel authors would be livid if that was patched in.
Comment 11 Stephan Litterst 2016-12-26 08:44:38 UTC
Same problem with nvidia-drivers 375.26 and linux 4.4.26 x86_64.
This did not happen with nvidia-drivers 361.28 and linux 4.4.26 x86_64.
Comment 12 Anton Gubarkov 2017-01-24 07:35:16 UTC
I have no DEBUG_MUTEX set in my .config, 
r9-008cln ~ # grep -i MUTEX /usr/src/linux/.config
CONFIG_RT_MUTEXES=y
# Lock Debugging (spinlocks, mutexes, etc...)
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set

however my build of nvidia-drivers-378.09 fails with the above error (I use rt-sources-4.8.14_p9)
Comment 13 Linear Systems Tech Svcs. 2017-05-08 17:50:27 UTC
Checking the current status of this bug since we no longer have any of the 36x.xx series drivers in the current portage tree to fall back to.

 ~ # ls /usr/portage/x11-drivers/nvidia-drivers/
files/                              metadata.xml                        nvidia-drivers-173.14.39-r2.ebuild  nvidia-drivers-340.102.ebuild       nvidia-drivers-378.13.ebuild        nvidia-drivers-96.43.23-r1.ebuild
Manifest                            nvidia-drivers-173.14.39-r1.ebuild  nvidia-drivers-304.135.ebuild       nvidia-drivers-375.39.ebuild        nvidia-drivers-381.09.ebuild
Comment 14 Nicolas Porcel 2017-05-10 20:58:29 UTC
I have the same problem with nvidia-drivers-381.09 and kernel 4.11 and the following symbols: `refcount_inc` and `refcount_dec_and_test`.

As there are other problems with this (unsupported) setup, I will create a dedicated report with the patches I created.
Comment 15 Jeroen Roovers (RETIRED) gentoo-dev 2017-05-12 19:12:14 UTC
(In reply to Nicolas Porcel from comment #14)
> I have the same problem with nvidia-drivers-381.09 and kernel 4.11 and the
> following symbols: `refcount_inc` and `refcount_dec_and_test`.

So that's not the same problem at all. See bug #618216.
Comment 16 Christoph Koke 2017-10-13 13:11:58 UTC
I was also hit by this today (kernel x11-drivers/nvidia-drivers-384.90 and sys-kernel/gentoo-sources-4.13.6). Some check or at least a warning would have been nice and also would have saved me some time searching for this.
Comment 17 Reinis Danne 2018-12-14 11:20:07 UTC
Hit this with x11-drivers/nvidia-drivers-390.87 and sys-kernel/gentoo-sources-{4.14.87,4.14.88} using sys-kernel/genkernel-next-69.
Comment 18 Larry the Git Cow gentoo-dev 2018-12-14 13:04:31 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4179f9108aa3142273b5408ab7653143b50d54c

commit f4179f9108aa3142273b5408ab7653143b50d54c
Author:     Jeroen Roovers <jer@gentoo.org>
AuthorDate: 2018-12-14 13:04:14 +0000
Commit:     Jeroen Roovers <jer@gentoo.org>
CommitDate: 2018-12-14 13:04:27 +0000

    x11-drivers/nvidia-drivers: Check for CONFIG_DEBUG_MUTEXES
    
    Fixes: https://bugs.gentoo.org/591766
    Package-Manager: Portage-2.3.52, Repoman-2.3.12
    Signed-off-by: Jeroen Roovers <jer@gentoo.org>

 x11-drivers/nvidia-drivers/nvidia-drivers-304.137.ebuild   | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-340.107.ebuild   | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-375.82.ebuild    | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-378.13-r1.ebuild | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-381.22-r1.ebuild | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-384.130.ebuild   | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-387.34.ebuild    | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-390.87.ebuild    | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-396.54.ebuild    | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-410.78.ebuild    | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-415.18.ebuild    | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-415.22.ebuild    | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-415.23.ebuild    | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)