Can't load NVIDIA kernel module even though /lib/modules/$(uname -r)/updates does contain nvidia*.ko

Hi,

After I seemed to fix this previous thread’s issues I rebooted. Only to find that the NVIDIA kernel module wasn’t loading. I have run:


sudo modprobe -a nvidia

but that returns:


modprobe: ERROR: could not insert 'nvidia': No such device

even though lspci -k clearly shows a NVIDIA device does exist. Namely this is lspci -k’s output:


00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel modules: ie31200_edac
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
        Kernel driver in use: pcieport
        Kernel modules: shpchp
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: i915
        Kernel modules: i915
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: xhci_hcd
        Kernel modules: xhci_pci
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: mei_me
        Kernel modules: mei_me
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: ehci-pci
        Kernel modules: ehci_pci
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5)
        Kernel driver in use: pcieport
        Kernel modules: shpchp
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5)
        Kernel driver in use: pcieport
        Kernel modules: shpchp
00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d5)
        Kernel driver in use: pcieport
        Kernel modules: shpchp
00:1c.6 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #7 (rev d5)
        Kernel driver in use: pcieport
        Kernel modules: shpchp
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: ehci-pci
        Kernel modules: ehci_pci
00:1f.0 ISA bridge: Intel Corporation HM87 Express LPC Controller (rev 05)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: lpc_ich
        Kernel modules: lpc_ich
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: ahci
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: i801_smbus
        Kernel modules: i2c_i801
01:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 740M] (rev a1)
        Subsystem: Hewlett-Packard Company Device 219c
        Kernel modules: nouveau, nvidia_drm, nvidia
07:00.0 Network controller: Broadcom Limited BCM4352 802.11ac Wireless Network Adapter (rev 03)
        Subsystem: Hewlett-Packard Company Device 2154
        Kernel driver in use: wl
        Kernel modules: bcma, wl
09:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: rtsx_pci
        Kernel modules: rtsx_pci
0f:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
        Subsystem: Hewlett-Packard Company Device 1966
        Kernel driver in use: r8169
        Kernel modules: r8169

I have also run:


sudo modprobe -a nvidia-drm

but that fails and returns:


modprobe: ERROR: could not insert 'nvidia_drm': No such device

By-the-way the kernel modules for both nvidia and nvidia-drm do exist in /lib/modules/$(uname -r)/updates, namely there are the following modules with nvidia in their name in said folder:


nvidia-drm.ko  nvidia.ko  nvidia-modeset.ko  nvidia-uvm.ko

Any ideas?

Thanks for your time,
Brenton

What kernel is running there?
Where did you get the Nvidia driver?
And if kernel 4.10, do you patch the nvidia drivers?

Sure did patch the NVIDIA drivers (using the Ubuntu patch https://pkgs.rpmfusion.org/cgit/nonfree/nvidia-kmod.git/plain/kernel_4.10.patch), 4.10 is my kernel and I use the official NVIDIA driver. If you need more details here is my OBS repository that provides this package. I have been told that other users have found that my OBS package works perfectly, without this problem.

This is my patch:
http://openmafia.org/~osf/Downloads/buildfix_kernel_4.10.patch

Also from Ubuntu.
http://archive.ubuntu.com/ubuntu/pool/restricted/n/nvidia-graphics-drivers-375/nvidia-graphics-drivers-375_375.39-0ubuntu2.diff.gz
You need only the kernel 4.10 Patch.

nvidia-settings -v

nvidia-settings:  version 378.13  (buildmeister@swio-display-x86-rhel47-05)  Tue Feb  7 19:35:55 PST
2017
  The NVIDIA X Server Settings tool.

  This program is used to configure the NVIDIA Linux graphics driver.
  For more detail, please see the nvidia-settings(1) man page.

No nvidia in /updates:

ls -al /lib/modules/$(uname -r)/updates
insgesamt 6112
drwxr-xr-x 1 root root      36 28. Feb 19:09 .
drwxr-xr-x 1 root root     422 28. Feb 19:19 ..
-rw-r--r-- 1 root root 4715744 28. Feb 18:29 r8168.ko
-rw-r--r-- 1 root root 1538320 28. Feb 18:29 smi2021.ko

They are in /lib/modules/$(uname -r)/kernel/drivers/video/

ls -al /lib/modules/$(uname -r)/kernel/drivers/video/
insgesamt 50408
drwxr-xr-x 1 root root      154 28. Feb 19:19 .
drwxr-xr-x 1 root root      820 28. Feb 18:24 ..
drwxr-xr-x 1 root root      384 28. Feb 18:24 backlight
drwxr-xr-x 1 root root      302 28. Feb 18:24 fbdev
-rw-r--r-- 1 root root  3236816 28. Feb 19:19 nvidia-drm.ko
-rw-r--r-- 1 root root 23514624 28. Feb 19:19 nvidia.ko
-rw-r--r-- 1 root root  1409680 28. Feb 19:19 nvidia-modeset.ko
-rw-r--r-- 1 root root 23432728 28. Feb 19:19 nvidia-uvm.ko
-rw-r--r-- 1 root root    16272 28. Feb 11:41 vgastate.ko

Edit:
You have the same Patch???..

I just switched over to your patch and it’s made no difference. I still don’t autoload the NVIDIA module.

I’ve even installed NVIDIA’s own modprobe program https://github.com/NVIDIA/nvidia-modprobe via running:


wget -cqO- https://github.com/NVIDIA/nvidia-modprobe/archive/378.13.tar.gz | tar xz
cd nvidia-modprobe-378.13
make
sudo make install

then I ran:


sudo /usr/local/bin/nvidia-modprobe

and still lspci -k shows the NVIDIA module is not loaded! Running optirun glxgears still returns:


  442.906050] [ERROR]Cannot access secondary GPU - error: Could not load GPU driver


  442.906107] [ERROR]Aborting because fallback start is disabled.

just to be clear I’m not yelling at you, I know you’re trying to help me. Just having a little temper tantrum at the situation as it makes no sense.