linux-4.4.172 nvidia-340.107 error: too many arguments to function 'get_user_pages'

Can’t compile NVIDIA-Linux-x86_64-340.107 driver for Linux-4.4.172.

In file included from /tmp/bld/NVIDIA-Linux-x86_64-340.107/kernel/os-mlock.c:15:0:
/tmp/bld/NVIDIA-Linux-x86_64-340.107/kernel/nv-linux.h:2100:9: error: too many arguments to function 'get_user_pages'
         get_user_pages(current, current->mm, start, nr_pages, write, force, pages, vmas)
/tmp/bld/NVIDIA-Linux-x86_64-340.107/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 /tmp/bld/NVIDIA-Linux-x86_64-340.107/kernel/nv-linux.h:68:0,
                 from /tmp/bld/NVIDIA-Linux-x86_64-340.107/kernel/os-mlock.c:15:
include/linux/mm.h:1200:6: note: declared here
 long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
scripts/ recipe for target '/tmp/bld/NVIDIA-Linux-x86_64-340.107/kernel/os-mlock.o' failed
make[2]: *** [/tmp/bld/NVIDIA-Linux-x86_64-340.107/kernel/os-mlock.o] Error 1
Makefile:1436: recipe for target '_module_/tmp/bld/NVIDIA-Linux-x86_64-340.107/kernel' failed
make[1]: *** [_module_/tmp/bld/NVIDIA-Linux-x86_64-340.107/kernel] Error 2
make[1]: Leaving directory '/usr/src/linux-4.4.172'
nvidia.ko failed to build!
Makefile:192: recipe for target 'nvidia.ko' failed
make: *** [nvidia.ko] Error 1

The prototype of get_user_pages() was changed by the Linux kernel developers in 4.4.168 and later. You’ll need to update to a newer NVIDIA driver to pick up the corresponding change.


See also