8

I am trying to configure VirtualGL, and the configuration gives the following message:

IMPORTANT NOTE: Your system uses modprobe.d to set device permissions. You
must execute rmmod nvidia with the display manager stopped in order for the
new device permission settings to become effective.

When I try running rmmod nvidia (or with sudo), it says that module nvidia is in use:

rmmod: ERROR: Module nvidia is in use by: nvidia_uvm nvidia_modeset

I have already stopped my window manager by running sudo systemctl stop sddm.service, so when I check nvidia-smi it says that there are no processes running on the GPU.

Most of the threads I found on this issue are related to bumblebee, but I don't even have it insalled.

Output of nvidia-smi:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.40       Driver Version: 430.40       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1080    Off  | 00000000:01:00.0 Off |                  N/A |
| 33%   39C    P8    12W / 200W |      9MiB /  8119MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Ubuntu 18.04

1
  • 3
    Try to run modprobe -r nvidia_uvm; modprobe -r nvidia_modeset or if it fails change the order of the two modules. If you then still cannot modprobe -r nvidia add the output of lsmod | grep nvidia and lsof | grep nvidia to your question.
    – Thomas
    Aug 17, 2019 at 8:09

1 Answer 1

4

On Ubuntu 20.04, I've been able to fully unload and reload the NVIDIA modules with the following commands (performed via SSH or a text-only tty).

sudo service gdm3 stop

sudo rmmod nvidia_uvm
sudo rmmod nvidia_drm
sudo rmmod nvidia_modeset
sudo rmmod nvidia

# Then, reload them if desired:
sudo modprobe nvidia
sudo modprobe nvidia_modeset
sudo modprobe nvidia_drm
sudo modprobe nvidia_uvm

This came in handy e.g. when upgrading the NVIDIA driver without rebooting (which could happen unexpectedly via unattended apt upgrades).


As @Thomas pointed out in a comment, if there's still something preventing one of the modules from being unloaded, it's usually possible to figure out what with:

lsmod | grep nvidia
lsof | grep nvidia
1
  • I have a problem when I try to run 'sudo rmmod nvidia_modeset'. This is block by a process called nvidia-pe (I suppose this is the persistence deamon). How can I disable the deamon ? Nov 22, 2021 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.