Ask Your Question

kernel 4.10 patch for nvidia 378.13 proprietary drivers

asked 2017-03-28 15:27:36 -0500

SteveEbey73701 gravatar image

updated 2017-03-29 11:40:48 -0500

updated 03/29/2017 - Nvidia patch for driver 378.13 to work with kernel 4.10.

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted

answered 2017-03-28 17:29:16 -0500

SteveEbey73701 gravatar image

found a fix, thanks to @sideburns. This affects all nvidia drivers, rpm or proprietary. i do think the nonfree rpm has been patched, but i use proprietary, so included in the code block here, is the patch file to use, against the extracted files from the proprietary driver. Copy and paste into a text file, in the same folder you extracted the driver into. patch the file as follows, patch -p1 <nameoffile.txt after you have done that, reboot to run level 3, change to the folder, and run the nvidia-installer. it will ask to remove your old driver, so let it. allow dkms so you can (hopefully) update on the next kernel change, and install 32 bit if you use steam. it might ask about overwriting 32 bit files. Your choice as to whether you want to update xconfig file.I chose to, as it makes a backup. reboot to run level 5 and go your happy way.

diff -ur NVIDIA-Linux-x86_64-378.13/kernel/common/inc/nv-mm.h NVIDIA-Linux-x86_64-378.13.patched/kernel/common/inc/nv-mm.h
--- NVIDIA-Linux-x86_64-378.13/kernel/common/inc/nv-mm.h    2017-02-08 04:58:34.000000000 +0100
+++ NVIDIA-Linux-x86_64-378.13.patched/kernel/common/inc/nv-mm.h    2017-02-23 18:57:34.655592444 +0100
@@ -46,6 +46,8 @@
  *   2016 Dec 14:5b56d49fc31dbb0487e14ead790fc81ca9fb2c99

+#include <linux/version.h>
         #define NV_GET_USER_PAGES           get_user_pages
@@ -92,10 +94,13 @@
                                             pages, vmas, NULL);

                return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
                                             pages, vmas);
+               return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
+                                            pages, vmas, NULL);

diff -ur NVIDIA-Linux-x86_64-378.13/kernel/nvidia/nv-p2p.c NVIDIA-Linux-x86_64-378.13.patched/kernel/nvidia/nv-p2p.c
--- NVIDIA-Linux-x86_64-378.13/kernel/nvidia/nv-p2p.c   2017-02-08 04:58:34.000000000 +0100
+++ NVIDIA-Linux-x86_64-378.13.patched/kernel/nvidia/nv-p2p.c   2017-02-23 18:57:34.655592444 +0100
@@ -146,7 +146,7 @@
 int nvidia_p2p_get_pages(
     uint64_t p2p_token,
     uint32_t va_space,
-    uint64_t virtual_address,
+    uint64_t address,
     uint64_t length,
     struct nvidia_p2p_page_table **page_table,
     void (*free_callback)(void * data),
@@ -211,7 +211,7 @@

     status = rm_p2p_get_pages(sp, p2p_token, va_space,
-            virtual_address, length, physical_addresses, wreqmb_h,
+            address, length, physical_addresses, wreqmb_h,
             rreqmb_h, &entries, &gpu_uuid, *page_table,
             free_callback, data);
     if (status != NV_OK)
@@ -286,7 +286,7 @@

     if (bGetPages)
-        rm_p2p_put_pages(sp, p2p_token, va_space, virtual_address,
+        rm_p2p_put_pages(sp, p2p_token, va_space, address,
                 gpu_uuid, *page_table);

@@ -329,7 +329,7 @@
 int nvidia_p2p_put_pages(
     uint64_t p2p_token,
     uint32_t va_space,
-    uint64_t virtual_address,
+    uint64_t address,
     struct nvidia_p2p_page_table *page_table
@@ -343,7 +343,7 @@
         return rc;

-    status = rm_p2p_put_pages(sp, p2p_token, va_space, virtual_address,
+    status = rm_p2p_put_pages(sp, p2p_token, va_space, address,
             page_table->gpu_uuid, page_table);
     if (status == NV_OK)
diff -ur NVIDIA-Linux-x86_64-378.13/kernel/nvidia/nv-pat.c NVIDIA-Linux-x86_64-378.13.patched/kernel/nvidia/nv-pat.c
--- NVIDIA-Linux-x86_64-378.13/kernel/nvidia/nv-pat.c   2017-02-08 04:58:34.000000000 +0100
+++ NVIDIA-Linux-x86_64-378.13.patched/kernel/nvidia/nv-pat.c   2017-02-23 18:57:34.655592444 +0100
@@ -203,6 +203,7 @@

 static int
 nvidia_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
@@ -234,6 +235,34 @@
     .notifier_call = nvidia_cpu_callback,
     .priority = 0
+static int nvidia_cpu_online(unsigned int hcpu)
+    unsigned int cpu = get_cpu();
+    if (cpu == hcpu)
+        nv_setup_pat_entries(NULL ...
edit flag offensive delete link more

answered 2017-03-28 15:46:52 -0500

sideburns gravatar image

I checked for updates this morning and found none. Currently, I'm running 4.9.14-200.fc25.x86_64 which means that 4.10 hasn't been released yet. Maybe this issue is why. Is there something new in that kernel that you need or an issue you expect it to fix? If not, my advice is to wait until it's released, or at least reaches updates-testing. (I haven't checked, but judging by what you posted, it shouldn't be there yet. If it is, I'd suggest that you go to the Updates page and give it some negative karma, along with a polite comment explaining why.

edit flag offensive delete link more


got up this morning, kernel 4.10-5 showed up in the updates repo, installed it, and dkms crashed, fences.h not found. booted back to 4.9.14. checked update, 4.10-5 showed posted 5 day ago, so here is the link, wonder why you are not seeing it.

SteveEbey73701 gravatar imageSteveEbey73701 ( 2017-03-28 15:49:37 -0500 )edit

So it is. It must have hit the repo after I checked this morning. I sit corrected. Notice, however, that there are four reports of problems since it was pushed, 11 hours ago as of now.

sideburns gravatar imagesideburns ( 2017-03-28 17:28:08 -0500 )edit

the patch works, for 4.10.5-200, so will see how it goes from here. seems like 4.10 is faster on my system, file transfer and other works seems to load and run faster. I will see what changes came in 4.10. I know it was talked about in fedora magazine not to long ago.

SteveEbey73701 gravatar imageSteveEbey73701 ( 2017-03-28 19:00:20 -0500 )edit
florian gravatar imageflorian ( 2017-03-28 23:37:27 -0500 )edit

thanks @florian for the link, very similar to what @sideburns posted earlier. Appreciate the help from everyone. Patched driver is running, no errors at all, and overall system performance has definitely increased with 4.10

SteveEbey73701 gravatar imageSteveEbey73701 ( 2017-03-28 23:50:31 -0500 )edit

answered 2017-04-02 19:31:28 -0500

download Nvidia installer and then apply patch here at this link for whatever kernel you have. --extract-only when running nvidia installer then go into folder created by nvidia installer and run the patch and lastly ./nvidia-installer. Credits to this site for the info also if you have selinux make sure to put in permissive mode after running installer. Check setroubleshoot policy to verify you want to install it first though if you like to audit things on your system.

Take care,

edit flag offensive delete link more

answered 2017-04-02 13:44:46 -0500

KillLo gravatar image

Hello everyone, i have kernel 4.10.6-100.fc25.x86_64 on fedora 25 with GTX 1060, I was using on run level 3 (systemctl set-default and i use this link to fix my problems

Hope this work for everyone :)

edit flag offensive delete link more


are you running 378.09 or 378.13? the patch here is for 378.13, and i used it on kernel 4.10.5 and when 4.10.6 same out dkms updated perfectly,

SteveEbey73701 gravatar imageSteveEbey73701 ( 2017-04-02 14:51:08 -0500 )edit

I dont remember what version i was using, but i install the 378.09 and worked fine

KillLo gravatar imageKillLo ( 2017-04-02 19:26:34 -0500 )edit

Question Tools

1 follower


Asked: 2017-03-28 15:27:36 -0500

Seen: 3,050 times

Last updated: Mar 29 '17