355.06 (and earlier) driver fails to compile on linux 4.2.0-rc5

When attempting to install the 355.06 linux x86-64 driver, I get the following error:

Building modules, stage 2.
MODPOST 2 modules
FATAL: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol ‘flush_workqueue’
scripts/Makefile.modpost:90: recipe for target ‘__modpost’ failed
make[2]: *** [__modpost] Error 1
Makefile:1384: recipe for target ‘modules’ failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-4.2.0-rc5-custom’
Makefile:81: recipe for target ‘modules’ failed
make: *** [modules] Error 2

Well, looks like this was reported 2 months ago and I missed it: https://devtalk.nvidia.com/default/topic/849913/linux/driver-fails-to-compile-on-4-2-0-kernel-due-to-recent-workqueue-changes/ sorry for the dup! still, a fix would be nice.

diff -Nur a/kernel/nvidia/nv-frontend.c b/kernel/nvidia/nv-frontend.c
--- a/kernel/nvidia/nv-frontend.c       2015-07-29 05:13:57.000000000 +0200
+++ b/kernel/nvidia/nv-frontend.c       2015-08-03 23:52:12.891515120 +0200
@@ -15,7 +15,7 @@
 #include "nv-frontend.h"

 #if defined(MODULE_LICENSE)
 #if defined(MODULE_INFO)
 MODULE_INFO(supported, "external");
diff -Nur a/kernel/nvidia/nv.c b/kernel/nvidia/nv.c
--- a/kernel/nvidia/nv.c        2015-07-29 05:13:57.000000000 +0200
+++ b/kernel/nvidia/nv.c        2015-08-03 23:51:55.024970624 +0200
@@ -33,7 +33,7 @@

 #if defined(MODULE_LICENSE)
 #if defined(MODULE_INFO)
 MODULE_INFO(supported, "external");

nvidia-patch.zip (737 Bytes)

Works in kernel 4.2-rc6 and NVIDIA-Linux-x86_64-355.00.05

As a “NEWBIE” to the linux world and not a master yet… How do I go about (steps) applying this patch in order to use kernel 4.2?

Lying about the module’s license type seems like the wrong approach.

Because it’s a workaround. Let the kernel or Nvidia devs actually fix it.

We’re using stable kernel 4.2 and have this problem. Is there still no proper fix available? I’d rather not alter the license type but if that’s what it takes to get it to work, so be it.

How “exactly” do I go about applying the patch in the zip file to the kernel. I’m a tad bit on the NEWBIE/BEGINNER side of the Linux world. If anybody can give a step guide to solving this dilemna it would help greatly!!! I’m sure not just for me, but for many others as well who read this and have no idea where to start.

If anybody can do the guide/instructions… THANK YOU SO MUCH IN ADVANCE!

extract the installer: sh NVIDIA-Linux-x86-352.41.run -x

go into the created dir: cd NVIDIA-Linux-x86-352.41

apply the patch: patch -p1 < /path/to/your/patch.diff

  • I just applied the changed by hand since it was faster than downloading a patch. That being the case, you may have to adjust the number in the “-p1” part (ex. -p0, -p2, whatever works).

THANK YOU FOR TEACHING ME THIS!!! I was able to apply the patch.

One last question…

How do I execute the install now that it’s in a folder state? Or… How do I remake the .run file in order to install/run how the file was able to do when originally downloaded?

Sorry for bugging you with this!

To install you’ll need root priviledges, so from inside the NVIDIA-Linux-x86-352.41 dir you would:
sudo ./nvidia-installer

I’m not sure how to pack it back into a .run file. In the past I would just .tar.bz2 the source dir and copy it to other machines that way.

It looks like a fix was checked into the workqueue tree, but didn’t make it into Linux 4.2: https://git.kernel.org/cgit/linux/kernel/git/tj/wq.git/commit/?h=for-4.3&id=1dadafa86a779884f14a6e7a3ddde1a57b0a0a65

Hopefully, distributions will apply this patch to their builds of earlier kernels.

In the meantime, you can apply a patch to a .run file and generate a new .run with the patch included by using the --apply-patch option.

Thanks for the info aplattner!