304.128 and kernel 4.3 - can compile, but cannot insert it (mtrr symbols-related errors)

Hi! After applying the patch from https://devtalk.nvidia.com/default/topic/877365/linux/355-11-linux-4-3-rc1-build-error/ I was able to make nvidia-installer compile the driver module, but still it cannot be inserted; it complains:

→ Kernel module load error: insmod: ERROR: could not insert module ./kernel/nvidia.ko: Unknown symbol in module
→ Kernel messages:
[…]
nvidia: module license ‘NVIDIA’ taints kernel.
Disabling lock debugging due to kernel taint
nvidia: Unknown symbol mtrr_del (err 0)
nvidia: Unknown symbol mtrr_add (err 0)
ERROR: Installation has failed. […]

Of course I have MTRR enabled in kernel config:

CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y
CONFIG_ARCH_USES_PG_UNCACHED=y
CONFIG_ARCH_RANDOM=y
CONFIG_X86_SMAP=y
CONFIG_X86_INTEL_MPX=y
CONFIG_EFI=y
CONFIG_SECCOMP=y

No idea, what can be wrong, neither even where to look? Nvidia-installer gives no more clues. Anyone is able to help me with this? I managed to compile the driver with kernel 4.0 with no problems whatsoever.

Tried yesterday driver 304.131 - still the same, described above, problem with kernel 4.3. Really no hope for any help here?

I’m not the only one facing this problem:
http://forum.kodi.tv/showthread.php?tid=238393&page=7
https://aur.archlinux.org/packages/nvidia-304xx-ck/

Hi, please see: [url]https://bugs.archlinux.org/task/47092[/url]

Since Kernel 4.3-rc1 both symbols got removed. Nvidia has to adopt to these changes. If you want to cheat that fact you have to patch those symbols back into your kernel.

I think it could be worth modifying the headline to 304.131, so at to make clear to the NVIDIA people that the latest driver does not load with the current kernel.

My nvidia driver also not working. I hope new patch will fix this. I have to use kernel 4.2.6 to get nvidia driver working. 4.2.8 and 4.3.4 are not working.

You might want to try this patch, which removes all references to the kernel’s mtrr code when compiled for kernels >= 4.3.0:

diff -up ./kernel/nv-linux.h.orig ./kernel/nv-linux.h
--- ./kernel/nv-linux.h.orig    2015-08-26 19:38:10.000000000 +0200
+++ ./kernel/nv-linux.h 2016-02-08 19:03:32.348175707 +0100
@@ -254,7 +254,7 @@ RM_STATUS nvos_forward_error_to_cray(str
 #include <linux/seq_file.h>
 #endif

-#if !defined(NV_VMWARE) && defined(CONFIG_MTRR)
+#if !defined(NV_VMWARE) && defined(CONFIG_MTRR) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
 #include <asm/mtrr.h>
 #endif

diff -up ./kernel/os-agp.c.orig ./kernel/os-agp.c
--- ./kernel/os-agp.c.orig      2015-08-26 19:38:10.000000000 +0200
+++ ./kernel/os-agp.c   2016-02-08 19:02:07.298996759 +0100
@@ -117,7 +117,7 @@ RM_STATUS KernInitAGP(

     if (nv_pat_mode == NV_PAT_MODE_DISABLED)
     {
-#ifdef CONFIG_MTRR
+#if defined(CONFIG_MTRR) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
         /*
          * Failure to set a write-combining range on the AGP aperture may
          * be due to the presence of other memory ranges with conflicting
@@ -174,7 +174,7 @@ RM_STATUS KernInitAGP(
     return RM_OK;

 failed:
-#ifdef CONFIG_MTRR
+#if defined(CONFIG_MTRR) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
     if (nv_pat_mode == NV_PAT_MODE_DISABLED)
         mtrr_del(-1, agp_info.aper_base, agp_info.aper_size << 20);
 #endif
@@ -204,7 +204,7 @@ RM_STATUS KernTeardownAGP(

     nvl = NV_GET_NVL_FROM_NV_STATE(nv);

-#ifdef CONFIG_MTRR
+#if defined(CONFIG_MTRR) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
     if (nv_pat_mode == NV_PAT_MODE_DISABLED)
         mtrr_del(-1, nv->agp.address, nv->agp.size);
 #endif
diff -up ./kernel/os-mtrr.c.orig ./kernel/os-mtrr.c
--- ./kernel/os-mtrr.c.orig     2015-08-26 19:38:10.000000000 +0200
+++ ./kernel/os-mtrr.c  2016-02-08 19:02:47.019547296 +0100
@@ -20,7 +20,7 @@ RM_STATUS NV_API_CALL os_set_mem_range(
     NvU32 mode
 )
 {
-#if defined(CONFIG_MTRR)
+#if defined(CONFIG_MTRR) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
     if (mode != NV_MEMORY_WRITECOMBINED)
         return RM_ERROR;

@@ -42,7 +42,7 @@ RM_STATUS NV_API_CALL os_unset_mem_range
     NvU64 size
 )
 {
-#if defined(CONFIG_MTRR)
+#if defined(CONFIG_MTRR) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
     mtrr_del(-1, start, size);
     return RM_OK;
 #endif