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

An option to unload the driver even without active PM method #983

Merged
merged 1 commit into from Dec 31, 2018

Conversation

@yawor
Copy link

commented Aug 22, 2018

On the ArchLinux forum there's a discussion regarding bumblebee/bbswitch support for Dell XPS 15 9570. Dell has changed something with this model which broke bbswitch.
On the other hand the standard Linux power management is able to properly turn off the card. If /sys/bus/pci/devices/0000:01:00.0/power/control (PCI bus for the dGPU in Dell) is set to auto and no driver for the card is loaded (or gets unloaded), Linux shuts down the power to the card (confirmed in powertop and with the extended work time on the battery) and turns it on when the module is loaded. This means that bbswitch is not needed in case of this model (shouldn't even be installed in the system), but we still need Bumblebee to unload the module.
This PR adds AlwaysUnloadKernelDriver boolean configuration option, which can be added to driver-* section. If it's not added or is set to false, then Bumblebee works as before. But when this option is set to true, then even with PM method disabled, Bumblebee unloads the driver.

@djrollins

This comment has been minimized.

Copy link

commented Aug 27, 2018

Hey. Just wanted to post and confirm @yawor's findings.

Removing bbswitch and using Linux PM allows optirun/primusrun to work perfectly. Manually unloading the modules afterwards results in a substantial drop in power draw implying it is switching off the card correctly. (15W -> 5W as measured by powertop).

Having bumblebee handle unloading of modules automatically would be a great QoL addition.

@davidschlegel

This comment has been minimized.

Copy link

commented Sep 1, 2018

Is there a chance to have this PR accepted soon? Would be great to have bumblebee working on the Dell xps 9570.

@trgeiger

This comment has been minimized.

Copy link

commented Sep 5, 2018

I can also confirm that this works on my XPS 9570. Been running this PR version for a week or so now.

@rdaysky

This comment has been minimized.

Copy link

commented Dec 8, 2018

I have also been able to get optirun to work using this on a Dell XPS 9570. However, stock Ubuntu bumblebee 3.2.1-17 works just as fine, the only difference is the option to automatically upload the modules. (Without it, you can simply unload the modules manually.)

There is a strange problem with this pull request, however. When AlwaysUnloadKernelDriver=true is added to the [driver-nvidia] section, everything works great until I log out of X and back in. That causes the infamous “NVRM: RmInitAdapter failed” message to appear and optirun is unusable until I reboot. Without the parameter (or using stock Bumblebee) logging out and back in causes no problems and optirun works.

Ubuntu 18.10
nvidia-driver-415 415.18-0ubuntu0~gpu18.10.2
linux-image-unsigned-4.20.0-042000rc5-generic 4.20.0-042000rc5.20181203072
KDE, SDDM

@phkb01

This comment has been minimized.

Copy link

commented Dec 18, 2018

It seems it also works on a Clevo N8xEJEK (PCSpecialist Cosmos VII) with a GTX 1050.
I had to activate linux power management for the card (was not on auto by default).

The Device stats tab of powertop reports 0% usage for the Nvidia card when not using it, and 100% when optirun is running, so I guess it works. Unlike bbswitch, which makes the system freeze when powering off the card...

@Olorin92

This comment has been minimized.

Copy link

commented Dec 28, 2018

Could anyone point me in the right direction as to how I can apply this patch to my current bumblebee package? I’m running Arch Linux but not sure how to do this...

@bluca bluca requested review from ArchangeGabriel and Lekensteyn Dec 28, 2018

@bluca

This comment has been minimized.

Copy link
Member

commented Dec 28, 2018

@ArchangeGabriel @Lekensteyn what do you think? I'm looking to do a final upload to Debian before the Buster freeze, and was wondering if there's more patches that I can backport and this looks like a good candidate

@Lekensteyn

This comment has been minimized.

Copy link
Member

commented Dec 30, 2018

Hey @bluca , the change looks reasonable. It could be improved by editing the sample conf/bumblebee.conf.in file, but otherwise it looks good to me.

@bluca

This comment has been minimized.

Copy link
Member

commented Dec 31, 2018

Ok thanks, I can send a follow-up that edits the template. I'll merge and upload to the testing PPA later.

@bluca bluca merged commit 61c6161 into Bumblebee-Project:develop Dec 31, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bluca

This comment has been minimized.

Copy link
Member

commented Jan 1, 2019

I have pushed new versions with the latest changes from devel to the PPA for 14.04, 16.04 and (new) 18.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.