如何卸载 NVIDIA 内核模块“nvidia”以安装新驱动程序?

Bra*_*Lee 9 ubuntu gpu nvidia tensorflow ubuntu-18.04

我需要升级我的 nvidia 驱动程序,以便我尝试运行NVIDIA-LInux-x86_64.run文件

但是,我看到以下消息

ERROR: An NVIDIA kernel module 'nvidia' 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.
Run Code Online (Sandbox Code Playgroud)

我已经卸载了nvidia-drm,当我尝试卸载时nvidia

$ sudo modprobe -r nvidia
modprobe: FATAL: Module nvidia is in use.
Run Code Online (Sandbox Code Playgroud)

谁能指导我毫无问题地安装这个新驱动程序?

谢谢

mzh*_*ang 12

用于lsof /dev/nvidia*查找正在使用旧驱动程序的进程。就我而言,它是“nvidia-persistence”。只需通过 pid 终止进程并重试安装程序 NVIDIA-***.run

# lsof /dev/nvidia*
COMMAND    PID                USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
nvidia-pe 1334 nvidia-persistenced    2u   CHR 195,255      0t0  420 /dev/nvidiactl
nvidia-pe 1334 nvidia-persistenced    3u   CHR   195,0      0t0  421 /dev/nvidia0
nvidia-pe 1334 nvidia-persistenced    5u   CHR   195,0      0t0  421 /dev/nvidia0
nvidia-pe 1334 nvidia-persistenced    6u   CHR   195,0      0t0  421 /dev/nvidia0
nvidia-pe 1334 nvidia-persistenced    7u   CHR   195,0      0t0  421 /dev/nvidia0
Run Code Online (Sandbox Code Playgroud)


Bra*_*Lee 1

我刚刚删除了现有的驱动程序并重新安装