nvidia-367.35 DKMS build errors for a 4.7.0 kernel

I get the following errors when trying the nvidia-367 DKMS build for a 4.7.0 kernel:

CC [M]  /var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-utils.o
/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.c: In function 'nvidia_drm_migrate_modeset_ownership':
/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.c:455:26: error: 'struct drm_minor' has no member named 'master'
         !file_priv->minor->master)
                          ^
/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.c:476:5: error: implicit declaration of function 'drm_master_put' [-Werror=implicit-function-declaration]
     drm_master_put(&file_priv->minor->master);
     ^
/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.c:476:37: error: 'struct drm_minor' has no member named 'master'
     drm_master_put(&file_priv->minor->master);
                                     ^
/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.c: In function 'nvidia_drm_pci_set_busid':
/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.c:493:11: error: dereferencing pointer to incomplete type 'struct drm_master'
     master->unique = nvidia_drm_asprintf("pci:%04x:%02x:%02x.%d",
           ^
/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.c: In function 'nvidia_update_drm_driver_features':
/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.c:655:36: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
     nv_drm_driver.master_drop      = nvidia_drm_master_drop;
                                    ^
cc1: some warnings being treated as errors
scripts/Makefile.build:289: recipe for target '/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.o' failed
make[2]: *** [/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Makefile:1485: recipe for target '_module_/var/lib/dkms/nvidia-367/367.35/build' failed
make[1]: *** [_module_/var/lib/dkms/nvidia-367/367.35/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.7.0-999-generic'
Makefile:81: recipe for target 'modules' failed
make: *** [modules] Error 2

I took at look at the changelog for the last few drm commits and found that the minor/master structure has been reworked I created a quick patch that is working fine for me:

--- nvidia-drm-drv.c.old	2016-08-03 22:02:47.724952581 -0500
+++ nvidia-drm-drv.c	2016-08-03 22:01:17.819374194 -0500
@@ -35,6 +35,7 @@
 
 #include "nvidia-drm-ioctl.h"
 
+#include <drm/drm_auth.h>
 #include <drm/drmP.h>
 
 #include <drm/drm_crtc_helper.h>
@@ -452,7 +453,7 @@
     mutex_lock(&dev->master_mutex);
 
     if (!file_priv->is_master ||
-        !file_priv->minor->master)
+        !file_priv->master)
     {
         goto done;
     }
@@ -473,7 +474,7 @@
      * NVKMS modeset ownership, because nvidia_drm_master_set()'s call to
      * grabOwnership() will fail.
      */
-    drm_master_put(&file_priv->minor->master);
+    drm_master_put(&file_priv->master);
     file_priv->is_master = 0;
 
     ret = 0;

then comes another error:

/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.c: In function ‘nvidia_update_drm_driver_features’:
/var/lib/dkms/nvidia-367/367.35/build/nvidia-drm/nvidia-drm-drv.c:656:36: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
     nv_drm_driver.master_drop      = nvidia_drm_master_drop;
--- nvidia-drm-drv.c.orig	2016-07-12 00:53:45.000000000 -0400
+++ nvidia-drm-drv.c	2016-08-03 20:19:16.536783934 -0400
@@ -36,6 +36,7 @@
 #include "nvidia-drm-ioctl.h"
 
 #include <drm/drmP.h>
+#include <drm/drm_auth.h>
 
 #include <drm/drm_crtc_helper.h>
 
@@ -419,7 +420,7 @@
 
 static
 void nvidia_drm_master_drop(struct drm_device *dev,
-                            struct drm_file *file_priv, bool from_release)
+                            struct drm_file *file_priv)
 {
     struct nvidia_drm_device *nv_dev = dev->dev_private;
     int ret;
@@ -452,7 +453,7 @@
     mutex_lock(&dev->master_mutex);
 
     if (!file_priv->is_master ||
-        !file_priv->minor->master)
+        !file_priv->minor->dev->master)
     {
         goto done;
     }
@@ -473,7 +474,7 @@
      * NVKMS modeset ownership, because nvidia_drm_master_set()'s call to
      * grabOwnership() will fail.
      */
-    drm_master_put(&file_priv->minor->master);
+    drm_master_put(&file_priv->minor->dev->master);
     file_priv->is_master = 0;
 
     ret = 0;
--- nvidia-drm-modeset.c.orig	2016-07-12 00:53:45.000000000 -0400
+++ nvidia-drm-modeset.c	2016-08-03 20:14:18.058238340 -0400
@@ -675,7 +675,7 @@
         goto failed;
     }
 
-    drm_atomic_helper_swap_state(dev, state);
+    drm_atomic_helper_swap_state(state, async);
 
     nvidia_drm_update_head_mode_config(state, requested_config);

thanks
the driver works fine

This patch won’t apply for me in openSUSE Tumbleweed. The patch command does nothing. Is copying and pasting this patch into a text editor enough or do I need a link to download the patch in a separate file? I got a patch from openmafia that was reported to work, and it did patch the driver, but there were still errors when building the driver.

Will there be a patch for NVIDIA-Linux-x86-304.131 on my “legacy” laptop running Model: “nVidia GeForce Go 7400” ??

Newly installed Opensuse Tumbleweed.
Running NVIDIA-Linux-x86-304.131.run

gives compile errors on nv-mlock.o

and NVIDIA-Linux-x86-367.35.run does not support my graphics card.

thanks,

A tail -50 of the nvidia-installer.log:

cc1: some warnings being treated as errors
make[4]: *** [/usr/src/linux-4.7.0-1/scripts/Makefile.build:292: /tmp/selfgz13953/NVIDIA-Linux-x86-304.131/kernel/nv-mlock.o] Error 1
make[3]: *** [/usr/src/linux-4.7.0-1/Makefile:1483: module/tmp/selfgz13953/NVIDIA-Linux-x86-304.131/kernel] Error 2
make[2]: *** [Makefile:150: sub-make] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [Makefile:255: module] Error 1
make: *** [makefile:59: module] Error 2
-> Error.
ERROR: Unable to build the NVIDIA kernel module.
ERROR: Installation has failed. Please see the file ‘/var/log/nvidia-installer.log’ for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

what the hell to do with the ‘nvidia-367.35 DKMS build errors’ (what my topic is the way here) ?

I also have problems when trying to compile 304.131 (32-bit) to make it work with new 4.7 kernel. When can we expect a patch (or maybe driver’s newer release)?

304.131 + kernel 4.7
https://git.archlinux.org/svntogit/packages.git/plain/trunk/linux-4.6.patch?h=packages/nvidia-304xx
340.96 + kernel 4.7
https://git.archlinux.org/svntogit/packages.git/plain/trunk/linux-4.6.patch?h=packages/nvidia-340xx&id=bb665d69eca74f01003cb41112448260a1597dc4
367.35 + kernel 4.7
i686
https://git.archlinux.org/svntogit/packages.git/plain/trunk/0001-linux-4.7-i686.patch?h=packages/nvidia
x86_64
https://git.archlinux.org/svntogit/packages.git/plain/trunk/0001-linux-4.7-x86_64.patch?h=packages/nvidia
370.23 + kernel 4.7
Fixed Linux 4.7 compatibility
370.23 + kernel 4.8
https://devtalk.nvidia.com/default/topic/957804/linux/-patch-370-23-kernel-4-8-0-rc2/

Hello!

I’m trying to compile 367.44 and 370.23 on Fedora 25 with kernel 4.8.0-0.rc4. I’ve applied your patches, but still I can’t make it :(

nvidia-installer.log is here: http://pastebin.com/0fhkH8gL

Also there’s my lspci:

[aslaikov@l ~]$ lspci | grep NVIDIA
02:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)

Hi there,

The same or similar problem, but on the latest STABLE kernel.

  • Fedora 25
  • Stable Kernel 4.8.3

Install options:

nvidia-installer command line:
    ./nvidia-installer
    --accept-license
    --silent
    --no-x-check
    --no-nouveau-check
    --no-recursion
    --opengl-libdir=lib64/nvidia-bumblebee
    --opengl-prefix=/usr
    --x-library-path=lib64/nvidia-bumblebee
    --x-prefix=/usr
    --x-module-path=/usr/lib64/nvidia-bumblebee/xorg/modules
    --compat32-libdir=lib/nvidia-bumblebee
    --compat32-prefix=/usr
    --no-symlink-check
    --no-runtime-check

Errors:

CC [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-drv.o
/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-drv.c: In function ‘nvidia_drm_migrate_modeset_ownership’:
/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-drv.c:455:26: error: ‘struct drm_minor’ has no member named ‘master’
         !file_priv->minor->master)
                          ^~
/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-drv.c:476:5: error: implicit declaration of function ‘drm_master_put’ [-Werror=implicit-function-declaration]
     drm_master_put(&file_priv->minor->master);
     ^~~~~~~~~~~~~~
/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-drv.c:476:37: error: ‘struct drm_minor’ has no member named ‘master’
     drm_master_put(&file_priv->minor->master);
                                     ^~
/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-drv.c: In function ‘nvidia_drm_pci_set_busid’:
/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-drv.c:493:11: error: dereferencing pointer to incomplete type ‘struct drm_master’
     master->unique = nvidia_drm_asprintf("pci:%04x:%02x:%02x.%d",
           ^~
/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-drv.c: In function ‘nvidia_update_drm_driver_features’:
/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-drv.c:655:36: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
     nv_drm_driver.master_drop      = nvidia_drm_master_drop;
                                    ^
cc1: some warnings being treated as errors
/usr/src/kernels/4.8.3-300.fc25.x86_64/scripts/Makefile.build:289: recipe for target '/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-drv.o' failed
make[3]: *** [/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-drv.o] Error 1
  CC [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-utils.o
  CC [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-crtc.o
  CC [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-encoder.o
  CC [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-connector.o
  CC [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-gem.o
  CC [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-fb.o
  CC [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-modeset.o
  CC [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-mmap.o
  CC [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-linux.o
/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-modeset.c: In function ‘nvidia_drm_atomic_commit’:
/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-modeset.c:678:34: error: passing argument 1 of ‘drm_atomic_helper_swap_state’ from incompatible pointer type [-Werror=incompatible-pointer-types]
     drm_atomic_helper_swap_state(dev, state);
                                  ^~~
In file included from /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-modeset.c:37:0:
/usr/src/kernels/4.8.3-300.fc25.x86_64/include/drm/drm_atomic_helper.h:75:6: note: expected ‘struct drm_atomic_state *’ but argument is of type ‘struct drm_device *’
 void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nv-pci-table.o
cc1: some warnings being treated as errors
/usr/src/kernels/4.8.3-300.fc25.x86_64/scripts/Makefile.build:289: recipe for target '/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-modeset.o' failed
make[3]: *** [/tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-drm/nvidia-drm-modeset.o] Error 1
ld -r -o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-interface.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-frontend.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-instance.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-acpi.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-chrdev.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-cray.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-dma.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-gvi.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-i2c.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-mempool.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-mmap.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-p2p.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-pat.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-procfs.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-usermap.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-vm.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-vtophys.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/os-interface.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/os-mlock.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/os-pci.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/os-registry.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/os-usermap.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-modeset-interface.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv-pci-table.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nv_uvm_interface.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nvlink_linux.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/nvlink_pci.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/ebridge_linux.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia/ibmnpu_linux.o
ld -r -o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-modeset/nv-modeset-interface.o /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-modeset/nvidia-modeset-linux.o
  LD [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia.o
  LD [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-uvm.o
  LD [M]  /tmp/NVIDIA-Linux-x86_64-367.44/kernel/nvidia-modeset.o
make[3]: Target '__build' not remade because of errors.
/usr/src/kernels/4.8.3-300.fc25.x86_64/Makefile:1475: recipe for target '_module_/tmp/NVIDIA-Linux-x86_64-367.44/kernel' failed
make[2]: *** [_module_/tmp/NVIDIA-Linux-x86_64-367.44/kernel] Error 2
make[2]: Target 'modules' not remade because of errors.
make[2]: Leaving directory '/usr/src/kernels/4.8.3-300.fc25.x86_64'
Makefile:150: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Target 'modules' not remade because of errors.
make[1]: Leaving directory '/usr/src/kernels/4.8.3-300.fc25.x86_64'
Makefile:81: recipe for target 'modules' failed
make: *** [modules] Error 2
ERROR: The nvidia kernel module was not created.
ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

Any assistance would be greatly appreciated.