Is this patch for 415.18 on kernel 4.20.rcX?

Hi,

I found tha patch for 415.18 on kernel 4.20.rc3 at

http://rglinuxtech.com/?p=2440

Applied it 415.18 driver, but I got the error;

[…]
In file included from /tmp/selfgz5096/NVIDIA-Linux-x86_64-415.18-custom/kernel/common/inc/nv-linux.h:334,
from /tmp/selfgz5096/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/os-interface.c:15:
/usr/src/linux-4.20.0-rc3-1.1/include/linux/ipmi.h:166:44: note: expected ‘struct ipmi_user *’ but argument is of type ‘int’
int ipmi_request_settime(struct ipmi_user *user,
~~~~~~~~~~~~~~~~^~
CC [M] /tmp/selfgz5096/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/os-usermap.o
CC [M] /tmp/selfgz5096/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/nv-modeset-interface.o
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-4.20.0-rc3-1.1/scripts/Makefile.build:294: /tmp/selfgz5096/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/os-interface.o] Error 1
[…]In file included from /tmp/selfgz5096/NVIDIA-Linux-x86_64-415.18-custom/kernel/common/inc/nv-linux.h:334,
from /tmp/selfgz5096/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/os-interface.c:15:
/usr/src/linux-4.20.0-rc3-1.1/include/linux/ipmi.h:166:44: note: expected ‘struct ipmi_user *’ but argument is of type ‘int’
int ipmi_request_settime(struct ipmi_user *user,
~~~~~~~~~~~~~~~~^~
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-4.20.0-rc3-1.1/scripts/Makefile.build:294: /tmp/selfgz5096/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/os-interface.o] Error 1
make[3]: Target ‘__build’ not remade because of errors.
make[2]: *** [/usr/src/linux-4.20.0-rc3-1.1/Makefile:1580: module/tmp/selfgz5096/NVIDIA-Linux-x86_64-415.18-custom/kernel] Error 2
make[2]: Target ‘modules’ not remade because of errors.
make[2]: Leaving directory ‘/usr/src/linux-4.20.0-rc3-1.1-obj/x86_64/default’
make[1]: *** [Makefile:152: sub-make] Error 2
make[1]: Target ‘modules’ not remade because of errors.
make[1]: Leaving directory ‘/usr/src/linux-4.20.0-rc3-1.1’
make: *** [Makefile:79: modules] Error 2
ERROR: The nvidia kernel module was not created.
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.

What’s wrong with me, I wonder.

Could someone inform me of this failure?

Thanks

If you have the ipmi module enabled or ipmi statically built into the kernel, they changed the internal structures a while back, but it looks like nvidia never updated their code.

--- a/nvidia/os-interface.c	2018-11-15 21:56:59.000000000 -0600
+++ b/nvidia/os-interface.c	2018-11-26 21:53:39.970635906 -0600
@@ -1670,7 +1670,7 @@
 
 struct nv_ipmi_softc
 {
-    ipmi_user_t         p_user;     // ptr to ipmi_msghandler user structure
+    struct ipmi_user    *p_user;
     spinlock_t          msg_lock;
     struct list_head    msgs;
     NvU32               seqNum;     //request sequence number
@@ -1679,7 +1679,7 @@
 static inline int
 nv_ipmi_set_my_address
 (
-    ipmi_user_t     user,
+    struct ipmi_user *user,
     unsigned char   address
 )
 {

The above patch should do it.

-J

Thank you for reply.

I applied this patch, then tried to install. But, it failed as follows;

[…]
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-encoder.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-connector.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-gem.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-fb.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-modeset.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-prime-fence.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-linux.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-helper.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nv-pci-table.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-gem-user-memory.o
ld -r -o /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-modeset/nv-modeset-interface.o /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-modeset/nvidia-modeset-linux.o
LD [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-uvm.o
LD [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-modeset.o
/tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c: In function ‘__nv_drm_vma_fault’:
/tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c:348:5: error: implicit declaration of function ‘vm_insert_pfn’ [-Werror=implicit-function-declaration]
ret = vm_insert_pfn(vma, address, pfn + page_offset);
^
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-4.20.0-rc3-2.1/scripts/Makefile.build:294: /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.o] Error 1
make[3]: Target ‘__build’ not remade because of errors.
make[2]: *** [/usr/src/linux-4.20.0-rc3-2.1/Makefile:1580: module/tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel] Error 2
make[2]: Target ‘modules’ not remade because of errors.
make[2]: Leaving directory ‘/usr/src/linux-4.20.0-rc3-2.1-obj/x86_64/default’
make[1]: *** [Makefile:152: sub-make] Error 2
make[1]: Target ‘modules’ not remade because of errors.
make[1]: Leaving directory ‘/usr/src/linux-4.20.0-rc3-2.1’
make: *** [Makefile:79: modules] Error 2
-> Checking to see whether the nvidia kernel module was successfully built
executing: ‘cd ./kernel; /usr/bin/make -k -j8 NV_KERNEL_MODULES=“nvidia” NV_EXCLUDE_KERNEL_MODULES="" SYSSRC="/lib/modules/4.20.0-rc3-2.1-default/source" SYSOUT="/lib/modules/4.20.0-rc3-2.1-default/build"’…
make[1]: Entering directory ‘/usr/src/linux-4.20.0-rc3-2.1’
make[2]: Entering directory ‘/usr/src/linux-4.20.0-rc3-2.1-obj/x86_64/default’
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/nv-pci-table.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/linux_nvswitch.o
/tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/linux_nvswitch.c: In function ‘nvswitch_os_snprintf_time’:
/tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/linux_nvswitch.c:1585:5: error: implicit declaration of function ‘time_to_tm’ [-Werror=implicit-function-declaration]
time_to_tm(time_nsec / NVSWITCH_NSEC_PER_SEC, 0, &t);
^
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-4.20.0-rc3-2.1/scripts/Makefile.build:294: /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/linux_nvswitch.o] Error 1
make[3]: Target ‘__build’ not remade because of errors.
make[2]: *** [/usr/src/linux-4.20.0-rc3-2.1/Makefile:1580: module/tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel] Error 2
make[2]: Target ‘modules’ not remade because of errors.
make[2]: Leaving directory ‘/usr/src/linux-4.20.0-rc3-2.1-obj/x86_64/default’
make[1]: *** [Makefile:152: sub-make] Error 2
make[1]: Target ‘modules’ not remade because of errors.
make[1]: Leaving directory ‘/usr/src/linux-4.20.0-rc3-2.1’
make: *** [Makefile:79: modules] Error 2
-> Error.
ERROR: An error occurred while performing the step: “Checking to see whether the nvidia kernel module was successfully built”. See /var/log/nvidia-installer.log for details.
-> The command cd ./kernel; /usr/bin/make -k -j8 NV_KERNEL_MODULES="nvidia" NV_EXCLUDE_KERNEL_MODULES="" SYSSRC="/lib/modules/4.20.0-rc3-2.1-default/source" SYSOUT="/lib/modules/4.20.0-rc3-2.1-default/build" failed with the following output:

make[1]: Entering directory ‘/usr/src/linux-4.20.0-rc3-2.1’
make[2]: Entering directory ‘/usr/src/linux-4.20.0-rc3-2.1-obj/x86_64/default’
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/nv-pci-table.o
CC [M] /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/linux_nvswitch.o
/tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/linux_nvswitch.c: In function ‘nvswitch_os_snprintf_time’:
/tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/linux_nvswitch.c:1585:5: error: implicit declaration of function ‘time_to_tm’ [-Werror=implicit-function-declaration]
time_to_tm(time_nsec / NVSWITCH_NSEC_PER_SEC, 0, &t);
^
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-4.20.0-rc3-2.1/scripts/Makefile.build:294: /tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel/nvidia/linux_nvswitch.o] Error 1
make[3]: Target ‘__build’ not remade because of errors.
make[2]: *** [/usr/src/linux-4.20.0-rc3-2.1/Makefile:1580: module/tmp/selfgz9361/NVIDIA-Linux-x86_64-415.18-custom/kernel] Error 2
make[2]: Target ‘modules’ not remade because of errors.
make[2]: Leaving directory ‘/usr/src/linux-4.20.0-rc3-2.1-obj/x86_64/default’
make[1]: *** [Makefile:152: sub-make] Error 2
make[1]: Target ‘modules’ not remade because of errors.
make[1]: Leaving directory ‘/usr/src/linux-4.20.0-rc3-2.1’
make: *** [Makefile:79: modules] Error 2
ERROR: The nvidia kernel module was not created.
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.

I made the patch file, again, annd applied.

It works fine for me!

Here is the patch for my environment.

diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index e8de161…04d6683 100755
— kernel/conftest.sh
+++ kernel/conftest.sh
@@ -1780,11 +1780,14 @@ compile_test() {
# Determine if atomic64_t and associated functions are defined
CODE="
#include <asm/atomic.h>

  •        #include <linux/version.h>
           void conftest_atomic64(void) {
               atomic64_t data;
               atomic64_read(&data);
               atomic64_set(&data, 0);
    

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
atomic64_inc(&data);
+#endif
}"

         compile_check_conftest "$CODE" "NV_ATOMIC64_PRESENT" "" "types"

diff --git a/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
index 1db7777…863bb77 100644
— kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
+++ kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
@@ -20,6 +20,8 @@

  • DEALINGS IN THE SOFTWARE.
    */

+#include <linux/version.h>
+
#include “nvidia-drm-conftest.h”

#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
@@ -345,7 +347,11 @@ static int __nv_drm_vma_fault(struct vm_area_struct *vma,

 page_offset = vmf->pgoff - drm_vma_node_start(&gem->vma_node);

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
ret = vm_insert_pfn(vma, address, pfn + page_offset);
+#else

  • ret = vmf_insert_pfn(vma, address, pfn + page_offset);
    +#endif

    switch (ret) {
    case 0:
    diff --git a/kernel/nvidia/linux_nvswitch.c b/kernel/nvidia/linux_nvswitch.c
    index 75b5598…9841775 100644
    — kernel/nvidia/linux_nvswitch.c
    +++ kernel/nvidia/linux_nvswitch.c
    @@ -1582,7 +1582,11 @@ nvswitch_os_snprintf_time
    struct tm t;
    NvS32 date_end;

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
time_to_tm(time_nsec / NVSWITCH_NSEC_PER_SEC, 0, &t);
+#else

  • time64_to_tm(time_nsec / NVSWITCH_NSEC_PER_SEC, 0, &t);
    +#endif

    date_end = snprintf(date,
    date_len,
    — kernel/nvidia/os-interface.c 2018-11-15 21:56:59.000000000 -0600
    +++ kernel/nvidia/os-interface.c 2018-11-26 21:53:39.970635906 -0600
    @@ -1670,7 +1670,7 @@

struct nv_ipmi_softc
{

  • ipmi_user_t p_user; // ptr to ipmi_msghandler user structure
  • struct ipmi_user *p_user;
    spinlock_t msg_lock;
    struct list_head msgs;
    NvU32 seqNum; //request sequence number
    @@ -1679,7 +1679,7 @@
    static inline int
    nv_ipmi_set_my_address
    (
  • ipmi_user_t user,
  • struct ipmi_user *user,
    unsigned char address
    )
    {

Thanks,

Hello,

Having the same issue, I would like to apply your patch.
However, I don’t understand which files you have to modify in order to make it works.
Could you specify them ?

Many thanks !

Regards,

Ok, got the trick ! But have this :
patching file kernel/conftest.sh
patch: **** malformed patch at line 7: CODE="

could you help ?
Thanks !

Download the attached file, and pu it on /tmp.

Then execude asa follows;

$sh ./NVIDIA-Linux-x86_64-415.18.run --apply-patch /tmp/4.20.patch

This will make VIDIA-Linux-x86_64-415.18-cutom.run.
Them install by this file.

Thank you nomiya for your answer :)

However, I have the following issue :

sh NVIDIA-Linux-x86_64-415.18.run --apply-patch Patch2 
[sudo] Mot de passe de juice : 
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 415.18.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
patching file kernel/conftest.sh
/usr/bin/patch: **** malformed patch at line 7: CODE="+#include <linux/version.h>

Failed to apply patch file "/home/juice/Téléchargements/Patch2".

Something wrong in the code :/ As I’m not confiant with C langage, maybe something is missing in the syntax ? I’ve just past code.

Thanks again !

Ok, forget, it seems to be an indentation problem, I will check my entire syntax.
Many thanks again !

Sorry.

How about this;

diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index e8de161…04d6683 100755
— kernel/conftest.sh
+++ kernel/conftest.sh
@@ -1780,11 +1780,14 @@ compile_test() {
# Determine if atomic64_t and associated functions are defined
CODE="
#include <asm/atomic.h>

  •        #include <linux/version.h>
           void conftest_atomic64(void) {
               atomic64_t data;
               atomic64_read(&data);
               atomic64_set(&data, 0);
    

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
atomic64_inc(&data);
+#endif
}"

         compile_check_conftest "$CODE" "NV_ATOMIC64_PRESENT" "" "types"

diff --git a/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
index 1db7777…863bb77 100644
— kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
+++ kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
@@ -20,6 +20,8 @@

  • DEALINGS IN THE SOFTWARE.
    */

+#include <linux/version.h>
+
#include “nvidia-drm-conftest.h”

#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
@@ -345,7 +347,11 @@ static int __nv_drm_vma_fault(struct vm_area_struct *vma,

 page_offset = vmf->pgoff - drm_vma_node_start(&gem->vma_node);

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
ret = vm_insert_pfn(vma, address, pfn + page_offset);
+#else

  • ret = vmf_insert_pfn(vma, address, pfn + page_offset);
    +#endif

    switch (ret) {
    case 0:
    diff --git a/kernel/nvidia/linux_nvswitch.c b/kernel/nvidia/linux_nvswitch.c
    index 75b5598…9841775 100644
    — kernel/nvidia/linux_nvswitch.c
    +++ kernel/nvidia/linux_nvswitch.c
    @@ -1582,7 +1582,11 @@ nvswitch_os_snprintf_time
    struct tm t;
    NvS32 date_end;

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
time_to_tm(time_nsec / NVSWITCH_NSEC_PER_SEC, 0, &t);
+#else

  • time64_to_tm(time_nsec / NVSWITCH_NSEC_PER_SEC, 0, &t);
    +#endif

    date_end = snprintf(date,
    date_len,
    — kernel/nvidia/os-interface.c 2018-11-15 21:56:59.000000000 -0600
    +++ kernel/nvidia/os-interface.c 2018-11-26 21:53:39.970635906 -0600
    @@ -1670,7 +1670,7 @@

struct nv_ipmi_softc
{

  • ipmi_user_t p_user; // ptr to ipmi_msghandler user structure
  • struct ipmi_user *p_user;
    spinlock_t msg_lock;
    struct list_head msgs;
    NvU32 seqNum; //request sequence number
    @@ -1679,7 +1679,7 @@
    static inline int
    nv_ipmi_set_my_address
    (
  • ipmi_user_t user,
  • struct ipmi_user *user,
    unsigned char address
    )
    {

Oops.

I try again.

diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index e8de161…04d6683 100755
— kernel/conftest.sh
+++ kernel/conftest.sh
@@ -1780,11 +1780,14 @@ compile_test() {
# Determine if atomic64_t and associated functions are defined
CODE="
#include <asm/atomic.h>

  •        #include <linux/version.h>
           void conftest_atomic64(void) {
               atomic64_t data;
               atomic64_read(&data);
               atomic64_set(&data, 0);
    

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
atomic64_inc(&data);
+#endif
}"

         compile_check_conftest "$CODE" "NV_ATOMIC64_PRESENT" "" "types"

diff --git a/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
index 1db7777…863bb77 100644
— kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
+++ kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
@@ -20,6 +20,8 @@

  • DEALINGS IN THE SOFTWARE.
    */

+#include <linux/version.h>
+
#include “nvidia-drm-conftest.h”

#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
@@ -345,7 +347,11 @@ static int __nv_drm_vma_fault(struct vm_area_struct *vma,

 page_offset = vmf->pgoff - drm_vma_node_start(&gem->vma_node);

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
ret = vm_insert_pfn(vma, address, pfn + page_offset);
+#else

  • ret = vmf_insert_pfn(vma, address, pfn + page_offset);
    +#endif

    switch (ret) {
    case 0:
    diff --git a/kernel/nvidia/linux_nvswitch.c b/kernel/nvidia/linux_nvswitch.c
    index 75b5598…9841775 100644
    — kernel/nvidia/linux_nvswitch.c
    +++ kernel/nvidia/linux_nvswitch.c
    @@ -1582,7 +1582,11 @@ nvswitch_os_snprintf_time
    struct tm t;
    NvS32 date_end;

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
time_to_tm(time_nsec / NVSWITCH_NSEC_PER_SEC, 0, &t);
+#else

  • time64_to_tm(time_nsec / NVSWITCH_NSEC_PER_SEC, 0, &t);
    +#endif

    date_end = snprintf(date,
    date_len,
    — kernel/nvidia/os-interface.c 2018-11-15 21:56:59.000000000 -0600
    +++ kernel/nvidia/os-interface.c 2018-11-26 21:53:39.970635906 -0600
    @@ -1670,7 +1670,7 @@

struct nv_ipmi_softc
{

  • ipmi_user_t p_user; // ptr to ipmi_msghandler user structure
  • struct ipmi_user *p_user;
    spinlock_t msg_lock;
    struct list_head msgs;
    NvU32 seqNum; //request sequence number
    @@ -1679,7 +1679,7 @@
    static inline int
    nv_ipmi_set_my_address
    (
  • ipmi_user_t user,
  • struct ipmi_user *user,
    unsigned char address
    )
    {

Sorry, I can’t manage.

Please see this pages source, and get the patch there.

Thanks.

It works !
Here are the code correct :

diff --git kernel/conftest.sh kernel/conftest.sh
index e8de161..04d6683 100755
--- kernel/conftest.sh
+++ kernel/conftest.sh
@@ -1780,11 +1780,14 @@ compile_test() {
             # Determine if atomic64_t and associated functions are defined
             CODE="
             #include <asm/atomic.h>
+            #include <linux/version.h>
             void conftest_atomic64(void) {
                 atomic64_t data;
                 atomic64_read(&data);
                 atomic64_set(&data, 0);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
                 atomic64_inc(&data);
+#endif
             }"
 
             compile_check_conftest "$CODE" "NV_ATOMIC64_PRESENT" "" "types"
diff --git kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
index 1db7777..863bb77 100644
--- kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
+++ kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
@@ -20,6 +20,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <linux/version.h>
+
 #include "nvidia-drm-conftest.h"
 
 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
@@ -345,7 +347,11 @@ static int __nv_drm_vma_fault(struct vm_area_struct *vma,
 
     page_offset = vmf->pgoff - drm_vma_node_start(&gem->vma_node);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
     ret = vm_insert_pfn(vma, address, pfn + page_offset);
+#else
+    ret = vmf_insert_pfn(vma, address, pfn + page_offset);
+#endif
 
     switch (ret) {
         case 0:
diff --git kernel/nvidia/linux_nvswitch.c b/kernel/nvidia/linux_nvswitch.c
index 75b5598..9841775 100644
--- kernel/nvidia/linux_nvswitch.c
+++ kernel/nvidia/linux_nvswitch.c
@@ -1582,7 +1582,11 @@ nvswitch_os_snprintf_time
     struct tm t;
     NvS32 date_end;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
     time_to_tm(time_nsec / NVSWITCH_NSEC_PER_SEC, 0, &t);
+#else
+    time64_to_tm(time_nsec / NVSWITCH_NSEC_PER_SEC, 0, &t);
+#endif
 
     date_end = snprintf(date,
                         date_len,
--- kernel/nvidia/os-interface.c	2018-11-15 21:56:59.000000000 -0600
+++ kernel/nvidia/os-interface.c	2018-11-26 21:53:39.970635906 -0600
@@ -1670,7 +1670,7 @@
 
 struct nv_ipmi_softc
 {
-    ipmi_user_t         p_user;     // ptr to ipmi_msghandler user structure
+    struct ipmi_user    *p_user;
     spinlock_t          msg_lock;
     struct list_head    msgs;
     NvU32               seqNum;     //request sequence number
@@ -1679,7 +1679,7 @@
 static inline int
 nv_ipmi_set_my_address
 (
-    ipmi_user_t     user,
+    struct ipmi_user *user,
     unsigned char   address
 )
 {

Many thanks Nomiya !