Witko/nvidia-xrun

Merge with nvidia-xrun-pm

michelesr opened this issue · 3 comments

Hello @Witko, I would like to thank you for your brilliant project. I've been working on a fork that basically removed bbswitch and added a systemd service for automatically shutdown the NVIDIA card at boot. I've seen now that you somehow removed bbswitch by using a similar approach so maybe it makes sense to have a look if my fork could be merged again into the main project.

Let me know your thoughts.

There's something I don't understand about your approach: you're basically using the BUS_ID variable (that by default maps to 0000:00:01.0 that is the PCIe controller bus id).

Removing the PCIe port from the kernel, at least in my system (Dell XPS 9570) seems to power the card back again... it's like a reset for the controller.

In my fork instead I make sure the power control for the controller is set to auto and to keep the card idle: you wouldn't really need the remove command on the PCIe controller to power the card off, but unfortunately unless you issue the remove command programs will be able to load the nvidia module again and turn the card on by side effect (for example GNOME shell does that, and X does that as well if you use the modesetting driver when running the Intel card).

So in my fork instead of removing the actual controller, I remove the card (0000:01:00.0) directly, and then set back the controller to auto in order to power save. That seems to work properly (the card is powered off all the time, and programs won't be able to load the nvidia module anymore). Before rescanning though, you need to turn the controller power state on on otherwise the card won't be detected.

I tried your version of the scripts but is giving me problems, like:

  • sometimes the modules won't load
  • sometimes the remove command on the controller just hangs till I reboot the system

EDIT: the system hangs because the modules don't get unloaded (see #95)

@Witko: any update on this?

Witko commented

Hi @michelesr ,
thanks for your work. I had laptop issues(my Alienware R1 burned out) and it took some time to get a replacement. Now I'm a bit struggling with the new one - it has ACPI issues. So right now im still unable to test it. But i've merged the pull request as the change is obvious:)
Thanks again!!