Cannot load driver in Kali linux

I’m trying to install nvidia driver for my Kali Linux machine, it was running well with the default nouveau driver.

I followed this Kali official tutorial https://www.kali.org/docs/general-use/install-nvidia-drivers-on-kali-linux/

After the installation, display resolution become very low. So I checked device status with
lspci -s 26:00.0 –v And the output is like this

    Subsystem: Device 7377:1501
    Flags: bus master, fast devsel, latency 0, IRQ 10, IOMMU group 15
    Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
    Memory at e0000000 (64-bit, prefetchable) [size=256M]
    Memory at f0000000 (64-bit, prefetchable) [size=32M]
    I/O ports at e000 [size=128]
    Expansion ROM at 000c0000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel modules: nvidia

Kernel modules does show Nvidia, but the kernel driver in use is not shown.

I noticed that during boot up, there is an error of System[1]: Failed to start Load Kernel Modules So I checked with systemctl status systemd-modules-load.service command.
The output shows nvidia-current and nvidia-current-modeset could not be found as following

     Loaded: loaded (/lib/systemd/system/systemd-modules-load.service; static)
     Active: failed (Result: exit-code) since Thu 2022-06-02 00:54:24 HKT; 7h left
       Docs: man:systemd-modules-load.service(8)
             man:modules-load.d(5)
    Process: 446 ExecStart=/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
   Main PID: 446 (code=exited, status=1/FAILURE)
        CPU: 10ms

Jun 02 00:54:24 kali systemd-modules-load[455]: modprobe: FATAL: Module nvidia-current not found in directory /lib/modules/5.15.0-kali3-amd64
Jun 02 00:54:24 kali systemd-modules-load[453]: modprobe: ERROR: ../libkmod/libkmod-module.c:990 command_do() Error running install command 'modprobe -i nvidia-current ' for module nvidia: retcode 1
Jun 02 00:54:24 kali systemd-modules-load[453]: modprobe: ERROR: could not insert 'nvidia': Invalid argument
Jun 02 00:54:24 kali systemd-modules-load[459]: modprobe: FATAL: Module nvidia-current-modeset not found in directory /lib/modules/5.15.0-kali3-amd64
Jun 02 00:54:24 kali systemd-modules-load[451]: modprobe: ERROR: ../libkmod/libkmod-module.c:990 command_do() Error running install command 'modprobe nvidia ; modprobe -i nvidia-current-modeset ' for module nvidia_modeset: retcode 1
Jun 02 00:54:24 kali systemd-modules-load[451]: modprobe: ERROR: could not insert 'nvidia_modeset': Invalid argument
Jun 02 00:54:24 kali systemd-modules-load[464]: modprobe: FATAL: Module nvidia-current-drm not found in directory /lib/modules/5.15.0-kali3-amd64
Notice: journal has been rotated since unit was started, output may be incomplete.

Here is the Nvidia related files under /lib/modules/5.15.0-kali3-amd64/

./modules/5.15.0-kali3-amd64/kernel/drivers/usb/typec/altmodes/typec_nvidia.ko
./modules/5.15.0-kali3-amd64/kernel/drivers/net/ethernet/nvidia/forcedeth.ko

I saw some nvidia-current-dkms files under lib or somewhere.

Besides purge all nvidia packages and re-install, I also tried to add nouveau to the nvidia-blacklists-nouveau.conf, and setting secure boot off, still the same result.
I remember that I have successfully installed this driver once before (about 1-1.5 years ago), I am not sure what went wrong here, any advice is welcomed. Thanks.

nvidia-bug-report.log.gz (91.4 KB)
GPU: RTX2060
CPU: R5-2600

I am having the same issue but with a RTX 3050.
The nouveau kernel loads with FHD and zero problems but after I followed the tutorial on Install NVIDIA GPU Drivers | Kali Linux Documentation and installed the drivers, the resolution shrinks and parts of the display aren’t displayed correctly - even in the GRUB bootloader.
the nvidia-smi tool isn’t working at all after following the tutorial on the kali documentation website.

EDIT: I am using the newest 470.XXX Driver available. Installed over the apt install command. Also, the nvidia-detect command shows the RTX 3050.
I am currently using my old laptop with a Geforce 750M and there, the nvidia kernel and driver loads correctly.

modprobe: ERROR: could not insert 'nvidia': Invalid argument

Either the module is broken due to build system issues or there are invalid module options set.
Please post the output of

grep nvidia /etc/modprobe.d/* /lib/modprobe.d/*

Here is the output:
/etc/modprobe.d/nvidia.conf:install nvidia modprobe -i nvidia-current $CMDLINE_OPTS
/etc/modprobe.d/nvidia.conf:install nvidia-modeset modprobe nvidia ; modprobe -i nvidia-current-modeset $CMDLINE_OPTS
/etc/modprobe.d/nvidia.conf:install nvidia-drm modprobe nvidia-modeset ; modprobe -i nvidia-current-drm $CMDLINE_OPTS
/etc/modprobe.d/nvidia.conf:install nvidia-peermem modprobe nvidia ; modprobe -i nvidia-current-peermem $CMDLINE_OPTS
/etc/modprobe.d/nvidia.conf:install nvidia-uvm modprobe nvidia ; modprobe -i nvidia-current-uvm $CMDLINE_OPTS
/etc/modprobe.d/nvidia.conf:remove nvidia modprobe -r -i nvidia-drm nvidia-modeset nvidia-peermem nvidia-uvm nvidia
/etc/modprobe.d/nvidia.conf:remove nvidia-modeset modprobe -r -i nvidia-drm nvidia-modeset
/etc/modprobe.d/nvidia.conf:alias char-major-195* nvidia
/etc/modprobe.d/nvidia.conf:# These aliases are defined in all nvidia modules.
/etc/modprobe.d/nvidia.conf:alias pci:v000010DEd00000E00svsdbc04sc80i00* nvidia
/etc/modprobe.d/nvidia.conf:alias pci:v000010DEd00000AA3svsdbc0Bsc40i00* nvidia
/etc/modprobe.d/nvidia.conf:alias pci:v000010DEdsvsdbc03sc02i00 nvidia
/etc/modprobe.d/nvidia.conf:alias pci:v000010DEdsvsdbc03sc00i00 nvidia
/etc/modprobe.d/nvidia-options.conf:#options nvidia-current NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=44 NVreg_DeviceFileMode=0660
/etc/modprobe.d/nvidia-options.conf:# options nvidia-current NVreg_EnableAGPSBA=1
/etc/modprobe.d/nvidia-options.conf:# options nvidia-current NVreg_EnableAGPFW=1

I also noted that the kernel driver in use and the modules are different:

$ lspci -s 01:00.0 -v

01:00.0 VGA compatible controller: NVIDIA Corporation GA106 [Geforce RTX 3050] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: NVIDIA Corporation GA106 [Geforce RTX 3050]
        Flags: bus master, fast devsel, latency 0, IRQ 136
        Memory at 52000000 (32-bit, non-prefetchable) [size=16M]
        Memory at 40000000 (64-bit, prefetchable) [size=256M]
        Memory at 50000000 (64-bit, prefetchable) [size=32M]
        I/O ports at 4000 [size=128]
        Expansion ROM at 53000000 [disabled] [size=512K]
        Capabilities: <access denied>
        Kernel driver in use: nouveau
        Kernel modules: nvidia

Here is the output from the nvidia-bug-report.sh run:
nvidia-bug-report.log.gz (95.5 KB)

@lml You’re just using the wrong driver, the desktop 3050 is not supported by the 470 driver. Please install the latest 515 version.

1 Like

Like @generix mentioned, it is the driver version problem, the default Kali repo has driver up to ver 470, and it is too old for my 3060 and likely your 3050.

I tried to download the installer from Nvidia and install the latest version manually, did not work either, it requires a different kernel configure or somewhat I forgot, but definitely not issues with easy fix.

I ended up with changing the entire OS to Ubuntu 22…I know changing OS is not an ideal solution but it did fixe everything.

You might also use the nvidia cuda repo for debian to get the latest driver.

Thanks for the answers and your time. I will try to install the 515 driver as soon as possible.