Patching 5.9 kernel to use Nvidia driver

This message might be premature, but my impression from reading a couple of messages in the opensuse-factory mailing list is that I may have to patch the 5.9 kernel to use it with the nvidia driver:

Jiri Slaby: https://lists.opensuse.org/opensuse-factory/2020-10/msg00093.html
Hans-Peter Jansen: https://lists.opensuse.org/opensuse-factory/2020-10/msg00108.html (linking to https://forums.developer.nvidia.com/t/opencl-not-working-with-kernel-5-9/156941 ).

I installed nvidia ‘the hard way’ on a desktop and laptop. When a new kernel arrives, I reboot to terminal after zypper dup, run sh nvidia.run* to install the driver, mkinitrd and reboot. Quick and easy.

It wouldn’t be hard to add the extra step of applying a patch before running *sh nvidia.run … but I don’t know if I can patch a kernel that way to fix this problem, or even which of the installed kernel files would take the patch. Excluding kernel-firmware files, zypper se -si 'kernel’ says that I have installed:

i+ | kernel-default              | package | 5.8.14-1.2   | x86_64 | Main Repository (OSS)
i+ | kernel-default-devel        | package | 5.8.14-1.2   | x86_64 | Main Repository (OSS)
i+ | kernel-devel                | package | 5.8.14-1.2   | noarch | Main Repository (OSS)
i+ | kernel-macros               | package | 5.8.14-1.2   | noarch | Main Repository (OSS)
i  | kernel-source               | package | 5.8.14-1.2   | noarch | Main Repository (OSS)
i+ | kernel-syms                 | package | 5.8.14-1.2   | x86_64 | Main Repository (OSS)

Any thoughts will be appreciated. If I’d have to patch the source and compile, I’d likely look unhappily at a change to Leap.

I also see from http://rglinuxtech.com/?p=2841 that I could run the installer on an unpatched kernel with the -no-unified-memory option, but this would eliminate CUDA, and I don’t know how this would affect my system otherwise.

Hi
I would just wait it out until 5.9.1 arrives, by then I’m sure there will be plenty of options…

I install the hard way (nvidia, cuda and cudnn). If push comes to shove, just lock the relevant files and kernel. AFAIK uvm has been disabled anyway on the rpm builds?

As I read it, yes, you have to patch the kernel source and recompile. So better wait for 5.9.1 and see what happens if you are not in a hurry :wink:

Hi
Or install the hard way?


cat kernel-5.9-gpl.patch 

diff -Naur kernel/nvidia/nv-frontend.c kernel/nvidia/nv-frontend.c
--- kernel/nvidia/nv-frontend.c    2020-09-29 20:19:44.000000000 -0500
+++ kernel/nvidia/nv-frontend.c    2020-10-16 11:17:30.481499886 -0500
@@ -15,7 +15,7 @@
 #include "nv-frontend.h"
 
 #if defined(MODULE_LICENSE)
-MODULE_LICENSE("NVIDIA");
+MODULE_LICENSE("GPL");
 #endif
 #if defined(MODULE_INFO)
 MODULE_INFO(supported, "external");
diff -Naur kernel/nvidia-modeset/nvidia-modeset-linux.c kernel/nvidia-modeset/nvidia-modeset-linux.c
--- kernel/nvidia-modeset/nvidia-modeset-linux.c    2020-09-29 20:19:44.000000000 -0500
+++ kernel/nvidia-modeset/nvidia-modeset-linux.c    2020-10-16 11:17:01.857885869 -0500
@@ -1551,7 +1551,7 @@
 module_exit(nvkms_exit);
 
 #if defined(MODULE_LICENSE)
-  MODULE_LICENSE("NVIDIA");
+  MODULE_LICENSE("GPL");
 #endif
 #if defined(MODULE_INFO)
   MODULE_INFO(supported, "external");


./NVIDIA-Linux-x86_64-455.28.run --apply-patch kernel-5.9-gpl.patch
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 455.28...
....
patching file kernel/nvidia/nv-frontend.c
patching file kernel/nvidia-modeset/nvidia-modeset-linux.c
Adding files to archive named "NVIDIA-Linux-x86_64-455.28-custom.run"...
./nvidia-application-profiles-455.28-rc
....

./libnvidia-ml.so.455.28

CRC: 2414687691
MD5: babc9fcc3ddae5d61526ba7b133972d8

Self-extractible archive "NVIDIA-Linux-x86_64-455.28-custom.run" successfully created.

Thanks for the replies, Malcolm and OrsoBruno. I’m not in a hurry; I’ll wait.

FWIW: There’s a long thread about this issue on the manjaro forum: https://forum.manjaro.org/t/the-end-of-nvidia-proprietary-drivers-on-linux/15325 .

Edit: Malcolm, thanks for the hard way tip!

Hi
Just a proof on concept… :wink: I’m happy to wait and see…

Just a warning to casual readers: this might be a useful hack for a local install, but distributing the resulting code might not be legal.
I’m not a lawyer, so I cannot elaborate further.

It would seem that adding “Portions copyright by NVIDIA disassembly of NVIDIA code not allowed” to the boot up would solve that problem.
I know that NCR’s MP-RAS had multiple copyright notices in boot up as do HP’s HPUX and IBM’s AIX.

Hi
Like I said, proof of concept :wink: don’t know why they don’t just GPL it all… and offer an enterprise version (for support etc)…

Third parties rights may be involved…

Read an article recently (forgot where published)
ETA on nVidia resolving their patch and licenses based on their information from nVidia was sometime second half November.

Of course, there’s no way to know how accurate that might be, but the impression was that was some kind of info directly from nVidia developers tasked with the problem.

TSU

That is consistent with the following info from Nvidia:

From years of supporting computers - " from nVidia was sometime second half November. "

The sad part is they do not say what year they plan to deliver it to us.