Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 693704

Summary: x11-drivers/nvidia-drivers-340.107-r1 patches for recent kernels
Product: Gentoo Linux Reporter: Reuben Martin <reuben.m>
Component: Current packagesAssignee: Jeroen Roovers (RETIRED) <jer>
Status: RESOLVED FIXED    
Severity: normal CC: benjamin.reveille, molletts, pacho
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=703876
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: 4.11 Patch
5.0 Patch
5.1 Patch
User Copy Patch
Procfs Patch
Kernel 5.3 build fix
Kernel 5.4 build fix
Slight revision of the 5.4 patch because it would not apply on top of the 5.1 patch without modification
First patch to compile against 5.7
Second patch to compile against 5.7
Patch to compile against 5.6

Description Reuben Martin 2019-09-07 21:22:13 UTC
My ancient nvidia card requires nvidia-drivers-340* series of legacy drivers. I've been using a collection of patches for it to build with recent kernels.

The patches are sourced from various other distros (mostly Arch), and allow the driver to build and function correctly. I'm currently using them to build the module against a 5.2 kernel.

Please consider including these in the current ebuild.

Reproducible: Always
Comment 1 Reuben Martin 2019-09-07 21:24:08 UTC
Created attachment 589364 [details, diff]
4.11 Patch
Comment 2 Reuben Martin 2019-09-07 21:24:29 UTC
Created attachment 589366 [details, diff]
5.0 Patch
Comment 3 Reuben Martin 2019-09-07 21:24:52 UTC
Created attachment 589368 [details, diff]
5.1 Patch
Comment 4 Reuben Martin 2019-09-07 21:25:52 UTC
Created attachment 589370 [details, diff]
User Copy Patch

Kernel seems to work without this, but barfs all over your dmesg
Comment 5 Reuben Martin 2019-09-07 21:26:33 UTC
Created attachment 589372 [details, diff]
Procfs Patch

Graceful driver crash handling
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2019-09-08 09:15:03 UTC
You forgot to take notice of the warning the ebuild emits to NOT FILE BUG REPORTS about this. However, since we have epatch_user/eapply_user these days, I tend to leave bug reports open so that people can easily find the patches they might want to apply at their own risk.
Comment 7 Silvio 2019-09-09 08:55:20 UTC
Could be my bug:
https://bugs.gentoo.org/693538
related to this bug?
Comment 8 Stephen Mollett 2019-09-17 12:44:37 UTC
Created attachment 590074 [details, diff]
Kernel 5.3 build fix

Supplementary to earlier patches, add it to your user patches for the package. Fixes the errors with smp_call_function() and on_each_cpu().

Derived from Alberto Milone's patch for the Ubuntu DKMS package fixing their 5.3 build bug: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-340/+bug/1837890
Comment 9 Leandro 2019-10-30 13:29:51 UTC
Thank you very much! This worked perfectly!
Comment 10 Leandro 2019-10-30 13:30:33 UTC
Thank you very much! This worked perfectly!
Comment 11 Stephen Mollett 2019-11-30 12:00:36 UTC
Created attachment 597974 [details, diff]
Kernel 5.4 build fix

Another supplementary user patch, to be applied after all previous ones (including the 5.3 build fix).

Once again, derived from Alberto Milone's Ubuntu patch: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-340/+bug/1850824
Comment 12 Benjamin Réveillé 2019-12-07 19:00:48 UTC
Created attachment 598862 [details, diff]
Slight revision of the 5.4 patch because it would not apply on top of the 5.1 patch without modification
Comment 13 Stephen Mollett 2019-12-07 21:49:12 UTC
(In reply to Benjamin Réveillé from comment #12)
> Slight revision of the 5.4 patch because it would not apply on top of the
> 5.1 patch without modification

Hm, I must have used a slightly different patch when I originally installed the driver with 5.1. My mistake.

I shall sync my set of patches with these to ensure future compatibility, assuming the nice folks at Nvidia don't issue an update in the mean time (hint, hint) ;)

Thanks for fixing it!
Comment 14 Shiba 2019-12-23 22:57:18 UTC
340.108 is out, if anyone wants to take a look at how much they fixed.
Comment 15 Pacho Ramos gentoo-dev 2019-12-26 20:02:16 UTC
(In reply to Shiba from comment #14)
> 340.108 is out, if anyone wants to take a look at how much they fixed.

it compiles ok for me without patches and kernel 5.4
Comment 16 Benjamin Réveillé 2019-12-26 23:05:50 UTC
(In reply to Pacho Ramos from comment #15)
> (In reply to Shiba from comment #14)
> > 340.108 is out, if anyone wants to take a look at how much they fixed.
> 
> it compiles ok for me without patches and kernel 5.4

Likewize compiled and installed by just copying nvidia-drivers-340.107-r1.ebuild to nvidia-drivers-340.108.ebuild in local overlay (along with the adequate files from "files") digesting it and emerging it...
Comment 17 Benjamin Réveillé 2020-06-02 19:11:32 UTC
Created attachment 643168 [details, diff]
First patch to compile against 5.7

Here is the first of the 2 extra patches to add (on top of the previous 5.6 one) so as to compile against for 5.7.

They are taken from https://forums.developer.nvidia.com/t/patches-for-340-108-and-5-6-rc-need-help-with-driver-init/111760/12
Comment 18 Benjamin Réveillé 2020-06-02 19:13:46 UTC
Created attachment 643170 [details, diff]
Second patch to compile against 5.7

Here is the second of the 2 extra patches to add (on top of the previous 5.6 one) so as to compile against for 5.7.

They are taken from https://forums.developer.nvidia.com/t/patches-for-340-108-and-5-6-rc-need-help-with-driver-init/111760/12
Comment 19 Benjamin Réveillé 2020-06-02 19:15:53 UTC
Created attachment 643172 [details, diff]
Patch to compile against 5.6

This is the patch to compile against 5.6.

Taken from https://forums.developer.nvidia.com/t/patches-for-340-108-and-5-6-rc-need-help-with-driver-init/111760/12