Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unable to rmmod nvidia
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
reikdas
Apprentice
Apprentice


Joined: 27 Nov 2018
Posts: 238

PostPosted: Thu Jan 10, 2019 7:38 pm    Post subject: Unable to rmmod nvidia Reply with quote

I am unable to do rmmod nvidia.
This is my nvidia-rmmod conf - (I set it up with uvm and kms after first getting bumblebee to work as shown in the wiki)
Code:
reik@reik-msi /etc/modprobe.d $ cat nvidia-rmmod.conf
# Nvidia UVM support

remove nvidia modprobe -r --ignore-remove nvidia_drm nvidia_modeset nvidia_uvm nvidia

These are the errors I faced while trying to rmmod nvidia -
Code:
reik-msi /home/reik # rmmod nvidia
rmmod: ERROR: Module nvidia is in use
reik-msi /home/reik # rmmod nvidia_drm
rmmod: ERROR: Module nvidia_drm is not currently loaded
reik-msi /home/reik # rmmod nvidia_uvm
rmmod: ERROR: Module nvidia_uvm is not currently loaded
reik-msi /home/reik # rmmod nvidia_modeset
rmmod: ERROR: Module nvidia_modeset is not currently loaded


I built Nvidia with UVM and KMS for bumblebee, so I need nvidia_drm, nvidia_uvm and nvidia_modeset.
Also I have nvidia as a module in /etc/conf.d/modules.
_________________
[19:18] <@NeddySeagoon> Gentoo has an installer. Just like other distros. Go to the bathroom, look in the mirror. You will see the Gentoo installer :)
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Thu Jan 10, 2019 8:40 pm    Post subject: Reply with quote

is xorg still running?

This is the bash alias I have to stop xorg, unload nvidia, reload nvidia, start xorg

Code:
alias nvidia="/etc/init.d/xdm stop && rmmod nvidia_drm && rmmod nvidia_modeset && rmmod nvidia && modprobe nvidia && /etc/init.d/xdm start"

_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
reikdas
Apprentice
Apprentice


Joined: 27 Nov 2018
Posts: 238

PostPosted: Fri Jan 11, 2019 6:49 am    Post subject: Reply with quote

Naib wrote:
is xorg still running?

This is the bash alias I have to stop xorg, unload nvidia, reload nvidia, start xorg

Code:
alias nvidia="/etc/init.d/xdm stop && rmmod nvidia_drm && rmmod nvidia_modeset && rmmod nvidia && modprobe nvidia && /etc/init.d/xdm start"


When I ran that, since my display manager stopped, I was pushed out to tty and my display manager did not start back up, so I am not sure if the rest of the commands worked :(
_________________
[19:18] <@NeddySeagoon> Gentoo has an installer. Just like other distros. Go to the bathroom, look in the mirror. You will see the Gentoo installer :)
Back to top
View user's profile Send private message
Dwosky
Tux's lil' helper
Tux's lil' helper


Joined: 07 Nov 2018
Posts: 135

PostPosted: Fri Jan 11, 2019 6:02 pm    Post subject: Re: Unable to rmmod nvidia Reply with quote

reikdas wrote:

These are the errors I faced while trying to rmmod nvidia -
Code:
reik-msi /home/reik # rmmod nvidia
rmmod: ERROR: Module nvidia is in use

You can use lsmod to list the modules but also to check what's their parent process or what process its stopping you from removing the module.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Sat Jan 12, 2019 9:50 am    Post subject: Reply with quote

reikdas wrote:
Naib wrote:
is xorg still running?

This is the bash alias I have to stop xorg, unload nvidia, reload nvidia, start xorg

Code:
alias nvidia="/etc/init.d/xdm stop && rmmod nvidia_drm && rmmod nvidia_modeset && rmmod nvidia && modprobe nvidia && /etc/init.d/xdm start"


When I ran that, since my display manager stopped, I was pushed out to tty and my display manager did not start back up, so I am not sure if the rest of the commands worked :(


this command shouldn't push you out to a tty because you need to be in a tty... IF you ran this from within Xorg (gnome,kde,openbox...) then ONCE xdm has stopped then you will go to a tty... Now maybe aspects of the rmmod started so that part of the drivers were removed BUT it wouldn#'t be able to complete because the terminal would have been killed

This is what you need todo

1) CTRL-ALT-F1 to switch to a tty
2) login as root
3) execute etc/init.d/xdm stop && rmmod nvidia_drm && rmmod nvidia_modeset && rmmod nvidia && modprobe nvidia && /etc/init.d/xdm start (hence why I have this as an alias for root)
* xorg should stop, nvidia unloaded, nvidia loaded, xorg should start


Now if this fails there maybe some additionals associated with your setup (systemd as oppose to openrc, some additional drivers...) and if that is the case the steps would be

1) CTRL-ALT-F1 to switch to a tty
2) login as root
3) /etc/init.d/xdm stop
3) rmmod nvidia
*) check error message
4) lsmod
5) rmmod $some_other_module
...
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2284
Location: Adendorf, Germany

PostPosted: Mon Jan 14, 2019 2:44 pm    Post subject: Reply with quote

As there are "sub"-modules now, like drm and uvm, "rmmod" is not the best idea.
Better to configure to use "modprobe -r" like reikdas did above.

Copy&Paste: (I am not on my laptop...)
Code:
$ cat nvidia-rmmod.conf
# Nvidia UVM support

remove nvidia modprobe -r --ignore-remove nvidia_drm nvidia_modeset nvidia_uvm nvidia

The crux is: 'rmmod" ignores this! Use 'modprobe -r nvidia' and it should just work.
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum