Driver 340.102 fails to build for kernel 4.11.3

The driver needs to be patched in order for the module to be built on 4.11 and newer kernels.

for a patch.

I’m willing to go out on a limb and suggest that given their release dates, the drivers for the older releases need to be patched as well.


With the patch you provided,I am unable to comply a new installation package,follow is their output:
patching file ./kernel/nv-drm.c
Hunk #1 succeeded at 22 with fuzz 1.
Hunk #3 FAILED at 66.
1 out of 3 hunks FAILED – saving rejects to file ./kernel/nv-drm.c.rej
can’t find file to patch at input line 222
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:

Are you aware that there are three patches required for 4.11 for 340.102 driver

+ tar --use-compress-program xz -xf /usr/share/nvidia-340xx-kmod-340.102/nvidia-340xx-kmod-340.102-i686.tar.xz
+ echo 'Patch #0 (nv-linux-arm.patch):'
+ /usr/bin/patch --no-backup-if-mismatch -p1 --fuzz=0
Patch #0 (nv-linux-arm.patch):
patching file kernel/nv-linux.h
Patch #1 (4.9.0_kernel.patch):
+ echo 'Patch #1 (4.9.0_kernel.patch):'
+ /usr/bin/patch --no-backup-if-mismatch -p1 --fuzz=0
patching file kernel/nv-drm.c
Patch #2 (4.10.0_kernel.patch):
+ echo 'Patch #2 (4.10.0_kernel.patch):'
+ /usr/bin/patch --no-backup-if-mismatch -p1 --fuzz=0
patching file kernel/nv-linux.h
Hunk #1 succeeded at 2083 (offset 1 line).
Hunk #2 succeeded at 2132 (offset 1 line).
patching file kernel/nv-pat.c
patching file kernel/uvm/nvidia_uvm_lite.c
Patch #3 (4.11_kernel.patch):
+ echo 'Patch #3 (4.11_kernel.patch):'
+ /usr/bin/patch --no-backup-if-mismatch -p1 --fuzz=0
patching file kernel/nv-drm.c
patching file kernel/uvm/nvidia_uvm_linux.h
patching file kernel/uvm/nvidia_uvm_lite.c
+ exit 0

My Driver installation file has been patch for kernel-4.10,so it isn’t the case i think.

I think we are talking different things.You mean patch for nvidia-340xx-kmod-340.102, but i mean driver installation file itself.

It’s the same code

Another patch has been applied for my installation file successfully.
Here is the url of the topic,


Please accept my apologizes, but how do I apply those patches 4.9 and 4.10?
I am not familiar with patch code and I do not know how to apply it. It looks to me that 4.09 code is like “git text” and not the code to patch something.
I do not use kernel 4.11. I use Ubuntu Linux 16.04, kernel

Thank you advance.