How to blacklist drivers
My main goal is to disable nvidia driver from loading on linux
Identify drivers to disable
In my case its nvida
lsmod | grep nvidia
Output:
i2c_nvidia_gpu 12288 0
i2c_nvidia_gpu module is loaded, which is a support module related to power management for NVIDIA GPUs. We can blacklist this module along with any other NVIDIA-related drivers to fully disable the discrete GPU.
Step 1: Blacklist i2c_nvidia_gpu and Other NVIDIA Modules
Create or modify a blacklist configuration file: Open or create the blacklist file:
sudo nano /etc/modprobe.d/blacklist-nvidia.conf
Add the following lines to blacklist the i2c_nvidia_gpu module and any other related modules that might load later:
blacklist i2c_nvidia_gpu
blacklist nvidia
blacklist nvidia_modeset
blacklist nvidia_uvm
blacklist nvidia_drm
Save the file and exit.
Step 2: Regenerate Initramfs
After blacklisting, regenerate the initramfs to apply the changes at boot:
sudo mkinitcpio -P
Step 3: Reboot and Verify
Reboot your system:
sudo reboot
After rebooting, run the following command to verify that the i2c_nvidia_gpu and other NVIDIA modules are not loaded:
lsmod | grep nvidia
If nothing appears, the NVIDIA GPU should now be disabled.
No Comments