For those who would like to immediately begin using Nvidia Driver 340.102 with Linux Kernel 4.11-rcX / 4.11, apply the fully working patch provided here:
Name of the patch file is: “nv_patch_340.102_linux_kernel_4.11”, see direct links or extract from attached “patch.zip” file below
The patch is a cleaned-up combination of 3 individual patches for Linux Kernels 4.9, 4.10, & 4.11
I have fully tested the patch and it works well without any issues
100% FULL CREDIT and MANY THANKS for those original, individual patches go out to: Alberto Milone, Michael Marley, & Robert Hooker
Instructions for Applying Patch [nv_patch_340.102_linux_kernel_4.11] to Nvidia Driver Compiler/Installer 340.102 used with Linux Kernel 4.11 in CLI/Terminal:
Download the following NVIDIA Driver Compiler/Installer file from NVIDIA website for Linux: NVIDIA-Linux-x86_64-340.102.run
Go into CLI/Terminal, and SU into root(#)
Completely Exit Xorg Server: The command “systemctl isolate multi-user.target” usually followed by “CTL+ALT+[F1 to F6]” will do this
In CLI, go into root then provide execution permissions: “chmod 755 NVIDIA-Linux-x86_64-340.102.run”
Copy [cp] Patch File “nv_patch_340.102_linux_kernel_4.11” into “NVIDIA-Linux-x86_64-340.102” directory
Go into [cd] “NVIDIA-Linux-x86_64-340.102” directory where patch file is now located
Apply Patch in that directory: “patch -p0 < nv_patch_340.102_linux_kernel_4.11”
Proceed with NVIDIA Driver Compilation & Installation by running “./nvidia-installer”. Important: Make sure the Nouveau Driver is disabled-blacklisted and modeset set to 0 in /etc/modprobe.d with “blacklist nouveau” & “options nouveau modeset=0”, and the Initial RAM Disk (initrd) is created prior to compiling, installing & rebooting. Enjoy!
Note: You may wish to test out the patch first by executing a Dry-Run with:
“patch --dry-run -p0 < nv_patch_340.102_linux_kernel_4.11”
I tried this and it fails with “ERROR: Unable to load kernel module”
When I tried modprobe myself it said it couldn’t find nvidea_375 I’m guessing that’s the problem since I believe it’s supposed to look for nvidea_340 but I have no idea how to fix this
ERROR: Failed to run `/usr/sbin/dkms build -m nvidia -v 340.102 -k 4.11.0-1-amd64`:
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
make -j2 KERNELRELEASE=4.11.0-1-amd64 module KERNEL_UNAME=4.11.0-1-amd64; make -C uvm module KERNEL_UNAME=4.11.0-1-amd64
KBUILD_EXTMOD=/var/lib/dkms/nvidia/340.102/build/uvm; make -C uvm module KERNEL_UNAME=4.11.0-1-amd64 KBUILD_EXTMOD=/var/lib/dkms/nvidia/340.102/build/uvm; make -C uvm
module KERNEL_UNAME=4.11.0-1-amd64 KBUILD_EXTMOD=/var/lib/dkms/nvidia/340.102/build/uvm...(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.11.0-1-amd64 (x86_64)
Consult /var/lib/dkms/nvidia/340.102/build/make.log for more information.
dkms log (very long and with PL signs)
/var/lib/dkms/nvidia/340.102/build/make.log
DKMS make.log for nvidia-340.102 for kernel 4.11.0-1-amd64 (x86_64)
pon, 10 lip 2017, 11:23:52 CEST
gcc-version-check failed:
The compiler used to compile the kernel (gcc
6.3) does not exactly match the current compiler
(gcc 6.4). The Linux 2.6 kernel module loader
rejects kernel modules built with a version of gcc
that does not exactly match that of the compiler
used to build the running kernel.
If you know what you are doing and want to override
the gcc version check, you can do so by setting the
IGNORE_CC_MISMATCH environment variable to "1".
In any other case, set the CC environment variable
to the name of the compiler that was used to compile
the kernel.
*** Failed CC version check. Bailing out! ***
nvidia-modules-common.mk:201: polecenia dla obiektu 'build-sanity-checks' nie powiodły się
make: *** [build-sanity-checks] Błąd 1
make: Wejście do katalogu '/var/lib/dkms/nvidia/340.102/build/uvm'
cd ./..; make module SYSSRC=/lib/modules/4.11.0-1-amd64/source SYSOUT=/lib/modules/4.11.0-1-amd64/build KBUILD_EXTMOD=./..
make[1]: Wejście do katalogu '/var/lib/dkms/nvidia/340.102/build'
NVIDIA: calling KBUILD...
make[2]: Wejście do katalogu '/usr/src/linux-headers-4.11.0-1-common'
make -C /lib/modules/4.11.0-1-amd64/build KBUILD_SRC=/usr/src/linux-headers-4.11.0-1-common \
-f /usr/src/linux-headers-4.11.0-1-common/Makefile modules
make[3]: Wejście do katalogu '/usr/src/linux-headers-4.11.0-1-amd64'
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 ; \
/bin/false)
mkdir -p ./../.tmp_versions ; rm -f ./../.tmp_versions/*
make -f /usr/src/linux-headers-4.11.0-1-common/scripts/Makefile.build obj=./..
/usr/src/linux-headers-4.11.0-1-common/scripts/Makefile.build:44: /usr/src/linux-headers-4.11.0-1-common/./../Makefile: Nie ma takiego pliku ani katalogu
make[4]: *** Brak reguł do wykonania obiektu '/usr/src/linux-headers-4.11.0-1-common/./../Makefile'. Stop.
/usr/src/linux-headers-4.11.0-1-common/Makefile:1509: polecenia dla obiektu '_module_./..' nie powiodły się
make[3]: *** [_module_./..] Błąd 2
make[3]: Opuszczenie katalogu '/usr/src/linux-headers-4.11.0-1-amd64'
Makefile:152: polecenia dla obiektu 'sub-make' nie powiodły się
make[2]: *** [sub-make] Błąd 2
make[2]: Opuszczenie katalogu '/usr/src/linux-headers-4.11.0-1-common'
NVIDIA: left KBUILD.
nvidia.ko failed to build!
Makefile:185: polecenia dla obiektu 'nvidia.ko' nie powiodły się
make[1]: *** [nvidia.ko] Błąd 1
make[1]: Opuszczenie katalogu '/var/lib/dkms/nvidia/340.102/build'
Makefile:219: polecenia dla obiektu '../Module.symvers' nie powiodły się
make: *** [../Module.symvers] Błąd 2
make: Opuszczenie katalogu '/var/lib/dkms/nvidia/340.102/build/uvm'
make: Wejście do katalogu '/var/lib/dkms/nvidia/340.102/build/uvm'
cd ./..; make module SYSSRC=/lib/modules/4.11.0-1-amd64/source SYSOUT=/lib/modules/4.11.0-1-amd64/build KBUILD_EXTMOD=./..
make[1]: Wejście do katalogu '/var/lib/dkms/nvidia/340.102/build'
NVIDIA: calling KBUILD...
make[2]: Wejście do katalogu '/usr/src/linux-headers-4.11.0-1-common'
make -C /lib/modules/4.11.0-1-amd64/build KBUILD_SRC=/usr/src/linux-headers-4.11.0-1-common \
-f /usr/src/linux-headers-4.11.0-1-common/Makefile modules
make[3]: Wejście do katalogu '/usr/src/linux-headers-4.11.0-1-amd64'
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 ; \
/bin/false)
mkdir -p ./../.tmp_versions ; rm -f ./../.tmp_versions/*
make -f /usr/src/linux-headers-4.11.0-1-common/scripts/Makefile.build obj=./..
/usr/src/linux-headers-4.11.0-1-common/scripts/Makefile.build:44: /usr/src/linux-headers-4.11.0-1-common/./../Makefile: Nie ma takiego pliku ani katalogu
make[4]: *** Brak reguł do wykonania obiektu '/usr/src/linux-headers-4.11.0-1-common/./../Makefile'. Stop.
/usr/src/linux-headers-4.11.0-1-common/Makefile:1509: polecenia dla obiektu '_module_./..' nie powiodły się
make[3]: *** [_module_./..] Błąd 2
make[3]: Opuszczenie katalogu '/usr/src/linux-headers-4.11.0-1-amd64'
Makefile:152: polecenia dla obiektu 'sub-make' nie powiodły się
make[2]: *** [sub-make] Błąd 2
make[2]: Opuszczenie katalogu '/usr/src/linux-headers-4.11.0-1-common'
NVIDIA: left KBUILD.
nvidia.ko failed to build!
Makefile:185: polecenia dla obiektu 'nvidia.ko' nie powiodły się
make[1]: *** [nvidia.ko] Błąd 1
make[1]: Opuszczenie katalogu '/var/lib/dkms/nvidia/340.102/build'
Makefile:219: polecenia dla obiektu '../Module.symvers' nie powiodły się
make: *** [../Module.symvers] Błąd 2
make: Opuszczenie katalogu '/var/lib/dkms/nvidia/340.102/build/uvm'
make: Wejście do katalogu '/var/lib/dkms/nvidia/340.102/build/uvm'
cd ./..; make module SYSSRC=/lib/modules/4.11.0-1-amd64/source SYSOUT=/lib/modules/4.11.0-1-amd64/build KBUILD_EXTMOD=./..
make[1]: Wejście do katalogu '/var/lib/dkms/nvidia/340.102/build'
NVIDIA: calling KBUILD...
make[2]: Wejście do katalogu '/usr/src/linux-headers-4.11.0-1-common'
make -C /lib/modules/4.11.0-1-amd64/build KBUILD_SRC=/usr/src/linux-headers-4.11.0-1-common \
-f /usr/src/linux-headers-4.11.0-1-common/Makefile modules
make[3]: Wejście do katalogu '/usr/src/linux-headers-4.11.0-1-amd64'
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 ; \
/bin/false)
mkdir -p ./../.tmp_versions ; rm -f ./../.tmp_versions/*
make -f /usr/src/linux-headers-4.11.0-1-common/scripts/Makefile.build obj=./..
/usr/src/linux-headers-4.11.0-1-common/scripts/Makefile.build:44: /usr/src/linux-headers-4.11.0-1-common/./../Makefile: Nie ma takiego pliku ani katalogu
make[4]: *** Brak reguł do wykonania obiektu '/usr/src/linux-headers-4.11.0-1-common/./../Makefile'. Stop.
/usr/src/linux-headers-4.11.0-1-common/Makefile:1509: polecenia dla obiektu '_module_./..' nie powiodły się
make[3]: *** [_module_./..] Błąd 2
make[3]: Opuszczenie katalogu '/usr/src/linux-headers-4.11.0-1-amd64'
Makefile:152: polecenia dla obiektu 'sub-make' nie powiodły się
make[2]: *** [sub-make] Błąd 2
make[2]: Opuszczenie katalogu '/usr/src/linux-headers-4.11.0-1-common'
NVIDIA: left KBUILD.
nvidia.ko failed to build!
Makefile:185: polecenia dla obiektu 'nvidia.ko' nie powiodły się
make[1]: *** [nvidia.ko] Błąd 1
make[1]: Opuszczenie katalogu '/var/lib/dkms/nvidia/340.102/build'
Makefile:219: polecenia dla obiektu '../Module.symvers' nie powiodły się
make: *** [../Module.symvers] Błąd 2
make: Opuszczenie katalogu '/var/lib/dkms/nvidia/340.102/build/uvm'
var/log/nvidia-innstaller.log
nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Mon Jul 10 10:58:55 2017
installer version: 340.102
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
nvidia-installer command line:
./nvidia-installer
Unable to load: nvidia-installer ncurses v6 user interface
Using: nvidia-installer ncurses user interface
-> License accepted.
-> Installing NVIDIA driver version 340.102.
-> There appears to already be a driver installed on your system (version: 340.102). As part of installing this driver (version: 340.102), the existing driver will be uninstalled$
-> 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="/usr/bin/cc".
-> The CC version check failed: