如何找到哪个进程正在使用我的 GPU?

How can I find which process is using my GPU?

nvidia-smi 显示“未找到 运行 进程”。 lsof /dev/nvidia* 为空。然而,当我尝试做 nvidia-smi -r 它说:

# nvidia-smi -r -i 0
GPU 00000000:xxxxxx is currently in use by another process.

1 device is currently being used by one or more other processes (e.g., Fabric Manager, CUDA application, graphics application such as an X server, or a monitoring application such as another instance of nvidia-smi). Please first kill all processes using this device and all compute applications running in the system.

如何找到实际使用它的进程?

原来这个消息有点误导。只需执行 modprobe -r nvidia_drm 然后重置就会按预期工作。