" issue of NVIDIA Linux Driver 304.135 with kernel 4.9.0-kali3-686-pae"

I’m using kali linux and i have trouble to install NVIDIA-Linux-x86-304.135.run
but with an old version of kernel “4.0.0” the same driver work perfect.

uname -a :

Linux r00t 4.9.0-kali3-686-pae #1 SMP Debian 4.9.18-1kali1 (2017-04-04) i686 GNU/Linux

cat /proc/virsion :

Linux version 4.9.0-kali3-686-pae (devel@kali.org) (gcc version 6.3.0 20170321 (Debian 6.3.0-11) ) #1 SMP Debian 4.9.18-1kali1 (2017-04-04)


nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Fri May  5 02:27:35 2017
installer version: 304.135

PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

nvidia-installer command line:

Unable to load: nvidia-installer ncurses v6 user interface

Using: nvidia-installer ncurses user interface
-> License accepted.
-> Installing NVIDIA driver version 304.135.
-> Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later. (Answer: No)
-> Performing CC sanity check with CC="gcc-6".
-> Performing CC version check with CC="gcc-6".
-> Kernel source path: '/lib/modules/4.9.0-kali3-686-pae/source'
-> Kernel output path: '/lib/modules/4.9.0-kali3-686-pae/build'
-> Performing rivafb check.
-> Performing nvidiafb check.
-> Performing Xen check.
-> Cleaning kernel module build directory.
   executing: 'cd ./kernel; make clean'...
-> Building kernel module:
   executing: 'cd ./kernel; make module SYSSRC=/lib/modules/4.9.0-kali3-686-pae/source SYSOUT=/lib/modules/4.9.0-kali3-686-pae/build'...
   NVIDIA: calling KBUILD...
   make -C /lib/modules/4.9.0-kali3-686-pae/build KBUILD_SRC=/usr/src/linux-headers-4.9.0-kali3-common \
   -f /usr/src/linux-headers-4.9.0-kali3-common/Makefile modules
   test -e include/generated/autoconf.h -a -e include/config/auto.conf || (		\
   echo >&2;							\
   echo >&2 "  ERROR: Kernel configuration is invalid.";		\
   echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
   echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
   echo >&2 ;							\
   mkdir -p /tmp/selfgz1628/NVIDIA-Linux-x86-304.135/kernel/.tmp_versions ; rm -f /tmp/selfgz1628/NVIDIA-Linux-x86-304.135/kernel/.tmp_versions/*
   make -f /usr/src/linux-headers-4.9.0-kali3-common/scripts/Makefile.build obj=/tmp/selfgz1628/NVIDIA-Linux-x86-304.135/kernel
-> done.
-> Kernel module compilation complete.
ERROR: Unable to load the kernel module 'nvidia.ko'.  This happens most frequently when this kernel module was built against the wrong or improperly configured kernel sources, with a version of gcc that differs from the one used to build the target kernel, or if a driver such as rivafb, nvidiafb, or nouveau is present and prevents the NVIDIA kernel module from obtaining ownership of the NVIDIA graphics device(s), or NVIDIA GPU installed in this system is not supported by this NVIDIA Linux graphics driver release.

Please see the log entries 'Kernel module load error' and 'Kernel messages' at the end of the file '/var/log/nvidia-installer.log' for more information.
-> Kernel module load error: insmod: ERROR: could not insert module ./kernel/nvidia.ko: No such device
-> Kernel messages:
[   10.957181] snd_hda_codec_realtek hdaudioC0D0:      Line=0x1a
[   10.970234] input: HDA VIA VT82xx Front Mic as /devices/pci0000:80/0000:80:01.0/sound/card0/input8
[   10.971013] input: HDA VIA VT82xx Rear Mic as /devices/pci0000:80/0000:80:01.0/sound/card0/input9
[   10.971863] input: HDA VIA VT82xx Line as /devices/pci0000:80/0000:80:01.0/sound/card0/input10
[   10.973358] input: HDA VIA VT82xx Line Out as /devices/pci0000:80/0000:80:01.0/sound/card0/input11
[   10.973978] input: HDA VIA VT82xx Front Headphone as /devices/pci0000:80/0000:80:01.0/sound/card0/input12
[   11.502123] Adding 2245628k swap on /dev/sda5.  Priority:-1 extents:1 across:2245628k FS
[   17.967156] Bluetooth: Core ver 2.22
[   17.967193] NET: Registered protocol family 31
[   17.967195] Bluetooth: HCI device and connection manager initialized
[   17.967202] Bluetooth: HCI socket layer initialized
[   17.967207] Bluetooth: L2CAP socket layer initialized
[   17.967219] Bluetooth: SCO socket layer initialized
[   18.741140] Netfilter messages via NETLINK v0.30.
[   20.148305] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   48.545372] fuse init (API version 7.26)
[   61.917679] FAT-fs (sdb2): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[  293.973701] gnome-session-f[1507]: segfault at 0 ip b720592d sp bfa95334 error 4 in libgtk-3.so.0.2200.11[b6f28000+803000]
[  394.226409] [drm] Initialized
[  394.252104] nvidia: loading out-of-tree module taints kernel.
[  394.252116] nvidia: module license 'NVIDIA' taints kernel.
[  394.252118] Disabling lock debugging due to kernel taint
[  394.285312] vgaarb: device changed decodes: PCI:0000:02:00.0,olddecodes=io+mem,decodes=none:owns=io+mem
[  394.285665] Error: Driver 'nvidia' is already registered, aborting...
[  394.285666] NVRM: DRM init failed
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.

nvidia-installer.log (486 KB)

Arch has patches.