Debian

如何解除安裝核心模組“nvidia-drm”?

  • April 23, 2022

我正在嘗試在 Debian Stretch 中安裝最新的 NVIDIA 驅動程序。我已經NVIDIA-Linux-x86_64-390.48.run這裡下載了,但是當我嘗試做

sudo sh ./NVIDIA-Linux-x86_64-390.48.run

按照建議,會出現一條錯誤消息。

ERROR: An NVIDIA kernel module 'nvidia-drm' appears to already be loaded in your kernel.  This may be because it is in use (for example, by an X server, a CUDA program, or 
        the NVIDIA Persistence Daemon), but this may also happen if your kernel was configured without support for module unloading.  Please be sure to exit any programs    
        that may be using the GPU(s) before attempting to upgrade your driver.  If no GPU-based programs are running, you know that your kernel supports module unloading,   
        and you still receive this message, then an error may have occured that has corrupted an NVIDIA kernel module's usage count, for which the simplest remedy is to     
        reboot your computer.

當我試圖找出誰在使用nvidia-drm(或nvidia_drm)時,我什麼也看不到。

~$ sudo lsof | grep nvidia-drm
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
     Output information may be incomplete.
~$ sudo lsof -e /run/user/1000/gvfs | grep nvidia-drm
~$

當我嘗試刪除它時,它說它正在被使用。

~$ sudo modprobe -r nvidia-drm
modprobe: FATAL: Module nvidia_drm is in use.
~$ 

我已經重新啟動並以純文字模式啟動(通過在提供使用者名/密碼之前按 Ctrl+Alt+F2),但我得到了同樣的錯誤。

除此之外,我如何“知道我的核心支持模組解除安裝”?

我在啟動時收到了一些與 nvidia 相關的警告,但不知道它們是否相關:

Apr 30 00:46:15 debian-9 kernel: nvidia: loading out-of-tree module taints kernel.
Apr 30 00:46:15 debian-9 kernel: nvidia: module license 'NVIDIA' taints kernel.
Apr 30 00:46:15 debian-9 kernel: Disabling lock debugging due to kernel taint
Apr 30 00:46:15 debian-9 kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module  375.82  Wed Jul 19 21:16:49 PDT 2017 (using threaded interrupts)

我想您想停止顯示管理器,我懷疑這將使用 Nvidia 驅動程序。

更改為文本控制台(按Ctrl++ AltF2並以 root 身份登錄後,使用以下命令禁用圖形目標,這使顯示管理器保持執行:

# systemctl isolate multi-user.target

此時,我希望您能夠使用modprobe -r(或rmmod直接)解除安裝 Nvidia 驅動程序:

# modprobe -r nvidia-drm

一旦你設法替換/升級它並且你準備好再次啟動圖形環境,你可以使用這個命令:

# systemctl start graphical.target

引用自:https://unix.stackexchange.com/questions/440840