rmmod:错误:模块 nvidia 正在使用中

rmmod:错误:模块 nvidia 正在使用中
lsmod | grep nvidia
nvidia              18833408  21
ipmi_msghandler       102400  2 ipmi_devintf,nvidia

sudo rmmod nvidia
rmmod: ERROR: Module nvidia is in use

sudo rmmod -f nvidia
rmmod: ERROR: ../libkmod/libkmod-module.c:793 kmod_module_remove_module() could not remove 'nvidia': Resource temporarily unavailable
rmmod: ERROR: could not remove module nvidia: Resource temporarily unavailable

modinfo nvidia
filename:       /lib/modules/5.3.0-28-generic/updates/dkms/nvidia.ko
alias:          char-major-195-*
version:        430.26
supported:      external
license:        NVIDIA
srcversion:     89BDA0F56877588EC9454C6
alias:          pci:v000010DEd00000E00sv*sd*bc04sc80i00*
alias:          pci:v000010DEd*sv*sd*bc03sc02i00*
alias:          pci:v000010DEd*sv*sd*bc03sc00i00*
depends:        ipmi_msghandler
retpoline:      Y
name:           nvidia
vermagic:       5.3.0-28-generic SMP mod_unload
signat:         PKCS#7
signer:
sig_key:
sig_hashalgo:   md4
parm:           NvSwitchRegDwords:NvSwitch regkey (charp)
parm:           NVreg_Mobile:int
parm:           NVreg_ResmanDebugLevel:int
parm:           NVreg_RmLogonRC:int
parm:           NVreg_ModifyDeviceFiles:int
parm:           NVreg_DeviceFileUID:int
parm:           NVreg_DeviceFileGID:int
parm:           NVreg_DeviceFileMode:int
parm:           NVreg_InitializeSystemMemoryAllocations:int
parm:           NVreg_UsePageAttributeTable:int
parm:           NVreg_MapRegistersEarly:int
parm:           NVreg_RegisterForACPIEvents:int
parm:           NVreg_EnablePCIeGen3:int
parm:           NVreg_EnableMSI:int
parm:           NVreg_TCEBypassMode:int
parm:           NVreg_EnableStreamMemOPs:int
parm:           NVreg_EnableBacklightHandler:int
parm:           NVreg_RestrictProfilingToAdminUsers:int
parm:           NVreg_PreserveVideoMemoryAllocations:int
parm:           NVreg_DynamicPowerManagement:int
parm:           NVreg_EnableUserNUMAManagement:int
parm:           NVreg_MemoryPoolSize:int
parm:           NVreg_KMallocHeapMaxSize:int
parm:           NVreg_VMallocHeapMaxSize:int
parm:           NVreg_IgnoreMMIOCheck:int
parm:           NVreg_NvLinkDisable:int
parm:           NVreg_RegistryDwords:charp
parm:           NVreg_RegistryDwordsPerDevice:charp
parm:           NVreg_RmMsg:charp
parm:           NVreg_GpuBlacklist:charp
parm:           NVreg_TemporaryFilePath:charp
parm:           NVreg_AssignGpus:charp

如何从内核卸载 nvidia?

更新: 我尝试删除 Nvidia 驱动程序,但没有帮助:

sudo apt-get --purge remove "*nvidia*"
sudo /usr/bin/nvidia-uninstall

更新: 重启后:

lsmod | grep nvidia
nvidia_drm             49152  0
nvidia_modeset       1114112  1 nvidia_drm
nvidia              18833408  22 nvidia_modeset
drm_kms_helper        180224  1 nvidia_drm
drm                   483328  3 drm_kms_helper,nvidia_drm
ipmi_msghandler       102400  2 ipmi_devintf,nvidia
i2c_nvidia_gpu         16384  0

答案1

首先切换到 nouveau 驱动程序,然后清除 nvidia 驱动程序。
要删除,请运行“软件和更新/其他驱动程序”选项卡。驱动程序列表底部是 nouveau 驱动程序。选择它,单击应用按钮,完成后,注销/登录可能会起作用,但最好尝试重新启动以确保一切正常。重新启动后,nvidia 驱动程序不应处于使用状态(lsmod |grep -i nvidia 应该不会产生任何结果)。现在,如果您真的想要,您可以删除 nvidia 软件包,但保留它们不会有什么坏处,而且会更容易从 nouveau 驱动程序切换回来。

答案2

由于此模块当前正被另一个模块使用,因此您无法删除。如果您不再需要它,您可以从系统中删除 nvidia 驱动程序。另一种方法是使用 强制删除它rmmod -f,但我不建议这样做。

相关内容