Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement USE_BBSWITCH option #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

MicroDroid
Copy link
Contributor

On my system, both methods crash and do not turn off GPU correctly (it stays on, despite being not even visible in lspci). Other times it even causes tee to become a zombie process using 100% of CPU forever, making me have to restart my entire machine.

After some trial and error, bbswitch seemed to be the only stable and working solution. The turn_off_gpu.sh script bundled with acpid didn't work either.

Thus, I implemented this feature and tested it on my machine, so far it works flawlessly without issues.

Signed-off-by: Yousef Sultan <[email protected]>
@ghost
Copy link

ghost commented Oct 16, 2019

I would very much like this and I have adjusted my setup to use bbswitch (turning off any included powersave features) because the bbswitch method allows me to have my intel x server, switch to another tty, bbswitch ON the card and use it, bbswitch OFF and return to first tty like nothing happened.

With the included method, the card sometimes comes up on its own (maybe the system does a PCI rescan) and also there is no way to check if the card is off.

Of note is the fact that there is no need for nvidia-xrun to run anything with bbswitch on startup (like the systemd service it has right now). You can set the bbswitch module to load on boot by itself and turn the card off.

On Arch you can do this wih 2 files:
/etc/modules-load.d/bbswitch.conf (load bbswitch on startup)

bbswitch

and
/etc/modprobe.d/bbswitch.conf: (turn off the card on load)

options bbswitch load_state=0

@MicroDroid
Copy link
Contributor Author

@JpegXguy nvidia-xrun is designed specifically to be used in another tty, so no, bbswitch is mandatory for that.

That said, I also had the auto power on issue, it turned out to happen when I unplug my laptop, removing laptop-mode-tools did fix that.

I still eventually had to use bbswitch though due to the said zombie process issue.

BobbyWibowo referenced this pull request in BobbyWibowo/nvidia-xrun Oct 23, 2019
@osleg
Copy link

osleg commented Oct 23, 2019

Oh lol I just did the same in #139 -_-

@MicroDroid
Copy link
Contributor Author

MicroDroid commented Oct 23, 2019 via email

@ghost
Copy link

ghost commented Oct 24, 2019

@JpegXguy nvidia-xrun is designed specifically to be used in another tty, so no, bbswitch is mandatory for that.

That said, I also had the auto power on issue, it turned out to happen when I unplug my laptop, removing laptop-mode-tools did fix that.

I still eventually had to use bbswitch though due to the said zombie process issue.

Your implementation is fine, and what I'd be using if it got merged. My previous comment was about the handy reality that we wouldn't need a systemd service at boot to turn off the card, like the one used right now by nvidia-xrun

@MicroDroid
Copy link
Contributor Author

@JpegXguy ah yeah that's right. Though relevant to your issues I'm also having a problem where GPU fails to unload modules unless I close all other running sessions. So running in a tty would end up failing to unload modules unless I am signed out of other sessions.

Not sure if you had that issue

@MicroDroid
Copy link
Contributor Author

Something makes me think gdm or something is locking the modules as soon as they are loaded

@osleg
Copy link

osleg commented Oct 24, 2019 via email

@ghost
Copy link

ghost commented Oct 24, 2019

@JpegXguy ah yeah that's right. Though relevant to your issues I'm also having a problem where GPU fails to unload modules unless I close all other running sessions. So running in a tty would end up failing to unload modules unless I am signed out of other sessions.

Not sure if you had that issue

I had this when I tried using nouveau for the powermanagement.
Currently I switch to another tty, bbswitch on and do my job. Then bbswitch off. Never switch back to the tty with the other Xserver before the nvidia session ends.
Seems like X doesn't notice the card if I do that.

@MicroDroid
Copy link
Contributor Author

Ahh yes, you both were right! I'll make another PR to put this in README as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants