Oracle Enterprise Linux 7 driver (430.50) install error: "vm_fault_t" unknown type

I get a strange error when using the NVIDIA installer on
EL7 (specifically Oracle Enterprise Linux 7, v7.7) with
kernel 4.14.35-1902.6.6.el7uek.x86_64

I’m using installer: NVIDIA-Linux-x86_64-430.50.run
and I get this error below. Any help or advice is
greatly appreciated.

make[3]: *** [/tmp/selfgz2849/NVIDIA-Linux-x86_64-430.50/kernel/nvidia/nv-memdbg.o] Error 1
In file included from /tmp/selfgz2849/NVIDIA-Linux-x86_64-430.50/kernel/nvidia/linux_nvswitch.c:28:0:
/tmp/selfgz2849/NVIDIA-Linux-x86_64-430.50/kernel/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/tmp/selfgz2849/NVIDIA-Linux-x86_64-430.50/kernel/nvidia/nv-report-err.o] Error 1
make[3]: *** [/tmp/selfgz2849/NVIDIA-Linux-x86_64-430.50/kernel/nvidia/nv_uvm_interface.o] Error 1
make[3]: *** [/tmp/selfgz2849/NVIDIA-Linux-x86_64-430.50/kernel/nvidia/linux_nvswitch.o] Error 1
make[3]: Target `__build' not remade because of errors.
make[2]: *** [_module_/tmp/selfgz2849/NVIDIA-Linux-x86_64-430.50/kernel] Error 2
make[2]: Target `modules' not remade because of errors.
make[2]: Leaving directory `/usr/src/kernels/4.14.35-1902.6.6.el7uek.x86_64'
make[1]: *** [sub-make] Error 2
make[1]: Target `modules' not remade because of errors.
make[1]: Leaving directory `/usr/src/kernels/4.14.35-1902.6.6.el7uek.x86_64'
make: *** [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 have the exact same issue with the same OS

Those are the results of inxi -GSx:

System:    Host: localhost.localdomain Kernel: 4.14.35-1902.6.6.el7uek.x86_64 x86_64 bits: 64 compiler: gcc v: 4.8.5 
           Console: tty 1 Distro: Red Hat Enterprise Linux Server release 7.7 (Maipo) 
Graphics:  Device-1: NVIDIA GP107GL [Quadro P400] vendor: Dell driver: nouveau v: kernel bus ID: 65:00.0 
           Display: server: X.org 1.20.4 driver: modesetting unloaded: fbdev,vesa tty: 238x54 
           Message: Advanced graphics data unavailable in console. Try -G --display

Have you found a solution to this error?

Please check if it is this issue:
https://devtalk.nvidia.com/default/topic/1065080/-bug-nvidia-440-26-modules-not-building/?offset=16#5396501

I’ve checked and maybe this is the problem.

How can I modify the conftest.sh script?

I am using the NVIDIA-Linux-x86_64-430.50.run to install it.

You could put the patch in a file and use the --apply-patch option or unpack the .run installer using the -x option, modify manually, then run nvidia-installer, or maybe just run it
LANGUAGE=C ./NVIDIA-Linux-x86_64-430.50.run
EDIT: the latter won’t work with dkms.

Thank you so much for your help!

I’ve tried the 3 options but I get the same error, so I guess this is not the problem.

This is the final part of /var/lib/dkms/nvidia/430.50/build/make.log, where the first error appears

CONFTEST: is_export_symbol_gpl_refcount_dec_and_test
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-frontend.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-instance.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-acpi.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-chrdev.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-cray.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-dma.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-gvi.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-i2c.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-mempool.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-p2p.o
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-instance.c:13:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv.c:14:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-frontend.c:13:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-acpi.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-instance.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-frontend.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-chrdev.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-acpi.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-cray.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-chrdev.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-gvi.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-cray.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-dma.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv.o] Error 1
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-gvi.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-i2c.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-dma.o] Error 1
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-i2c.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-mempool.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-p2p.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-mempool.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
/var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.c:188:1: error: unknown type name 'vm_fault_t'
 static vm_fault_t nvidia_fault(
 ^
/var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.c: In function 'nvidia_fault':
/var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.c:201:5: error: unknown type name 'vm_fault_t'
     vm_fault_t ret = VM_FAULT_NOPAGE;
     ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-p2p.o] Error 1
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.o] Error 1
make[2]: *** [_module_/var/lib/dkms/nvidia/430.50/build] Error 2
make[2]: Leaving directory `/usr/src/kernels/4.14.35-1902.6.6.el7uek.x86_64'
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/usr/src/kernels/4.14.35-1902.6.6.el7uek.x86_64'
make: *** [modules] Error 2

I’ve taken a deeper look at the oracle kernel sources and it seems they (or RH) backported vmf_insert_pfn fuction from kernel 4.17 (which the driver’s conftest checks for) but didn’t introduce the vm_fault_t type.
you could change the driver’s kernel/common/inc/nv-mm.h

#ifndef NV_VMF_INSERT_PFN_PRESENT
typedef int vm_fault_t;
#endif

removing the #ifndef clause for a workaround and check where it breaks next;)

Now the error seems slighlty different, but the “unknown type name ‘vm_fault_t’” is still present.

I copy you the same part as before.

CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-mempool.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.o
  CC [M]  /var/lib/dkms/nvidia/430.50/build/nvidia/nv-p2p.o
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-instance.c:13:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-frontend.c:13:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-acpi.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv.c:14:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-instance.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-chrdev.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-frontend.o] Error 1
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-acpi.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-cray.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-chrdev.o] Error 1
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-cray.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-dma.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-dma.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-gvi.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-i2c.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-mempool.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-gvi.o] Error 1
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-mempool.o] Error 1
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-i2c.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
/var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.c:188:1: error: unknown type name 'vm_fault_t'
 static vm_fault_t nvidia_fault(
 ^
/var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.c: In function 'nvidia_fault':
/var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.c:201:5: error: unknown type name 'vm_fault_t'
     vm_fault_t ret = VM_FAULT_NOPAGE;
     ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-mmap.o] Error 1
In file included from /var/lib/dkms/nvidia/430.50/build/nvidia/nv-p2p.c:15:0:
/var/lib/dkms/nvidia/430.50/build/common/inc/nv-linux.h:958:1: error: unknown type name 'vm_fault_t'
 static inline vm_fault_t nv_insert_pfn(struct vm_area_struct *vma,
 ^
make[3]: *** [/var/lib/dkms/nvidia/430.50/build/nvidia/nv-p2p.o] Error 1
make[2]: *** [_module_/var/lib/dkms/nvidia/430.50/build] Error 2
make[2]: Leaving directory `/usr/src/kernels/4.14.35-1902.6.6.el7uek.x86_64'
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/usr/src/kernels/4.14.35-1902.6.6.el7uek.x86_64'
make: *** [modules] Error 2

Looks like you incorrectla modified the file

#ifndef NV_VMF_INSERT_PFN_PRESENT
typedef int vm_fault_t;
#endif

has to become

typedef int vm_fault_t;

You are right, now it works perfectly!

Thank you very much!

Hey @generix I have no clue how this works but it freaking does. Thanks for saving me!
Mind explaining what vm_fault_t, NV_VMF_INSERT_PFN_PRESENT, kernel/common/inc/nv-mm.h, and vmf_insert_pfn are?
Thanks

Without knowing the C language, I don’t think this will help you
vm_fault_t: variable type
NV_VMF_INSERT_PFN_PRESENT: preprocessor symbol
kernel/common/inc/nv-mm.h: header file
vmf_insert_pfn: (kernel) function

Thanks @generix. I understand the syntax, but I am just curious what are these functions responsible for and how do they fit into the bigger picture of the driver?
Specifically what does “backported vmf_insert_pfn” mean? What does vmf_insert_pfn do? Why does vm_fault_t has to be used instead of a regular integer?

vmf_insert_pfn: https://elixir.bootlin.com/linux/latest/source/mm/memory.c#L1680
vm_fault_t instead of int: maybe introduced for readability.
You should rather ask somebody who knows about kernel development and memory management.

Ok, appreciate it @generix