Can't install NVIDIA driver on a Asus Vivobook n580gd with CentOS-7.6 (NVIDIA-SMI has failed because...

Hi everyone,

I am trying to install the CUDA driver on my brand new ASUS Vivobook n580gd without success.

My laptop has two graphic cards: an Intel UHD Graphics 630 and one NVIDIA GeForce GTX 1050 Mobile.

After a lot of googling I still have not found a solution.

I thank you in advance for any suggestion/advice.

This is what I did until now:

Then I rebooted and tried to check the driver:

$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
$ nvidia-settings 
ERROR: NVIDIA driver is not loaded
ERROR: Unable to load info from any available system
$ sudo lshw -numeric -C display
  *-display UNCLAIMED       
       description: 3D controller
       product: GP107M [GeForce GTX 1050 Mobile] [10DE:1C8D]
       vendor: NVIDIA Corporation [10DE]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: latency=0
       resources: memory:a3000000-a3ffffff memory:90000000-9fffffff memory:a0000000-a1ffffff ioport:4000(size=128) memory:a4000000-a407ffff
  *-display
       description: VGA compatible controller
       product: UHD Graphics 630 (Mobile) [8086:3E9B]
       vendor: Intel Corporation [8086]
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:128 memory:a2000000-a2ffffff memory:80000000-8fffffff ioport:5000(size=64)
$ ll /dev/nvidia*
ls: cannot access /dev/nvidia*: No such file or directory

** SOME ADDITIONAL INFO **

OS:

$ cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

GCC:

$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)

Kernel:

$ uname -a
Linux centos 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Graphic cards:

$ nvidia-detect -v
Probing for supported NVIDIA devices...
[8086:3e9b] Intel Corporation UHD Graphics 630 (Mobile)
[10de:1c8d] NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile]
This device requires the current 418.74 NVIDIA driver kmod-nvidia
An Intel display controller was also detected

Detailed info on Graphic cards

$ sudo lspci -v -s 01:00.0
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev a1)
	Subsystem: ASUSTeK Computer Inc. Device 1fc0
	Flags: bus master, fast devsel, latency 0, IRQ 255
	Memory at a3000000 (32-bit, non-prefetchable) 
	Memory at 90000000 (64-bit, prefetchable) 
	Memory at a0000000 (64-bit, prefetchable) 
	I/O ports at 4000 [disabled] 
	Expansion ROM at a4000000 [disabled] 
	Capabilities: [60] Power Management version 3
	Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
	Capabilities: [78] Express Endpoint, MSI 00
	Capabilities: [100] Virtual Channel
	Capabilities: [250] Latency Tolerance Reporting
	Capabilities: [258] L1 PM Substates
	Capabilities: [128] Power Budgeting <?>
	Capabilities: [420] Advanced Error Reporting
	Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
	Capabilities: [900] #19
	Kernel modules: nouveau

$ sudo lspci -v -s 00:02.0
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile) (prog-if 00 [VGA controller])
	Subsystem: ASUSTeK Computer Inc. Device 1fc0
	Flags: bus master, fast devsel, latency 0, IRQ 127
	Memory at a2000000 (64-bit, non-prefetchable) 
	Memory at 80000000 (64-bit, prefetchable) 
	I/O ports at 5000 
	[virtual] Expansion ROM at 000c0000 [disabled] 
	Capabilities: [40] Vendor Specific Information: Len=0c <?>
	Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
	Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable- 64bit-
	Capabilities: [d0] Power Management version 2
	Capabilities: [100] Process Address Space ID (PASID)
	Capabilities: [200] Address Translation Service (ATS)
	Capabilities: [300] Page Request Interface (PRI)
	Kernel driver in use: i915
	Kernel modules: i915

Installed (?) driver:

$ yum list installed  | grep nvidia
dkms-nvidia.x86_64                      3:418.67-1.el7                 @cuda    
nvidia-detect.x86_64                    418.74-2.el7.elrepo            @elrepo  
nvidia-driver.x86_64                    3:418.67-4.el7                 @cuda    
nvidia-driver-NVML.x86_64               3:418.67-4.el7                 @cuda    
nvidia-driver-NvFBCOpenGL.x86_64        3:418.67-4.el7                 @cuda    
nvidia-driver-cuda.x86_64               3:418.67-4.el7                 @cuda    
nvidia-driver-cuda-libs.x86_64          3:418.67-4.el7                 @cuda    
nvidia-driver-devel.x86_64              3:418.67-4.el7                 @cuda    
nvidia-driver-libs.x86_64               3:418.67-4.el7                 @cuda    
nvidia-libXNVCtrl.x86_64                3:418.67-1.el7                 @cuda    
nvidia-libXNVCtrl-devel.x86_64          3:418.67-1.el7                 @cuda    
nvidia-modprobe.x86_64                  3:418.67-1.el7                 @cuda    
nvidia-persistenced.x86_64              3:418.67-1.el7                 @cuda    
nvidia-settings.x86_64                  3:418.67-1.el7                 @cuda    
nvidia-xconfig.x86_64                   3:418.67-1.el7                 @cuda

Nvcc compiler:

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Apr_24_19:10:27_PDT_2019
Cuda compilation tools, release 10.1, V10.1.168

Secure boot:

$ mokutil --sb-state
SecureBoot disabled

I hope you can help me. Thank you very much guys.

I fixed the problem. My bad, I forgot to install the kernel-devel package.

After the installation:

sudo yum install kernel-devel-$(uname -r)

and a reboot, the driver is working.

$ nvidia-smi
Tue Jun 11 23:15:28 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.67       Driver Version: 418.67       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1050    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   44C    P8    N/A /  N/A |      0MiB /  4042MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+


    $ sudo lshw -numeric -C display
    *-display                 
       description: 3D controller
       product: GP107M [GeForce GTX 1050 Mobile] [10DE:1C8D]
       vendor: NVIDIA Corporation [10DE]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:508 memory:a3000000-a3ffffff memory:90000000-9fffffff memory:a0000000-a1ffffff ioport:4000(size=128) memory:a4000000-a407ffff
    *-display
       description: VGA compatible controller
       product: UHD Graphics 630 (Mobile) [8086:3E9B]
       vendor: Intel Corporation [8086]
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:128 memory:a2000000-a2ffffff memory:80000000-8fffffff ioport:5000(size=64)
    ll /dev/nvidia*
    crw-rw-rw-. 1 root root 195,   0 Jun 11 23:12 /dev/nvidia0
    crw-rw-rw-. 1 root root 195, 255 Jun 11 23:12 /dev/nvidiactl
    crw-rw-rw-. 1 root root 195, 254 Jun 11 23:12 /dev/nvidia-modeset
    crw-rw-rw-. 1 root root 241,   0 Jun 11 23:12 /dev/nvidia-uvm
    crw-rw-rw-. 1 root root 241,   1 Jun 11 23:12 /dev/nvidia-uvm-tools