NVidia driver does not build on Linux v5.5 release candidate kernel

Attempting to build 440.44 on kernel v5.5-rc1, and I encounter this error when I try to compile the nvidia kernel module:

2019/12/12 10:42:25 akmodsbuild: cc -Wp,-MD,/tmp/akmodsbuild.oEW9Rb7x/BUILD/nvidia-kmod-440.44/kmod_build_5.5.0-0.rc1.git1.1.kafsfix.fc31.x86_64/nvidia-drm/.nvidia-drm-drv.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/9/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL_ -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Wno-format-security -Wno-address-of-packed-member -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wimplicit-fallthrough -Wno-unused-const-variable -fno-var-tracking-assignments -g -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -flive-patching=inline-clone -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -fcf-protection=none -Wno-packed-not-aligned -I/tmp/akmodsbuild.oEW9Rb7x/BUILD/nvidia-kmod-440.44/kmod_build_5.5.0-0.rc1.git1.1.kafsfix.fc31.x86_64/common/inc -I/tmp/akmodsbuild.oEW9Rb7x/BUILD/nvidia-kmod-440.44/kmod_build_5.5.0-0.rc1.git1.1.kafsfix.fc31.x86_64 -Wall -MD -Wno-cast-qual -Wno-error -Wno-format-extra-args -D__KERNEL -DMODULE -DNVRM -DNV_VERSION_STRING=“440.44” -Wno-unused-function -Wuninitialized -fno-strict-aliasing -mno-red-zone -mcmodel=kernel -DNV_UVM_ENABLE -Werror=undef -DNV_SPECTRE_V2=0 -I/tmp/akmodsbuild.oEW9Rb7x/BUILD/nvidia-kmod-440.44/_kmod_build_5.5.0-0.rc1.git1.1.kafsfix.fc31.x86_64/nvidia-drm -UDEBUG -U_DEBUG -DNDEBUG -DNV_BUILD_MODULE_INSTANCES=0 -DMODULE -DKBUILD_BASENAME=‘“nvidia_drm_drv”’ -DKBUILD_MODNAME=‘“nvidia_drm”’ -c -o /tmp/akmodsbuild.oEW9Rb7x/BUILD/nvidia-kmod-440.44/_kmod_build_5.5.0-0.rc1.git1.1.kafsfix.fc31.x86_64/nvidia-drm/nvidia-drm-drv.o /tmp/akmodsbuild.oEW9Rb7x/BUILD/nvidia-kmod-440.44/_kmod_build_5.5.0-0.rc1.git1.1.kafsfix.fc31.x86_64/nvidia-drm/nvidia-drm-drv.c
2019/12/12 10:42:25 akmodsbuild: In file included from /tmp/akmodsbuild.oEW9Rb7x/BUILD/nvidia-kmod-440.44/_kmod_build_5.5.0-0.rc1.git1.1.kafsfix.fc31.x86_64/nvidia-drm/nvidia-drm-drv.c:27:
2019/12/12 10:42:25 akmodsbuild: /tmp/akmodsbuild.oEW9Rb7x/BUILD/nvidia-kmod-440.44/_kmod_build_5.5.0-0.rc1.git1.1.kafsfix.fc31.x86_64/nvidia-drm/nvidia-drm-fb.h:30:10: fatal error: drm/drmP.h: No such file or directory
2019/12/12 10:42:25 akmodsbuild: 30 | #include <drm/drmP.h>
2019/12/12 10:42:25 akmodsbuild: | ^~~~~~~~~~~~
2019/12/12 10:42:25 akmodsbuild: compilation terminated.

It appears that drm/drmP.h was removed in this commit: drm: delete drmP.h + drm_os_linux.h · torvalds/linux@4e98f87 · GitHub

It looks like the nvidia-drm-fb.h needs to include the appropriate drm/ headers and remove the reference to drmP.h.

It looks like there are several files that need to be updated, in fact:

$ grep -r drmP.h nvidia-drm
nvidia-drm/nvidia-drm-utils.h:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-drv.c:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-helper.h:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-priv.h:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-os-interface.h:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-prime-fence.h:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-crtc.h:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-connector.h:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-modeset.h:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-fb.h:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-encoder.h:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-helper.c:#include <drm/drmP.h>
nvidia-drm/nvidia-drm-gem.h:#include <drm/drmP.h>

Some of the tests in conftest.sh also needs updating, as does nvidia-drm-connector.c. I’ve made a patch for this.
With the patch applied, it does compile on my end, but please note that I’ve not booted with the driver myself. So use on your own risk.

diff --git a/kernel/common/inc/nv-drm.h b/kernel/common/inc/nv-drm.h
new file mode 100644
index 0000000..07e9f3c
--- /dev/null
+++ b/kernel/common/inc/nv-drm.h
@@ -0,0 +1,36 @@
+#ifndef _NV_DRM_H_
+#define _NV_DRM_H_
+
+#include "conftest.h"
+
+#if defined(NV_DRM_DRMP_H_PRESENT)
+#include <drm/drmP.h>
+#else
+#include <linux/agp_backend.h>
+#include <linux/file.h>
+#include <linux/init.h>
+#include <linux/jiffies.h>
+#include <linux/kernel.h>
+#include <linux/mutex.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+#include <asm/pgalloc.h>
+#include <linux/uaccess.h>
+
+#include <uapi/drm/drm.h>
+#include <uapi/drm/drm_mode.h>
+
+#include <drm/drm_agpsupport.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_drv.h>
+#include <drm/drm_prime.h>
+#include <drm/drm_pci.h>
+#include <drm/drm_ioctl.h>
+#include <drm/drm_sysfs.h>
+#include <drm/drm_vblank.h>
+#include <drm/drm_device.h>
+
+#include <drm/drm_gem.h>
+#endif
+
+#endif
diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index a54e2c0..d04b63a 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -1117,6 +1117,9 @@ compile_test() {
             CODE="
             #if defined(NV_DRM_DRMP_H_PRESENT)
             #include <drm/drmP.h>
+            #else
+            #include <drm/drm_drv.h>
+            #include <drm/drm_prime.h>
             #endif
             #if !defined(CONFIG_DRM) && !defined(CONFIG_DRM_MODULE)
             #error DRM not enabled
@@ -1748,6 +1751,8 @@ compile_test() {
             echo "$CONFTEST_PREAMBLE
             #if defined(NV_DRM_DRMP_H_PRESENT)
             #include <drm/drmP.h>
+            #else
+            #include <drm/drm_drv.h>
             #endif
             #include <drm/drm_atomic.h>
             #if !defined(CONFIG_DRM) && !defined(CONFIG_DRM_MODULE)
@@ -1876,7 +1881,11 @@ compile_test() {
             # attached drivers") in v3.14 (2013-12-11)
             #
             CODE="
+            #if defined(NV_DRM_DRMP_H_PRESENT)
             #include <drm/drmP.h>
+            #else
+            #include <drm/drm_drv.h>
+            #endif
             int conftest_drm_driver_has_legacy_dev_list(void) {
                 return offsetof(struct drm_driver, legacy_dev_list);
             }"
@@ -1900,7 +1909,11 @@ compile_test() {
             #   2017-07-23  e6fc3b68558e4c6d8d160b5daf2511b99afa8814
             #
             CODE="
+            #if defined(NV_DRM_DRMP_H_PRESENT)
             #include <drm/drmP.h>
+            #else
+            #include <drm/drm_crtc.h>
+            #endif
 
             int conftest_drm_crtc_init_with_planes_has_name_arg(void) {
                 return
@@ -1916,7 +1929,11 @@ compile_test() {
             compile_check_conftest "$CODE" "NV_DRM_CRTC_INIT_WITH_PLANES_HAS_NAME_ARG" "" "types"
 
             CODE="
+            #if defined(NV_DRM_DRMP_H_PRESENT)
             #include <drm/drmP.h>
+            #else
+            #include <drm/drm_encoder.h>
+            #endif
 
             int conftest_drm_encoder_init_has_name_arg(void) {
                 return
@@ -1931,7 +1948,11 @@ compile_test() {
             compile_check_conftest "$CODE" "NV_DRM_ENCODER_INIT_HAS_NAME_ARG" "" "types"
 
             echo "$CONFTEST_PREAMBLE
+            #if defined(NV_DRM_DRMP_H_PRESENT)
             #include <drm/drmP.h>
+            #else
+            #include <drm/drm_plane.h>
+            #endif
 
             int conftest_drm_universal_plane_init_has_format_modifiers_arg(void) {
                 return
@@ -1958,7 +1979,11 @@ compile_test() {
                 echo "#undef NV_DRM_UNIVERSAL_PLANE_INIT_HAS_FORMAT_MODIFIERS_ARG" | append_conftest "types"
 
                 echo "$CONFTEST_PREAMBLE
+                #if defined(NV_DRM_DRMP_H_PRESENT)
                 #include <drm/drmP.h>
+                #else
+                #include <drm/drm_plane.h>
+                #endif
 
                 int conftest_drm_universal_plane_init_has_name_arg(void) {
                     return
@@ -3037,7 +3062,9 @@ compile_test() {
             # drm_framebuffer_{get,put}()") in v4.12 (2017-02-28).
             #
             CODE="
+            #if defined(NV_DRM_DRMP_H_PRESENT)
             #include <drm/drmP.h>
+            #endif
             #if defined(NV_DRM_DRM_FRAMEBUFFER_H_PRESENT)
             #include <drm/drm_framebuffer.h>
             #endif
@@ -3056,7 +3083,9 @@ compile_test() {
             # drm_gem_object_{get,put}()") in v4.12 (2017-02-28).
             #
             CODE="
+            #if defined(NV_DRM_DRMP_H_PRESENT)
             #include <drm/drmP.h>
+            #endif
             #if defined(NV_DRM_DRM_GEM_H_PRESENT)
             #include <drm/drm_gem.h>
             #endif
@@ -3075,7 +3104,9 @@ compile_test() {
             # functions") in v4.15 (2017-09-26).
             #
             CODE="
+            #if defined(NV_DRM_DRMP_H_PRESENT)
             #include <drm/drmP.h>
+            #endif
             #if defined(NV_DRM_DRM_DRV_H_PRESENT)
             #include <drm/drm_drv.h>
             #endif
diff --git a/kernel/nvidia-drm/nvidia-drm-connector.c b/kernel/nvidia-drm/nvidia-drm-connector.c
index 1553ebc..f851561 100644
--- a/kernel/nvidia-drm/nvidia-drm-connector.c
+++ b/kernel/nvidia-drm/nvidia-drm-connector.c
@@ -20,6 +20,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <linux/version.h>
+
 #include "nvidia-drm-conftest.h" /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
 
 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
@@ -71,7 +73,11 @@ static enum drm_connector_status __nv_drm_connector_detect_internal(
     struct nv_drm_encoder *nv_detected_encoder = NULL;
 
     struct NvKmsKapiDynamicDisplayParams *pDetectParams = NULL;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
     unsigned int i;
+#else
+    struct drm_encoder *encoder = NULL;
+#endif
 
     BUG_ON(!mutex_is_locked(&dev->mode_config.mutex));
 
@@ -87,11 +93,16 @@ static enum drm_connector_status __nv_drm_connector_detect_internal(
         goto done;
     }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
     for (i = 0;
          i < DRM_CONNECTOR_MAX_ENCODER && detected_encoder == NULL; i++) {
         struct drm_encoder *encoder;
+#else
+    drm_connector_for_each_possible_encoder(connector, encoder) {
+#endif
         struct nv_drm_encoder *nv_encoder;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
         if (connector->encoder_ids[i] == 0) {
             break;
         }
@@ -102,6 +113,7 @@ static enum drm_connector_status __nv_drm_connector_detect_internal(
             BUG_ON(encoder != NULL);
             continue;
         }
+#endif
 
         /*
          * DVI-I connectors can drive both digital and analog
@@ -169,6 +181,8 @@ static enum drm_connector_status __nv_drm_connector_detect_internal(
             }
 
             detected_encoder = encoder;
+
+            break;
         }
     }
 
diff --git a/kernel/nvidia-drm/nvidia-drm-connector.h b/kernel/nvidia-drm/nvidia-drm-connector.h
index f74e22c..099390d 100644
--- a/kernel/nvidia-drm/nvidia-drm-connector.h
+++ b/kernel/nvidia-drm/nvidia-drm-connector.h
@@ -27,7 +27,7 @@
 
 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 
 #include "nvtypes.h"
 #include "nvkms-api-types.h"
diff --git a/kernel/nvidia-drm/nvidia-drm-crtc.h b/kernel/nvidia-drm/nvidia-drm-crtc.h
index 31ef3b5..5de3a51 100644
--- a/kernel/nvidia-drm/nvidia-drm-crtc.h
+++ b/kernel/nvidia-drm/nvidia-drm-crtc.h
@@ -29,7 +29,7 @@
 
 #include "nvidia-drm-helper.h"
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 #include "nvtypes.h"
 #include "nvkms-kapi.h"
 
diff --git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
index a66d3cc..06bf859 100644
--- a/kernel/nvidia-drm/nvidia-drm-drv.c
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c
@@ -39,7 +39,7 @@
 
 #include "nvidia-drm-ioctl.h"
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 
 /*
  * Commit fcd70cd36b9b ("drm: Split out drm_probe_helper.h")
diff --git a/kernel/nvidia-drm/nvidia-drm-encoder.h b/kernel/nvidia-drm/nvidia-drm-encoder.h
index bbaf986..af341a8 100644
--- a/kernel/nvidia-drm/nvidia-drm-encoder.h
+++ b/kernel/nvidia-drm/nvidia-drm-encoder.h
@@ -32,7 +32,7 @@
 #if defined(NV_DRM_DRM_ENCODER_H_PRESENT)
 #include <drm/drm_encoder.h>
 #else
-#include <drm/drmP.h>
+#include "nv-drm.h"
 #endif
 
 #include "nvkms-kapi.h"
diff --git a/kernel/nvidia-drm/nvidia-drm-fb.h b/kernel/nvidia-drm/nvidia-drm-fb.h
index 7f292ce..d13bc4c 100644
--- a/kernel/nvidia-drm/nvidia-drm-fb.h
+++ b/kernel/nvidia-drm/nvidia-drm-fb.h
@@ -27,7 +27,7 @@
 
 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 #include "nvidia-drm-gem-nvkms-memory.h"
 #include "nvkms-kapi.h"
 
diff --git a/kernel/nvidia-drm/nvidia-drm-gem.h b/kernel/nvidia-drm/nvidia-drm-gem.h
index b621969..326f810 100644
--- a/kernel/nvidia-drm/nvidia-drm-gem.h
+++ b/kernel/nvidia-drm/nvidia-drm-gem.h
@@ -29,7 +29,7 @@
 
 #include "nvidia-drm-priv.h"
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 #include "nvkms-kapi.h"
 
 #if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
diff --git a/kernel/nvidia-drm/nvidia-drm-helper.c b/kernel/nvidia-drm/nvidia-drm-helper.c
index da602ac..e5d6daa 100644
--- a/kernel/nvidia-drm/nvidia-drm-helper.c
+++ b/kernel/nvidia-drm/nvidia-drm-helper.c
@@ -31,7 +31,7 @@
 
 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 #if defined(NV_DRM_DRM_ATOMIC_UAPI_H_PRESENT)
 #include <drm/drm_atomic_uapi.h>
 #endif
diff --git a/kernel/nvidia-drm/nvidia-drm-helper.h b/kernel/nvidia-drm/nvidia-drm-helper.h
index 8f050d8..71c4b90 100644
--- a/kernel/nvidia-drm/nvidia-drm-helper.h
+++ b/kernel/nvidia-drm/nvidia-drm-helper.h
@@ -27,7 +27,7 @@
 
 #if defined(NV_DRM_AVAILABLE)
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 
 /*
  * drm_dev_put() is added by commit 9a96f55034e41b4e002b767e9218d55f03bdff7d
diff --git a/kernel/nvidia-drm/nvidia-drm-modeset.h b/kernel/nvidia-drm/nvidia-drm-modeset.h
index 06659c5..e9d7b70 100644
--- a/kernel/nvidia-drm/nvidia-drm-modeset.h
+++ b/kernel/nvidia-drm/nvidia-drm-modeset.h
@@ -27,7 +27,7 @@
 
 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 
 struct drm_atomic_state *nv_drm_atomic_state_alloc(struct drm_device *dev);
 void nv_drm_atomic_state_clear(struct drm_atomic_state *state);
diff --git a/kernel/nvidia-drm/nvidia-drm-os-interface.h b/kernel/nvidia-drm/nvidia-drm-os-interface.h
index f43f851..7f4ff8b 100644
--- a/kernel/nvidia-drm/nvidia-drm-os-interface.h
+++ b/kernel/nvidia-drm/nvidia-drm-os-interface.h
@@ -29,7 +29,7 @@
 
 #if defined(NV_DRM_AVAILABLE)
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 
 /* Set to true when the atomic modeset feature is enabled. */
 extern bool nv_drm_modeset_module_param;
diff --git a/kernel/nvidia-drm/nvidia-drm-prime-fence.h b/kernel/nvidia-drm/nvidia-drm-prime-fence.h
index 20da923..f3cc2b4 100644
--- a/kernel/nvidia-drm/nvidia-drm-prime-fence.h
+++ b/kernel/nvidia-drm/nvidia-drm-prime-fence.h
@@ -27,7 +27,7 @@
 
 #if defined(NV_DRM_AVAILABLE)
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 
 #if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
 
diff --git a/kernel/nvidia-drm/nvidia-drm-priv.h b/kernel/nvidia-drm/nvidia-drm-priv.h
index 9076835..77a95f3 100644
--- a/kernel/nvidia-drm/nvidia-drm-priv.h
+++ b/kernel/nvidia-drm/nvidia-drm-priv.h
@@ -27,7 +27,7 @@
 
 #if defined(NV_DRM_AVAILABLE)
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 
 #if defined(NV_DRM_DRM_GEM_H_PRESENT)
 #include <drm/drm_gem.h>
diff --git a/kernel/nvidia-drm/nvidia-drm-utils.h b/kernel/nvidia-drm/nvidia-drm-utils.h
index 6d24120..95190c4 100644
--- a/kernel/nvidia-drm/nvidia-drm-utils.h
+++ b/kernel/nvidia-drm/nvidia-drm-utils.h
@@ -27,7 +27,7 @@
 
 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
 
-#include <drm/drmP.h>
+#include "nv-drm.h"
 #include "nvkms-kapi.h"
 
 struct NvKmsKapiConnectorInfo*

Thanks @Isaak.Aleksandrov - your patch is confirmed working with a GTX950 and kernel 5.5-rc3.

Downloadable version of the patch is here.

Will this work on the next released driver ?
Is there a download location for this patched driver ?

Yes. No. Maybe. Only Nvidia representatives will know for sure (and they’re unlikely to say). Ideally the next driver release would include support for 5.5-rc (as 340.108 already does) but it’s unusual for Nvidia to ship support for an unreleased/in-development major kernel so we end up patching the crap out of these drivers until the new kernel is released at which point Nvidia ships their official support for the latest kernel.

No. Download the driver, download the patch, then apply the patch to the driver and build the driver. That’s how it works.

@Rawfox

As Milhouse said, there’s no pre-patched .run file – not to my knowledge, at least. However, modifying an existing package for the distribution of your choice would not be impossible, if you’d rather not manually install the driver.
If, for example, you’re running Arch, then try this: NVIDIA DKMS - PKGBUILD ($1925454) · Snippets · Snippets · GitLab However, if you’re running some other distribution, then you’d have to find someone else to help you. Sorry.

The basic procedure for patching is:

$ wget http://us.download.nvidia.com/XFree86/Linux-x86_64/440.44/NVIDIA-Linux-x86_64-440.44.run
$ wget -O kernel-5.5.patch https://gitlab.com/snippets/1923197/raw
$ sh NVIDIA-Linux-x86_64-440.44.run -x
$ cd NVIDIA-Linux-x86_64-440.44
$ patch -p1 -i ../kernel-5.5.patch

Please excuse any mistakes in either the sample PKGBUILD, or snippet above, I’m quite tired at the moment.

Ok, thanks for the info.

Ah nice, aint looks too hard :)
So its just extract → patch → install ?
Im on Fedora and this gfx-driver stuff is voodoo magic to me.
I usually install the vulkan beta driver manually, booting into runlevel 3 and install it as root.
Now that Kernel-5.5 popped in our official repo and supports fsync(), im eager to use it with wine applications, especially StarCitizen, what is still in heavy development.

Ill just try it, thanks you !

For the patch to work for me, I had to add this line to .manifest file in Nvidia driver root folder.

kernel/common/inc/nv-drm.h 00644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman

Otherwise it would throw an error about nv-drm.h file not found.

Thank you for the feedback. I’m guessing you ran via the nvidia-installer binary, and that it uses the .manifest for the install process.

My GitLab snippet has been updated: NVIDIA 440.44 - Kernel 5.5-rc1 Patch ($1923197) · Snippets · GitLab

Yes, I extracted .run file, patched the files, and run nvidia-installer.sh.

@milos_sd

thx for the snippet!

fyi, running kernel

uname -rm
		5.5.0-24.g3f183bf-default x86_64

with a locally-built, patched 440.44, boot log reports a non-fatal:

[   39.758998] ------------[ cut here ]------------
	[   39.759000] refcount_t: underflow; use-after-free.
	[   39.759013] WARNING: CPU: 15 PID: 3205 at lib/refcount.c:28 refcount_warn_saturate+0xa6/0xf0
	[   39.759014] Modules linked in: nvidia_uvm(OE) cachefiles fscache iscsi_ibft iscsi_boot_sysfs dmi_sysfs bluetooth ecdh_generic ecc vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) squashfs loop sch_fq_codel edac_mce_amd i2c_dev kvm_amd kvm uvcvideo irqbypass videobuf2_vmalloc videobuf2_memops nvidia_drm(POE) nvidia_modeset(POE) videobuf2_v4l2 videobuf2_common crct10dif_pclmul videodev eeepc_wmi nvidia(POE) crc32_pclmul asus_wmi ghash_clmulni_intel battery drm_kms_helper sparse_keymap aesni_intel sp5100_tco rfkill crypto_simd cryptd video mxm_wmi glue_helper wmi_bmof drm i2c_piix4 pcspkr ipmi_devintf snd_hda_codec_realtek ccp ipmi_msghandler fb_sys_fops syscopyarea sysfillrect sysimgblt acpi_cpufreq button raid10 md_mod hid_generic usbhid crc32c_intel mvsas libsas r8169 xhci_pci scsi_transport_sas igb sr_mod realtek cdrom xhci_hcd libphy i2c_algo_bit dca tcp_bbr wmi pinctrl_amd snd_usb_audio snd_usbmidi_lib mc snd_rawmidi snd_seq_device usbcore snd_hda_intel snd_intel_dspcfg snd_hda_codec_via
	[   39.759048]  snd_hda_codec_hdmi snd_hda_codec_generic ledtrig_audio snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer snd soundcore sg sunrpc dm_mirror dm_region_hash dm_log nct6775 hwmon_vid k10temp msr nbd dm_multipath dm_mod scsi_dh_rdac scsi_dh_emc scsi_dh_alua efivarfs
	[   39.759060] CPU: 15 PID: 3205 Comm: X Tainted: P           OE     5.5.0-24.g3f183bf-default #1 openSUSE Tumbleweed (unreleased)
	[   39.759061] Hardware name: System manufacturer System Product Name/PRIME X570-PRO, BIOS 1405 11/19/2019
	[   39.759063] RIP: 0010:refcount_warn_saturate+0xa6/0xf0
	[   39.759064] Code: 05 42 86 05 01 01 e8 cb 13 bb ff 0f 0b c3 80 3d 30 86 05 01 00 75 95 48 c7 c7 38 cd 92 a6 c6 05 20 86 05 01 01 e8 ac 13 bb ff <0f> 0b c3 80 3d 0f 86 05 01 00 0f 85 72 ff ff ff 48 c7 c7 90 cd 92
	[   39.759065] RSP: 0018:ffffb24b028cfd88 EFLAGS: 00010282
	[   39.759066] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000007
	[   39.759067] RDX: 0000000000000007 RSI: 0000000000000092 RDI: ffff9e971cddbdd0
	[   39.759068] RBP: ffff9e970dfb04e8 R08: 00000000000006d5 R09: 0000000000000003
	[   39.759069] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9e88477fa2e8
	[   39.759069] R13: ffff9e88477fa000 R14: 0000000000000004 R15: 0000000000000000
	[   39.759071] FS:  00007fb88e6c0ec0(0000) GS:ffff9e971cdc0000(0000) knlGS:0000000000000000
	[   39.759072] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
	[   39.759072] CR2: 00007fb88c034ef0 CR3: 0000000f94802000 CR4: 0000000000340ee0
	[   39.759073] Call Trace:
	[   39.759079]  nv_drm_atomic_helper_disable_all+0xec/0x290 [nvidia_drm]
	[   39.759083]  nv_drm_master_drop+0x22/0x60 [nvidia_drm]
	[   39.759095]  drm_drop_master+0x1e/0x30 [drm]
	[   39.759106]  drm_master_release+0x9f/0xb0 [drm]
	[   39.759117]  drm_file_free.part.0+0x1fe/0x260 [drm]
	[   39.759128]  drm_release+0x9a/0xd0 [drm]
	[   39.759130]  __fput+0xc1/0x250
	[   39.759133]  task_work_run+0xa1/0xc0
	[   39.759136]  exit_to_usermode_loop+0x10c/0x130
	[   39.759138]  do_syscall_64+0x1fa/0x240
	[   39.759141]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
	[   39.759143] RIP: 0033:0x7fb88c330f24
	[   39.759144] Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 80 00 00 00 00 8b 05 ca c4 20 00 48 63 ff 85 c0 75 13 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 44 f3 c3 66 90 48 83 ec 18 48 89 7c 24 08 e8
	[   39.759145] RSP: 002b:00007fffa44faec8 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
	[   39.759146] RAX: 0000000000000000 RBX: 000000000000000a RCX: 00007fb88c330f24
	[   39.759147] RDX: 00005555ef497020 RSI: 0000000000000002 RDI: 000000000000000a
	[   39.759147] RBP: 00005555ef4dca70 R08: 00005555ef4e5050 R09: 00007fb88c0a0470
	[   39.759148] R10: 0000000000000079 R11: 0000000000000246 R12: 00005555ef4f4850
	[   39.759149] R13: 00005555ef4f4720 R14: 0000000000000000 R15: 0000000000000000
	[   39.759150] ---[ end trace 8ebc4d26ae9fdb69 ]---

afaict – so far – there are no noticeable effects on a simple KDE desktop. have not done any heavier testing … yet

EDIT:

apparently a known/ongoing issue,

NVIDIA – Beta Driver 440.48.02 – Compiles OK with Kernel 5.5…
http://rglinuxtech.com/?p=2673

Yeah, I’ve seen RG and others mention the underflow warning, even with the latest (440.48.02) Vulkan beta driver. It’s likely something else that causes it, as I have yet to see the same warning show, even once, on my 5.5 & 440.44 rig – despite running for a considerate time. Although, that said, I am running a custom kernel, but nothing that should, somehow, stop the underflow from happening.

The issue likely gets triggered due to kernel configuration differences, or some kind of bug with X.org, or the like.

The issue likely gets triggered due to kernel configuration differences

for ref, here’s my current kernnel’s config:

https://paste.opensuse.org/0780952e

Hi! A have same problem with

LINUX X64 (AMD64/EM64T) DISPLAY DRIVER
440.44
2019.12.11
Linux 64-bit

please say me what I mast send you for more details this problem?

If anyone else is following the upstream kernel changes, the 5.6rc have even more changes that break the nvidia driver.

“Linux v5.5 release candidate kernel” means a pre version?

I have exactly the same problem with mainline kernel 5.5 and Geforce driver 440.44 (Geforce 1050Ti) with Linux 64-bit (openSUSE Leap 15.1).

Is there a solution (a new driver version) coming?

You can basically interpret “release candidate” as pre-version/beta/etc, yes. As for a new version, well, there’s the 440.48.02 Vulkan beta driver. That version has native support for 5.5, and PRIME Sync for >= 5.4. However, as far as I can see, openSUSE doesn’t have 440.48.02 in their repo – still, check just in case.

If 440.48.02 isn’t available, you could manually install the Vulkan beta, and/or (if there’s not an open issue already) report it to openSUSE.

https://bugzilla.opensuse.org/

Thanks I’ve looked for a new beta on Nvidia download site but couldn’t find any.

Just now I found with language selection “other” a new version 440.59 3.2.2020.
I will try it and report the result …

Correction now it is available in german too and it is described with: “… his support requires Linux kernel version 5.5 or newer.” So looks like the new version I asked for now is ready …