NVIDIA Drivers 381.22 + Linux 4.11 = patch is still required. Really, NVIDIA? (Fixed in 4.11.1)

Without this patch


NVIDIA drivers 381.22 fail to build:

ld -r -o /usr/src/nvidia-381.22/nvidia-modeset/nv-modeset-interface.o /usr/src/nvidia-381.22/nvidia-modeset/nvidia-modeset-linux.o
  LD [M]  /usr/src/nvidia-381.22/nvidia.o
  LD [M]  /usr/src/nvidia-381.22/nvidia-uvm.o
  LD [M]  /usr/src/nvidia-381.22/nvidia-modeset.o
  LD [M]  /usr/src/nvidia-381.22/nvidia-drm.o
  Building modules, stage 2.
  MODPOST 4 modules
FATAL: modpost: GPL-incompatible module nvidia-drm.ko uses GPL-only symbol 'refcount_inc'
make[2]: *** [__modpost] Error 1
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/usr/src/kernels/linux-4.11'
make: *** [modules] Error 2

This is with vanilla 4.11 kernel.

Aaron, that’s kinda unexpected. I mean RC1 for kernel 4.11 was released over two months ago and you still haven’t made your drivers compatible with the last stable kernel. Shame on you.

4.12 kernel should work. I was told on irc that this may fix it kernel/git/torvalds/linux.git - Linux kernel source tree


This is kinda f*cked up, but I should have got used to this years ago. I hope some 4.11.x patch will be released to revert this _GPL madness.

For 4.11, if you don’t need nvidia-drm (the module that needs to be relicensed) then try excluding it - this works for 375.66: http://rglinuxtech.com/?p=1970

I notified Greg and v4.11.1 should fix it. However you can apply the needed patch to your kernel sooner: https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/tree/queue-4.11/refcount-change-export_symbol-markings.patch

I just got notified by Greg that v4.11.1 is now in stable review. Expected to be released this weekend.

You can simply patch the Linux kernel sources themselves so that they stop this GPL terrorism and let all drivers compile whatever the license.

Here’s the patch I made (that one was for v4.2 but it still applies to Linux v4.11):

diff -durN linux-4.2.0/include/linux/export.h linux-4.2.0-patched/include/linux/export.h
--- linux-4.2.0/include/linux/export.h	2015-08-30 20:34:09.000000000 +0200
+++ linux-4.2.0-patched/include/linux/export.h	2015-08-31 16:35:20.620645230 +0200
@@ -69,14 +69,14 @@
 	__EXPORT_SYMBOL(sym, "")
 #define EXPORT_SYMBOL_GPL(sym)					\
-	__EXPORT_SYMBOL(sym, "_gpl")
+	__EXPORT_SYMBOL(sym, "")
 #define EXPORT_SYMBOL_GPL_FUTURE(sym)				\
-	__EXPORT_SYMBOL(sym, "_gpl_future")
+	__EXPORT_SYMBOL(sym, "")
 #define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
-#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
+#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused")

Can you help me out with how to apply this patch?

Sorts the issue out here!! Thanks.