Blacklisting modules in modprobe.d and kernel params is not working

modprobe

Ok, I have read and followed the instructions on the following posts, however, my kernel modules are still being loaded…

Kernel module blacklist not working

How do I disable a kernel module persistently?

Excluding kernel modules through /etc/modprobe.d/blacklist.conf does not work

I am running

Debian GNU/Linux 9

Originally I created a file /etc/modprobe.d/blacklist.conf

blacklist nouveau
blacklist nvidiafb

I have tried creating files for the individual modules

/etc/modprobe.d/nvidiafb.conf = blacklist nvidiafb
/etc/modprobe.d/nouveau.conf = blacklist nouveau

I have tried adding to the kernel boot params

modprobe.blacklist=nouveau modprobe.blacklist=nvidiafb

I have tried faking the install in /etc/modprobe.d/blacklist.conf

install nouveau /bin/false
install nvidiafb /bin/false

And after each try, I have ran

depmod -ae && update-initramfs -u

yet, the modules still seem to be loaded

02:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: Gigabyte Technology Co., Ltd GP104 [GeForce GTX 1070]
    Flags: fast devsel, IRQ 10
    Memory at dc000000 (32-bit, non-prefetchable) [disabled] [size=16M]
    Memory at a0000000 (64-bit, prefetchable) [disabled] [size=256M]
    Memory at b0000000 (64-bit, prefetchable) [disabled] [size=32M]
    I/O ports at d000 [disabled] [size=128]
    Expansion ROM at dd000000 [disabled] [size=512K]
    Capabilities: [60] Power Management version 3
    Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
    Capabilities: [78] Express Legacy Endpoint, MSI 00
    Capabilities: [100] Virtual Channel
    Capabilities: [250] Latency Tolerance Reporting
    Capabilities: [128] Power Budgeting <?>
    Capabilities: [420] Advanced Error Reporting
    Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
    Capabilities: [900] #19
    Kernel driver in use: vfio-pci
    Kernel modules: nvidiafb, nouveau

It seems that I have ran out of solutions to try

Best Answer

Your answer lies in the lspci output. You're not loading the nouveau/nvidiafb.

The line:

Kernel modules: nvidiafb, nouveau

identifies which kernel modules "support" your video card. The other line:

Kernel driver in use: vfio-pci

specifies which module is actually loaded for your video card. In this case you've specified the vfio-pci kernel module, which is typically used by people wanting to pass the video card into a virtual machine.

On my system I have the Nvidia proprietary binaries loaded, so my output is a little different:

42:00.0 VGA compatible controller: NVIDIA Corporation TU104GL [Quadro RTX 4000] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: NVIDIA Corporation TU104GL [Quadro RTX 4000]
        ...
        Capabilities: [bb0] Resizable BAR <?>
        Kernel driver in use: nvidia
        Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

There are several modules that could load for the device, but the one actually in use is the nvidia kernel module.

Related Question