diff -Naur nv.orig/conftest.sh nv/conftest.sh --- nv.orig/conftest.sh 2017-10-16 16:21:22.549358000 +0200 +++ nv/conftest.sh 2017-10-16 16:32:49.985089045 +0200 @@ -237,7 +237,11 @@ # Determine if the set_pages_uc() function is present. # echo "$CONFTEST_PREAMBLE - #include + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) + #include + #else + #include + #endif void conftest_set_pages_uc(void) { set_pages_uc(); }" > conftest$$.c @@ -267,8 +271,10 @@ #include #include #include - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) - #include + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) + #include + #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) + #include #endif void conftest_change_page_attr(void) { change_page_attr(); diff -Naur nv.orig/nv-vm.c nv/nv-vm.c --- nv.orig/nv-vm.c 2013-11-27 23:47:09.000000000 +0100 +++ nv/nv-vm.c 2017-10-16 16:35:11.059602958 +0200 @@ -14,6 +14,10 @@ #include "nv-linux.h" #include "nv-vm.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) + #include +#endif + #if defined(NV_DBG_MEM) #define NV_DEFAULT_LIST_PAGE_COUNT 10