FUN WITH LINUX

Build errors for NVIDIAs 367.35 driver on Linux 4.7-rc7

6 August 2016

I tried to compile nvidia’s 367.35 driver on the newest Linux kernel 4.7-rc7 but I just got a bunch of compiler errors. It seems to be some kind of problem with the radix_tree-empty()-function. I found a patch for this problem here.

diff -ur NVIDIA-Linux-x86_64-367.35/kernel/nvidia-drm/nvidia-drm-fb.c nvidia-367.35_patched/nvidia-drm/nvidia-drm-fb.c
--- NVIDIA-Linux-x86_64-367.35/kernel/nvidia-drm/nvidia-drm-fb.c	2016-08-06 10:30:33.022143864 +0200
+++ nvidia-367.35_patched/nvidia-drm/nvidia-drm-fb.c	2016-08-06 10:29:55.360720220 +0200
@@ -114,7 +114,7 @@
      * We don't support any planar format, pick up first buffer only.
      */
 
- gem = drm_gem_object_lookup(dev, file, cmd->handles[0]);
+ gem = drm_gem_object_lookup(file, cmd->handles[0]);
 
     if (gem == NULL)
     {
diff -ur NVIDIA-Linux-x86_64-367.35/kernel/nvidia-drm/nvidia-drm-gem.c nvidia-367.35_patched/nvidia-drm/nvidia-drm-gem.c
--- NVIDIA-Linux-x86_64-367.35/kernel/nvidia-drm/nvidia-drm-gem.c	2016-08-06 10:30:33.022143864 +0200
+++ nvidia-367.35_patched/nvidia-drm/nvidia-drm-gem.c	2016-08-06 10:29:55.360720220 +0200
@@ -408,7 +408,7 @@
 
     mutex_lock(&dev->struct_mutex);
 
- gem = drm_gem_object_lookup(dev, file, handle);
+ gem = drm_gem_object_lookup(file, handle);
 
     if (gem == NULL)
     {
diff -ur NVIDIA-Linux-x86_64-367.35/kernel/nvidia-uvm/uvm_linux.h nvidia-367.35_patched/nvidia-uvm/uvm_linux.h
--- NVIDIA-Linux-x86_64-367.35/kernel/nvidia-uvm/uvm_linux.h	2016-08-06 10:30:32.722143874 +0200
+++ nvidia-367.35_patched/nvidia-uvm/uvm_linux.h	2016-08-06 10:29:55.360720220 +0200
@@ -554,12 +554,13 @@
     INIT_RADIX_TREE(tree, GFP_NOWAIT);
 }
 
+/*
 static bool radix_tree_empty(struct radix_tree_root *tree)
 {
     void *dummy;
     return radix_tree_gang_lookup(tree, &dummy, 0, 1) == 0;
 }
-
+*/
 
 #if !defined(NV_USLEEP_RANGE_PRESENT)
 static void __sched usleep_range(unsigned long min, unsigned long max)

If I run ./NVIDIA-Linux-x86_64-367.35.run then the source of the kernel-module is placed under /usr/src/nvidia-367.35. The installer also tries to install the kernel-module using dkms. I applied the patch from above like this:

  1. save this patch  to /root/nvidia.patch
  2. cd /usr/src/nvidia-367.35
  3. patch -p1 < /root/nvidia.patch
  4. dkms build nvidia/367.35
  5. dkms install nvidia/367.35
  6. reboot
[ Linux  ]
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 Unported License.

Copyright 2015-present Hoti