Bug#934344: nvidia-kernel-dkms: nvidia kernel driver does not build with linux-5.2

Mario Palomo mariopal at gmail.com
Sun Aug 11 04:52:05 BST 2019


On Sat, 10 Aug 2019 20:04:01 +0300 =?UTF-8?B?QW5kcmVpIERlbWVraG92?= <
andrei at ipfran.ru> wrote:
> This bug seems to have a known origin:
https://garajau.com.br/2019/07/compiling-nvidia-418-on-kernel-52
>
> Best
> Andrei

Based on this I created the following patch, with which I was able to
regenerate the package nvidia-kernel-dkms_418.74-1_amd64.deb, and it worked
for me:

diff -Naurd
nvidia-graphics-drivers-418.74_OLD/debian/module/debian/patches/nvidia-uvm-put_user_pages.patch
nvidia-graphics-drivers-418.74_NEW/debian/module/debian/patches/nvidia-uvm-put_user_pages.patch
---
nvidia-graphics-drivers-418.74_OLD/debian/module/debian/patches/nvidia-uvm-put_user_pages.patch
1970-01-01 00:00:00.000000000 +0000
+++
nvidia-graphics-drivers-418.74_NEW/debian/module/debian/patches/nvidia-uvm-put_user_pages.patch
2019-08-11 03:43:01.517330332 +0000
@@ -0,0 +1,19 @@
+From linux 5.2.2 put_user_page is now being provided by the kernel and it
conflicts with the existing one by NVIDIA drivers.
+
+--- a/nvidia-uvm/uvm8_tools.c
++++ b/nvidia-uvm/uvm8_tools.c
+@@ -206,12 +206,14 @@ static bool
tracker_is_counter(uvm_tools_event_tracker_t *event_tracker)
+     return event_tracker != NULL && !event_tracker->is_queue;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 2)
+ static void put_user_pages(struct page **pages, NvU64 page_count)
+ {
+     NvU64 i;
+     for (i = 0; i < page_count; i++)
+         put_page(pages[i]);
+ }
++#endif
+
+ static void unmap_user_pages(struct page **pages, void *addr, NvU64 size)
+ {
diff -Naurd nvidia-graphics-drivers-418.74_OLD/debian/module/debian/patches/
series.in nvidia-graphics-drivers-418.74_NEW/debian/module/debian/patches/
series.in
--- nvidia-graphics-drivers-418.74_OLD/debian/module/debian/patches/
series.in 2019-05-11 11:52:38.000000000 +0000
+++ nvidia-graphics-drivers-418.74_NEW/debian/module/debian/patches/
series.in 2019-08-11 03:42:26.321398133 +0000
@@ -8,3 +8,4 @@
 cc_version_check-gcc5.patch
 nvidia-use-ARCH.o_binary.patch
 nvidia-modeset-use-ARCH.o_binary.patch
+nvidia-uvm-put_user_pages.patch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nvidia-devel/attachments/20190811/7f534559/attachment.html>


More information about the pkg-nvidia-devel mailing list