A patch is required for the NVIDIA Linux 340.98 driver, as there have been many changes in the Kernel file /include/linux/mm.h from October 8 - 25, 2016. Kernel version is: 4.9.0-rc2 (git-ed99d36).
Link to Linux Kernel history for file mm.h:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/include/linux/mm.h
Relevant NVIDIA log output:
/usr/src/linux-4.9.0-rc2-git-ed99d36/arch/x86/include/asm/uaccess.h: In function ‘copy_from_user’:
/usr/src/linux-4.9.0-rc2-git-ed99d36/arch/x86/include/asm/uaccess.h:691:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (likely(sz < 0 || sz >= n)) {
^
/usr/src/linux-4.9.0-rc2-git-ed99d36/include/linux/compiler.h:167:40: note: in definition of macro ‘likely’
# define likely(x) __builtin_expect(!!(x), 1)
^
/usr/src/linux-4.9.0-rc2-git-ed99d36/arch/x86/include/asm/uaccess.h: In function ‘copy_to_user’:
/usr/src/linux-4.9.0-rc2-git-ed99d36/arch/x86/include/asm/uaccess.h:711:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (likely(sz < 0 || sz >= n)) {
^
/usr/src/linux-4.9.0-rc2-git-ed99d36/include/linux/compiler.h:167:40: note: in definition of macro ‘likely’
# define likely(x) __builtin_expect(!!(x), 1)
^
/home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/os-mlock.c: In function ‘os_lock_user_pages’:
/home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/os-mlock.c:49:48: warning: passing argument 4 of ‘get_user_pages’ makes pointer from integer without a cast [-Wint-conversion]
page_count, write, force, user_pages, NULL);
^~~~~
In file included from /home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/nv-linux.h:68:0,
from /home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/os-mlock.c:15:
/usr/src/linux-4.9.0-rc2-git-ed99d36/include/linux/mm.h:1278:6: note: expected ‘struct page **’ but argument is of type ‘NvBool {aka unsigned char}’
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
/home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/os-mlock.c:49:55: error: passing argument 5 of ‘get_user_pages’ from incompatible pointer type [-Werror=incompatible-pointer-types]
page_count, write, force, user_pages, NULL);
^~~~~~~~~~
In file included from /home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/nv-linux.h:68:0,
from /home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/os-mlock.c:15:
/usr/src/linux-4.9.0-rc2-git-ed99d36/include/linux/mm.h:1278:6: note: expected ‘struct vm_area_struct **’ but argument is of type ‘struct page **’
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
In file included from /home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/os-mlock.c:15:0:
/home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/nv-linux.h:2065:41: error: too many arguments to function ‘get_user_pages’
#define NV_GET_USER_PAGES get_user_pages
^
/home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/os-mlock.c:48:11: note: in expansion of macro ‘NV_GET_USER_PAGES’
ret = NV_GET_USER_PAGES((unsigned long)address,
^~~~~~~~~~~~~~~~~
In file included from /home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/nv-linux.h:68:0,
from /home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/os-mlock.c:15:
/usr/src/linux-4.9.0-rc2-git-ed99d36/include/linux/mm.h:1278:6: note: declared here
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-4.9.0-rc2-git-ed99d36/scripts/Makefile.build:291: /home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel/os-mlock.o] Error 1
make[2]: *** [/usr/src/linux-4.9.0-rc2-git-ed99d36/Makefile:1482: module/home/ejm/unpack2/NVIDIA-Linux-x86_64-340.98/kernel] Error 2
make[2]: Leaving directory ‘/usr/src/linux-4.9.0-rc2-git-ed99d36’
make[1]: *** [Makefile:150: sub-make] Error 2
make[1]: Leaving directory ‘/usr/src/linux-4.9.0-rc2-git-ed99d36’
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make: *** [Makefile:185: nvidia.ko] Error 1
-> 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.
My Linux OS: openSUSE x86-64
Linux Kernel: 4.9.0-rc2 (git-ed99d36)