Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 693704 - x11-drivers/nvidia-drivers-340.107-r1 patches for recent kernels
Summary: x11-drivers/nvidia-drivers-340.107-r1 patches for recent kernels
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-09-07 21:22 UTC by Reuben Martin
Modified: 2020-06-02 19:15 UTC (History)
3 users (show)

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


Attachments
4.11 Patch (kernel-4.11.patch,1.09 KB, patch)
2019-09-07 21:24 UTC, Reuben Martin
Details | Diff
5.0 Patch (kernel-5.0.patch,1.45 KB, patch)
2019-09-07 21:24 UTC, Reuben Martin
Details | Diff
5.1 Patch (kernel-5.1.patch,1.45 KB, patch)
2019-09-07 21:24 UTC, Reuben Martin
Details | Diff
User Copy Patch (kmem_cache_create_usercopy.patch,1.25 KB, patch)
2019-09-07 21:25 UTC, Reuben Martin
Details | Diff
Procfs Patch (unregister_procfs_on_failure.patch,850 bytes, patch)
2019-09-07 21:26 UTC, Reuben Martin
Details | Diff
Kernel 5.3 build fix (nvidia-linux-5.3.patch,1.90 KB, patch)
2019-09-17 12:44 UTC, Stephen Mollett
Details | Diff
Kernel 5.4 build fix (nvidia-linux-5.4.patch,3.62 KB, patch)
2019-11-30 12:00 UTC, Stephen Mollett
Details | Diff
Slight revision of the 5.4 patch because it would not apply on top of the 5.1 patch without modification (nvidia-linux-5.4-r1.patch,3.67 KB, patch)
2019-12-07 19:00 UTC, Benjamin Réveillé
Details | Diff
First patch to compile against 5.7 (kernel5.7_1.patch,789 bytes, patch)
2020-06-02 19:11 UTC, Benjamin Réveillé
Details | Diff
Second patch to compile against 5.7 (kernel5.7_2-reinstate-legacy-support.patch,3.54 KB, patch)
2020-06-02 19:13 UTC, Benjamin Réveillé
Details | Diff
Patch to compile against 5.6 (kernel5.6.patch,16.41 KB, patch)
2020-06-02 19:15 UTC, Benjamin Réveillé
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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