And then I unable to remove it, because it's in use: # rmmod nvidia rmmod: ERROR: Module nvidia is in use by: nvidia_modeset # lsmod Module Size Used by nvidia_drm 45056 1 nvidia_modeset 1069056 1 nvidia_drm nvidia 19886080 1 nvidia_modeset # pidof init 1 # cat /etc/modprobe.d/blacklist.conf blacklist nvidia blacklist nvidia_drm blacklist nvidia_modeset # equery l nvidia-drivers openrc * Searching for nvidia-drivers ... [IP-] [ ] x11-drivers/nvidia-drivers-440.44-r1:0/440 * Searching for openrc ... [IP-] [ ] sys-apps/openrc-0.42.1:0 # dmesg | grep nvidia [ 5.012496] nvidia: loading out-of-tree module taints kernel. [ 5.013144] nvidia: module license 'NVIDIA' taints kernel. [ 5.032632] nvidia-nvlink: Nvlink Core is being initialized, major device number 247 [ 5.033437] nvidia 0000:01:00.0: enabling device (0006 -> 0007) [ 5.034074] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem [ 5.136114] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 440.44 Sun Dec 8 03:29:48 UTC 2019 [ 5.137453] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver [ 5.944665] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
I don't see how this is in any way related to "init" or OpenRC. The "Used by 1" does not indicate that the module was loaded by PID 1. Rather, it means the module is currently in use by 1 kernel module or program. https://en.wikipedia.org/wiki/Lsmod It seems likely that something is holding the device open for display output.
As for why they are being loaded in the first place, please check these files: /etc/conf.d/modules /etc/modules-load.d/*.conf /run/modules-load.d/*.conf /usr/lib/modules-load.d/*.conf
Nothing there, any other places to look out for? Or better ask kernel guys? # grep -c nvidia /etc/conf.d/modules /etc/modules-load.d/*.conf /run/modules-load.d/*.conf /usr/lib/modules-load.d/*.conf /etc/conf.d/modules:0 grep: /etc/modules-load.d/*.conf: No such file or directory grep: /run/modules-load.d/*.conf: No such file or directory grep: /usr/lib/modules-load.d/*.conf: No such file or directory
Possibly it's being loaded by an initramfs, or some other program.
You might have better luck removing the module using "modprobe -r" instead of "rmmod" due to the configuration in /etc/modprobe.d/nvidia-rmmod.conf. modprobe -r nvidia
Will look in initrams, I have a custom one… # modprobe -r nvidia modprobe: FATAL: Module nvidia is in use.
Thanks for the suggestion with initramfs! I've moved blacklist.conf inside my custom initramfs and now modules are not loading. Issue can be closed.