Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685346 - x11-drivers/nvidia-drivers-{390.116-r2410.104-r2,415.27-r2} with kernel 5.1.0 - In file included from .../work/kernel/nvidia/nv-instance.c:13: .../work/kernel/common/inc/nv-list-helpers.h:94:19: error: redefinition of ‘list_is_first’
Summary: x11-drivers/nvidia-drivers-{390.116-r2410.104-r2,415.27-r2} with kernel 5.1.0...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-08 10:04 UTC by Nikolay Kichukov
Modified: 2019-08-06 16:50 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
suggested patch that allows the driver to compile (nvidia-5.1-kernel.patch,7.50 KB, patch)
2019-05-08 10:06 UTC, Nikolay Kichukov
Details | Diff
The patch work with Kernel 5.1 (kernel-5.1.patch,5.04 KB, patch)
2019-05-09 09:16 UTC, LeonBernieniv
Details | Diff
patch for nvidia drivers 390.116-r2, kernel 5.1 (nd-390.116-k5.1.patch,7.61 KB, patch)
2019-05-14 20:42 UTC, Don O
Details | Diff
build.log (kernel 5.2.0) (build.log,9.27 KB, text/x-log)
2019-07-11 12:00 UTC, email200202
Details
patch for kernel 5.2 (nd-390.116-k5.2.patch,829 bytes, text/plain)
2019-07-11 16:05 UTC, email200202
Details
Another patch for kernel 5.2 (nd-390.116-k5.2b.patch,1.05 KB, patch)
2019-07-13 06:37 UTC, email200202
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolay Kichukov 2019-05-08 10:04:50 UTC
The legacy nvidia hardware drivers package (nvidia-drivers-390.116-r2) fails to compile against kernel 5.1.0 (gentoo-sources-5.1.0).

The attached patch, resolves the compilation errors and has been successfully tested on AMD64 architectures.

Source: https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1679272.html

Reproducible: Always

Steps to Reproduce:
1. Install =gentoo-sources-5.1.0
2. Install =nvidia-drivers-390.116-r2
Actual Results:  
fails to compile with 'list_is_first' redefinition error

Expected Results:  
compile fine.
Comment 1 Nikolay Kichukov 2019-05-08 10:06:19 UTC
Created attachment 575514 [details, diff]
suggested patch that allows the driver to compile
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2019-05-08 14:16:22 UTC
    if use kernel_linux && kernel_is ge 5 1; then
        ewarn "Gentoo supports kernels which are supported by NVIDIA"
        ewarn "which are limited to the following kernels:"
        ewarn "<sys-kernel/gentoo-sources-5.1"
        ewarn "<sys-kernel/vanilla-sources-5.1"
        ewarn ""
        ewarn "You are free to utilize epatch_user to provide whatever"
        ewarn "support you feel is appropriate, but will not receive"
        ewarn "support as a result of those changes."
        ewarn ""
        ewarn "Do not file a bug report about this."
        ewarn ""
    fi

You have been warned.
Comment 3 LeonBernieniv 2019-05-09 09:16:50 UTC
Created attachment 575582 [details, diff]
The patch work with Kernel 5.1

Source: http://rglinuxtech.com/?p=2530
Comment 4 Nikolay Kichukov 2019-05-10 07:21:46 UTC
Hi Jeroen,
I did not pay attention to the warnings, sorry.
You can close this bug now.
Cheers,
-N
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2019-05-10 12:08:53 UTC
(In reply to Nikolay Kichukov from comment #4)
> I did not pay attention to the warnings, sorry.

No problem.

> You can close this bug now.

It has become a tradition to keep bugs like this one open until the problem is fixed upstream, because:

1) people tend to completely ignore the warnings, particularly the bit that says "Do not file a bug report about this."
2) insofar as the warnings are actually heeded, and as they point out that there may be patches that sort of unofficially fix the problem or work around it, and since CLOSED bugs are very hard to find, keeping open a bug report about the problem with attached patches tends to reduce the number of duplicate bug reports about the problem and probably reduces everyone's individual bug research time + patch hunt time as well.
Comment 6 email200202 2019-05-14 09:35:21 UTC
Same here

The warning has high percentage of false positive. I compile the driver anyway with the new kernel.
Comment 7 Don O 2019-05-14 20:42:41 UTC
Created attachment 576700 [details, diff]
patch for nvidia drivers 390.116-r2, kernel 5.1

I was helping someone with a problem of compiling the 390 drivers with the 5.1 kernel. In looking I found someone (debian if I remember right) that had backported the 418 patch, I modified it to work with gentoo (changed the diff paths) and it worked, at least the person compiled it cleanly. He will test tomorrow. 

I recommend placing the patch in /etc/portage/patches/x11-drivers/nvidia-drivers-390.116-r2
Comment 8 email200202 2019-07-11 11:42:44 UTC
nvidia-drivers-390.116-r2 (with the 5.1.0 patch) failed to compile against kernel 5.2.0

 CONFTEST: is_export_symbol_gpl_refcount_dec_and_test
/var/tmp/portage/x11-drivers/nvidia-drivers-390.116-r2/work/kernel/nvidia-uvm/uvm8_tools.c:207:13: error: conflicting types for ‘put_user_pages’
  207 | static void put_user_pages(struct page **pages, NvU64 page_count)
      |             ^~~~~~~~~~~~~~
In file included from /var/tmp/portage/x11-drivers/nvidia-drivers-390.116-r2/work/kernel/common/inc/nv-pgprot.h:17,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-390.116-r2/work/kernel/common/inc/nv-linux.h:20,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-390.116-r2/work/kernel/nvidia-uvm/uvm_linux.h:41,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-390.116-r2/work/kernel/nvidia-uvm/uvm_common.h:48,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-390.116-r2/work/kernel/nvidia-uvm/uvm8_tools.c:23:
./include/linux/mm.h:1075:6: note: previous declaration of ‘put_user_pages’ was here
Comment 9 email200202 2019-07-11 11:51:25 UTC
Should I open another bug report for kernel 5.2?
Comment 10 email200202 2019-07-11 12:00:39 UTC
Created attachment 582502 [details]
build.log (kernel 5.2.0)
Comment 11 email200202 2019-07-11 16:05:15 UTC
Created attachment 582506 [details]
patch for kernel 5.2

This is my patch for kernel 5.2.
Comment 12 email200202 2019-07-13 06:37:35 UTC
Created attachment 582698 [details, diff]
Another patch for kernel 5.2

This is a better patch. It forces nvidia driver to use the kernel new function "put_user_pages" instead of its locally defined function with the same name. This patch will work only on 64 bits machines.
Comment 13 Ștefan Talpalaru 2019-08-06 16:15:40 UTC
A patched x11-drivers/nvidia-drivers-390.116-r3 is available in my overlay: https://github.com/stefantalpalaru/gentoo-overlay
Comment 14 Jeroen Roovers (RETIRED) gentoo-dev 2019-08-06 16:50:42 UTC
commit 4af593e8ad9d0aa47bf588e282a7c3e7c43e2c46
Author: Jeroen Roovers <jer@gentoo.org>
Date:   Tue Aug 6 08:20:51 2019 +0200

    x11-drivers/nvidia-drivers: Versions 390.129 418.88 430.40

    Package-Manager: Portage-2.3.69, Repoman-2.3.16
    Signed-off-by: Jeroen Roovers <jer@gentoo.org>