Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 707782 - x11-drivers/nvidia-drivers-440.44-r1 - unable to unload module
Summary: x11-drivers/nvidia-drivers-440.44-r1 - unable to unload module
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-01 15:50 UTC by Gentookh
Modified: 2020-02-01 19:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gentookh 2020-02-01 15:50:42 UTC
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
Comment 1 Mike Gilbert gentoo-dev 2020-02-01 17:27:20 UTC
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.
Comment 2 Mike Gilbert gentoo-dev 2020-02-01 17:33:20 UTC
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
Comment 3 Gentookh 2020-02-01 17:40:53 UTC
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
Comment 4 Mike Gilbert gentoo-dev 2020-02-01 17:55:39 UTC
Possibly it's being loaded by an initramfs, or some other program.
Comment 5 Mike Gilbert gentoo-dev 2020-02-01 18:18:35 UTC
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
Comment 6 Gentookh 2020-02-01 18:36:49 UTC
Will look in initrams, I have a custom one…

# modprobe -r nvidia
modprobe: FATAL: Module nvidia is in use.
Comment 7 Gentookh 2020-02-01 18:50:52 UTC
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.