[patches] 378.13 - 4.10 and 4.11-rc5
[b]Update: 381.09 released, this post will no longer be updated with anything that might happen after rc5.[/b] Will try to keep this updated with current git master of linuses tree, here is the newest patch (thanks to @albertomilone / Ubuntu for publishing propper [url=https://pkgs.rpmfusion.org/cgit/nonfree/nvidia-kmod.git/plain/kernel_4.10.patch]fix for CPU_HOTPLUG on 4.10[/url] [b]vanilla 4.10 patch[/b] https://gist.github.com/tpruzina/c4d9c0ca6bdbb6e78ab2126a7cdf8f1c [code]patch -p1 <<< $('curl https://gist.githubusercontent.com/tpruzina/c4d9c0ca6bdbb6e78ab2126a7cdf8f1c/raw/38ccd3224f3205e45982c0c217e23d04f9681b49/gistfile1.txt')[/code] [b]4.11-rc2 patch[/b] [b]WARNING, DUE TO GPL-only exported symbols being in use after upstream changes, this patch relicenses NVIDIAs module as a quick and dirty workaround. You definitely shouldn't use this outside personal use (for testing).[/b] [s] https://gist.github.com/tpruzina/ae0390e16c3404af2e1667778f5af780[/s] [code]patch -p1 <<< $(curl 'https://gist.githubusercontent.com/tpruzina/ae0390e16c3404af2e1667778f5af780/raw/53250f0c93d0586e7b028f724cfdf0c72812db1a/gistfile1.txt')[/code] Offending patches discussed here: https://patchwork.kernel.org/patch/9429407/, marked as [url=https://github.com/torvalds/linux/commit/10383aea2f445bce9b2a2b308def08134b438c8e]10383aea2f445bce9b2a2b308def08134b438c8e[/url] in upstream git. NVIDIA is 'on it' and it seems that they will have their own fix up soon, discussion is on LKML. https://lkml.org/lkml/2017/3/8/126
Update: 381.09 released, this post will no longer be updated with anything that might happen after rc5.

Will try to keep this updated with current git master of linuses tree, here is the newest patch (thanks to @albertomilone / Ubuntu for publishing propper fix for CPU_HOTPLUG on 4.10

vanilla 4.10 patch
https://gist.github.com/tpruzina/c4d9c0ca6bdbb6e78ab2126a7cdf8f1c

patch -p1 <<< $('curl https://gist.githubusercontent.com/tpruzina/c4d9c0ca6bdbb6e78ab2126a7cdf8f1c/raw/38ccd3224f3205e45982c0c217e23d04f9681b49/gistfile1.txt')


4.11-rc2 patch

WARNING, DUE TO GPL-only exported symbols being in use after upstream changes, this patch relicenses NVIDIAs module as a quick and dirty workaround. You definitely shouldn't use this outside personal use (for testing).

https://gist.github.com/tpruzina/ae0390e16c3404af2e1667778f5af780

patch -p1 <<< $(curl 'https://gist.githubusercontent.com/tpruzina/ae0390e16c3404af2e1667778f5af780/raw/53250f0c93d0586e7b028f724cfdf0c72812db1a/gistfile1.txt')


Offending patches discussed here:
https://patchwork.kernel.org/patch/9429407/,
marked as 10383aea2f445bce9b2a2b308def08134b438c8e in upstream git.

NVIDIA is 'on it' and it seems that they will have their own fix up soon, discussion is on LKML.
https://lkml.org/lkml/2017/3/8/126

#1
Posted 02/22/2017 06:24 PM   
Hello there, Is there any patch for 340.102 legacy driver for the kernel 4.10?
Hello there,
Is there any patch for 340.102 legacy driver for the kernel 4.10?

#2
Posted 02/22/2017 07:35 PM   
[quote=""]Is there any patch for 340.102 legacy driver for the kernel 4.10?[/quote] I don't believe there is (yet), at least quick google search didn't return anything. I keep latest beta drivers up to date with latest kernels for my personal use only and I don't do legacy drivers unfurtunatedly. I'm sure that once 4.10 is included in ubuntu/fedora, they will have propper patches for it. I just share what I have here with rest of the folks.
said:Is there any patch for 340.102 legacy driver for the kernel 4.10?

I don't believe there is (yet), at least quick google search didn't return anything.
I keep latest beta drivers up to date with latest kernels for my personal use only and I don't do legacy drivers unfurtunatedly. I'm sure that once 4.10 is included in ubuntu/fedora, they will have propper patches for it.
I just share what I have here with rest of the folks.

#3
Posted 02/23/2017 05:37 PM   
[quote="kemalihsan"] Hello there, Is there any patch for 340.102 legacy driver for the kernel 4.10? [/quote] kernel 4.10 suport - nvidia 340: https://pkgs.rpmfusion.org/cgit/nonfree/nvidia-340xx-kmod.git/plain/4.10.0_kernel.patch 304: https://pkgs.rpmfusion.org/cgit/nonfree/nvidia-304xx-kmod.git/plain/kernel_4.10.patch 378: https://pkgs.rpmfusion.org/cgit/nonfree/nvidia-kmod.git/plain/kernel_4.10.patch

#4
Posted 02/23/2017 06:45 PM   
Hi, I've been trying to patch the nvidia-installer all evening, and was led here after furious googling. When I attempt to patch using the above link I get the following error: [code]patch: **** Only garbage was found in the patch input. [/code] I'm probably doing something wrong, but this is my first attempt at compiling. I used following commands: [code] sh NVIDIA-Linux-x86_64-378.13.run --extract-only[/code] [code]cd NVIDIA-Linux-x86_64-378.13[/code] [code]patch -p1 <<< $(curl https://gist.githubusercontent.com/tpruzina/4a4aef53b266aa04606385b92ca6d042/raw/d3fabe741c9d9babab20fee294c00f1be6482ba8/gistfile1.txt) ./nvidia-installer [/code] Anything jump out at anyone? Again, I don't actually know what I'm doing, I'm just repeating stuff found on google that I don't understand...
Hi, I've been trying to patch the nvidia-installer all evening, and was led here after furious googling. When I attempt to patch using the above link I get the following error:
patch: **** Only garbage was found in the patch input.

I'm probably doing something wrong, but this is my first attempt at compiling.
I used following commands:
sh NVIDIA-Linux-x86_64-378.13.run --extract-only

cd NVIDIA-Linux-x86_64-378.13

patch -p1 <<< $(curl https://gist.githubusercontent.com/tpruzina/4a4aef53b266aa04606385b92ca6d042/raw/d3fabe741c9d9babab20fee294c00f1be6482ba8/gistfile1.txt) ./nvidia-installer


Anything jump out at anyone? Again, I don't actually know what I'm doing, I'm just repeating stuff found on google that I don't understand...

#5
Posted 02/23/2017 09:41 PM   
@Halpm: is that "./nvidia-installer" appended to that patch line or just typo? Also, if you don't have curl installed (and built with ssl support), it wont download the patch, but alternatively just download the file manually and use "patch -p1 < file.patch" in extracted folder. I don't see anything else "wrong" with what you are doing per se.
@Halpm: is that "./nvidia-installer" appended to that patch line or just typo?

Also, if you don't have curl installed (and built with ssl support), it wont download the patch, but alternatively just download the file manually and use "patch -p1 < file.patch" in extracted folder.

I don't see anything else "wrong" with what you are doing per se.

#6
Posted 02/24/2017 08:41 PM   
Thank you, it worked.
Thank you, it worked.

#7
Posted 02/27/2017 11:36 PM   
I applied patch -p1 <<< $(curl 'https://gist.githubusercontent.com/tpruzina/ae0390e16c3404af2e1667778f5af780/raw/084e398576640ead019e914fa7c8e2d57bc6811f/gistfile1.txt') But Intall of Driver 378.13 failed. [...] /tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia/ibmnpu_linux.o ld -r -o /tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia-modeset/nv-modeset-interface.o /tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia-modeset/nvidia-modeset-linux.o LD [M] /tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia.o LD [M] /tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia-modeset.o LD [M] /tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia-drm.o make[3]: Target '__build' not remade because of errors. /home/masaru/Kernel/linux-4.11-rc1/Makefile:1492: recipe for target '_module_/tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel' failed make[2]: *** [_module_/tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel] Error 2 make[2]: Target 'modules' not remade because of errors. make[2]: Leaving directory '/home/masaru/Kernel/linux-4.11-rc1' Makefile:152: recipe for target 'sub-make' failed make[1]: *** [sub-make] Error 2 make[1]: Target 'modules' not remade because of errors. make[1]: Leaving directory '/home/masaru/Kernel/linux-4.11-rc1' Makefile:81: recipe for target 'modules' failed make: *** [modules] Error 2 ERROR: The nvidia kernel module was not created. ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com. Any Hint? Thanks,
I applied

patch -p1 <<< $(curl 'https://gist.githubusercontent.com/tpruzina/ae0390e16c3404af2e1667778f5af780/raw/084e398576640ead019e914fa7c8e2d57bc6811f/gistfile1.txt')

But Intall of Driver 378.13 failed.

[...]
/tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia/ibmnpu_linux.o
ld -r -o /tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia-modeset/nv-modeset-interface.o /tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia-modeset/nvidia-modeset-linux.o
LD [M] /tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia.o
LD [M] /tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia-modeset.o
LD [M] /tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel/nvidia-drm.o
make[3]: Target '__build' not remade because of errors.
/home/masaru/Kernel/linux-4.11-rc1/Makefile:1492: recipe for target '_module_/tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel' failed
make[2]: *** [_module_/tmp/selfgz8209/NVIDIA-Linux-x86_64-378.13-custom/kernel] Error 2
make[2]: Target 'modules' not remade because of errors.
make[2]: Leaving directory '/home/masaru/Kernel/linux-4.11-rc1'
Makefile:152: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Target 'modules' not remade because of errors.
make[1]: Leaving directory '/home/masaru/Kernel/linux-4.11-rc1'
Makefile:81: recipe for target 'modules' failed
make: *** [modules] Error 2
ERROR: The nvidia kernel module was not created.
ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.


Any Hint?

Thanks,

#8
Posted 03/07/2017 10:38 AM   
Should be fixed in updated comment.
Should be fixed in updated comment.

#9
Posted 03/08/2017 05:33 PM   
Dear all, are there any patches against the long-term release 375.39 which is the current one in Debian? I am trying to use the 3.78 patches, but besides trying to patch non-existing files (nvidia-uvm/uvm8_gpu_isr.c) and lots of failing hunks it doesn't work. Since the 375.39 are already running on 4.10 in Debian without any problem (patches already included), I tried to only change the MODULE_LICENSE stuff, but that gave me another problem during compilation, which I fixed using the information from the 378 patch. But finally I got stuck in compiling nvidia-uvm/uvm8.c where errors about initialization from incompatible pointer type are thrown ( .fault = uvm_vm_fault_sigbus etc etc). Any suggestions? Thanks
Dear all,
are there any patches against the long-term release 375.39 which is the current one in Debian? I am trying to use the 3.78 patches, but besides trying to patch non-existing files (nvidia-uvm/uvm8_gpu_isr.c) and lots of failing hunks it doesn't work.

Since the 375.39 are already running on 4.10 in Debian without any problem (patches already included), I tried to only change the MODULE_LICENSE stuff, but that gave me another problem during compilation, which I fixed using the information from the 378 patch.

But finally I got stuck in compiling nvidia-uvm/uvm8.c where errors about initialization from incompatible pointer type are thrown ( .fault = uvm_vm_fault_sigbus etc etc).

Any suggestions?

Thanks

#10
Posted 03/21/2017 02:06 AM   
[code]./NVIDIA-Linux-x86_64-340.102.run --apply-patch 4.10.0_kernel.patch Verifying archive integrity... OK Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 340.102................................................................................................................................................................................................................................. can't find file to patch at input line 16 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From 983a2ca221a371e08bb5ad11758a729cfa5aa88c Mon Sep 17 00:00:00 2001 |From: Alberto Milone <alberto.milone@canonical.com> |Date: Wed, 15 Feb 2017 17:05:55 +0100 |Subject: [PATCH 1/1] Add support for Linux 4.10 | |--- | nv-linux.h | 7 +++++++ | nv-pat.c | 40 ++++++++++++++++++++++++++++++++++++++++ | uvm/nvidia_uvm_lite.c | 4 ++++ | 3 files changed, 51 insertions(+) | |diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h |index e7068e3..2d62492 100644 |--- a/kernel/nv-linux.h |+++ b/kernel/nv-linux.h -------------------------- File to patch: [/code]
./NVIDIA-Linux-x86_64-340.102.run --apply-patch 4.10.0_kernel.patch 
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 340.102.................................................................................................................................................................................................................................
can't find file to patch at input line 16
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 983a2ca221a371e08bb5ad11758a729cfa5aa88c Mon Sep 17 00:00:00 2001
|From: Alberto Milone <alberto.milone@canonical.com>
|Date: Wed, 15 Feb 2017 17:05:55 +0100
|Subject: [PATCH 1/1] Add support for Linux 4.10
|
|---
| nv-linux.h | 7 +++++++
| nv-pat.c | 40 ++++++++++++++++++++++++++++++++++++++++
| uvm/nvidia_uvm_lite.c | 4 ++++
| 3 files changed, 51 insertions(+)
|
|diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
|index e7068e3..2d62492 100644
|--- a/kernel/nv-linux.h
|+++ b/kernel/nv-linux.h
--------------------------
File to patch:

icomputo.com

#11
Posted 03/21/2017 05:40 AM   
@icomputo Erm, that's 340.102 driver, not 378.13. @Norbu Unless you need UVM for cuda, you can simply try to skip building uvm modules like this: cd NVIDIA-Linux-x86_64-375.39/kernel make NV_EXCLUDE_KERNEL_MODULES=nvidia-uvm You could also modify Makefile in ./kernel directory so that it doesn't build UVM (which is only really required for CUDA) to workaround this. Afterwards, only nvidia.ko, nvidia-drm.ko and nvidia-modesetting.ko will be built. I only keep my patches up to date with most recent drivers and most recent git master, sorry. Fix is likely very trivial but I honestly don't have time fix every driver, I just fix it for myself and share it here in hope that it's useful for people who like to stay on bleeding edge with latest drivers&kernels like I do.
@icomputo Erm, that's 340.102 driver, not 378.13.

@Norbu Unless you need UVM for cuda, you can simply try to skip building uvm modules like this:
cd NVIDIA-Linux-x86_64-375.39/kernel
make NV_EXCLUDE_KERNEL_MODULES=nvidia-uvm

You could also modify Makefile in ./kernel directory so that it doesn't build UVM (which is only really required for CUDA) to workaround this. Afterwards, only nvidia.ko, nvidia-drm.ko and nvidia-modesetting.ko will be built.

I only keep my patches up to date with most recent drivers and most recent git master, sorry.
Fix is likely very trivial but I honestly don't have time fix every driver, I just fix it for myself and share it here in hope that it's useful for people who like to stay on bleeding edge with latest drivers&kernels like I do.

#12
Posted 03/21/2017 10:03 AM   
Wish I had found this before I spent the time figuring it out myself! Thanks for posting and the LKML link. I guess this upcoming 4.11 breakage is going to be tough to sort out.
Wish I had found this before I spent the time figuring it out myself! Thanks for posting and the LKML link.

I guess this upcoming 4.11 breakage is going to be tough to sort out.

Mainline on Metal - http://mom.hlmjr.com

#13
Posted 04/01/2017 08:40 AM   
From reading LKML it's my understanding that they are just gonna relicense the module to dual MIT/GPL and fix it in similar manner to what I did. Can't but to wonder if the fact that they are consulting their lawyers haven't delayed fairly stable release cycle (one release each month).
From reading LKML it's my understanding that they are just gonna relicense the module to dual MIT/GPL and fix it in similar manner to what I did. Can't but to wonder if the fact that they are consulting their lawyers haven't delayed fairly stable release cycle (one release each month).

#14
Posted 04/01/2017 09:46 AM   
[quote=""]@Norbu Unless you need UVM for cuda, you can simply try to skip building uvm modules like this: cd NVIDIA-Linux-x86_64-375.39/kernel make NV_EXCLUDE_KERNEL_MODULES=nvidia-uvm [/quote] Thanks for the hint. Unfortunately I need CUDA for some machine learning applications, so I will wait until the drivers (either upstream or on the Debian side) are updated. Thanks for your work! Norbert
said:@Norbu Unless you need UVM for cuda, you can simply try to skip building uvm modules like this:
cd NVIDIA-Linux-x86_64-375.39/kernel
make NV_EXCLUDE_KERNEL_MODULES=nvidia-uvm


Thanks for the hint. Unfortunately I need CUDA for some machine learning applications, so I will wait until the drivers (either upstream or on the Debian side) are updated.

Thanks for your work!

Norbert

#15
Posted 04/01/2017 01:33 PM   
Scroll To Top

Add Reply