I seriously tried so many things that I probably will forget something, but here goes
I use
- stock bumblebee
- stock bbswitch
- stock bumblebeed started by systemd
But, my bootloader entry has this thing on the kernel line
acpi_osi="!Windows 2015" pcie_port_pm=off
And I think that after man trials, thy are the ones the fixed it (well, a few things have changed upstream also I'd guess kernel/bumblebee wise).
Anyway, now I can start stuff with primusrun and not cripple my fancy laptop to get decent battery life out of it, still a bit lower than windows, but if memory servers the original was barely 2h, I can easily do 5-6h now just doing normal stuff like watching youtube and whatnot.
For good measure, between the screenshot and now gnome reports 30% battery left and 1h46, but it still goes very fast between 100 to say 70% and the very last 10% and does not seem super reliable, could be unrelated.
Or maybe, I also think that some power management thingy kicks in at lower battery level, which makes it drain faster when it is almost full but makes the last 50% lasts much longer. Or the indicator is juts plain broken, still wondering.
I like control of my backlight so I'm not using any kernel boot parameters. Instead I get my 7-10W dischage by simply NOT using bbswitch with bumblebee. If I know I won't be playing any games, using openCL, or if I need to conserve battery I run
#powertop --auto-tune
Powertop will completely shut down the GPU and I cut 10W off of my power usage. Unfortunately there's an ill effect of this- unless I reboot the laptop I can't seem to revive the GPU once I have powertop kill it.
Despite killing the GPU until the next restart, I think this is a great method to squeeze as much battery life out of the laptop as possible. Being able to set the screen to a minimum and turn off the keyboard backlight can easily get me an extra hour if I find myself travelling or simply being without an outlet.
Kernel is linux-git as of 2017-28-06.
bumblebee-git
nvidia-dkms 381.22-3
I also gave a try regarding these new tricks, but it still hangs on bumblebee + gdm unfortunately. Although, I went to dig for the windows 2009 trick to see what it meant and turns out it report to the bios we are running windows 7 (default is to report windows NT, must be for compatibility reasons with old computers).
Using acpi_osi='Windows 2015' will report as running windows 10 (only works on kernel >= 4.2), and now I no longer have freezing issues nor sleep issues (I did not use the acpi_osi=! line though, as it remove all valid acpi_osi options from the driver or something like that, and we add back windows after, so you might get different effects), everything seems to work a-ok so far, battery does not drain like crazy and everything start up normally afterwards. My backlight Fn buttons also work as expected without any tweaking.
Only issue is I still need to start the whole bumblebee thing by hand. I also only lightly tested sleep a few times, seems to work, if anyone else wants to give it a try.
]]>with no kernel parameters setting backlight using fn keys works, bumblebee also works, but I have to start the bumbleed.service later and cannot enable it, there are also some freezes eg. when locking the screen with nvidia gpu turned off.
with
acpi_backlight=native acpi_osi=! acpi_osi='Windows 2009'
I had no freezes, I can enable bumblebeed.service and setting backlight using xbacklight indeed works, but I can no longer set backlight using Fn keys (which I have mapped to change backlight using xbacklight).
with just
acpi_osi=! acpi_osi='Windows 2009'
it's the same as above but xbacklight doesn't work at all.
So for now I will stick with
acpi_backlight=native acpi_osi=! acpi_osi='Windows 2009'
as I rarely change the backlight. Thanks for the advice.
]]> rw quiet i915.enable_execlists=0 acpi_backlight=native acpi_osi=! acpi_osi='Windows 2009' i915.enable_rc6=1 i915.enable_fbc=1 pcie_aspm=force
I don't have freez problem you said. and I can set the bcklights with
xdotool key --clearmodifiers XF86MonBrightnessUp
xdotool key --clearmodifiers XF86MonBrightnessDown
and
xbacklight -inc 10
xbacklight -dec 10
xdotool way shows the popup light icons as you increase or decrease. but xbacklight does not, and it cannot change the brightness bar in gnome-shell menu. but xbacklight is more smoother than xdotool, it feels better. you can assign keyboard shortcuts for these command. such as Super+f5/f6
I had some freez problem after logout, which I noticed it's because of plymouth!!! removed plymouth and those freezes gone for ever.
]]>For now I use lightdm's session-setup-script to automatically start bumblebeed.service when I log in, but I will take another look at those parameters, since they seem to work better.
]]> acpi_osi=! acpi_osi="Windows 2009"
but now backlight Fn keys are broken. even if I add acpi_backlight=native to the kernel line. acpi_osi= shuold not be used, because it causes freeze.
]]>To allow X to start without locking up when the GPU is powered down via bbswitch, replace the acpi_osi= above with:
acpi_osi=! acpi_osi="Windows 2009"
ok,
1. add options for bbswitch module like this:
write this
options bbswitch load_state=0 unload_state=1
to this file:
nano /etc/modprobe.d/bbswitch.conf
2. now building a service which runs at boot:
sudo nano /etc/systemd/system/bbswitchoff.service
with this content:
[Unit]
Description=bbswitch off state to nvidia
[Service]
ExecStart=/usr/bin/bbswitchoff
[Install]
WantedBy=multi-user.target
3. now making a script which loads bbswitch module 60 secs after boot (which is enough)
sudo nano /usr/bin/bbswitchoff
with this content:
#!/bin/sh
sleep 60 # one min
sudo modprobe bbswitch
then
sudo chmod +x /usr/bin/bbswitchoff
now enabling our service:
sudo systemctl enable bbswitchoff.service
now make a reboot. from now on, every time you boot this service starts and call the bbswitch 60s after start. in this way your nvidia card is off and you see the battery life increase.
check the nvidia status by:
cat /proc/acpi/bbswitch
which reterns:
0000:01:00.0 OFF
I don't use linux as my primary system right now, so I can't really confirm that, but as far as I can tell I can boot just fine with bumblebee disabled and then start it manually after logging in.
]]>1. Having bbswitch load is always a no go and leads to a hard freeze.
2. I can boot to gdm with bumblebee off, log in, then start bumblebee to turn off the nvidia card with bbswitch. Everything, including prime, seems to work and I go from 35W to 20W of usage.
3. I can boot to gdm, but sometime (1 out of 3), the screen just boots to black (with backlight) and all subsequent boot have this problem.
Booting to multi-user from systemd-boot will also do that, so it's not a gdm issue.
4. When this happen, I just boot to the 4.5 kernel (for which I did not build bbswitch), and then the next boot to 4.4 will work fine, for some time. No idea if the card is wrongly set up sometimes on shutdown, but this has fixed it everytime so far
5. Sleep kinds of put the computer to sleep, except the graphic card (even with bbswitch as off), so I don't know if it even works. This leads to battery drain + the fan kicks in sometime.
So basically there is no surefire way to make it work so far. As for disabling the nvidia card forever, now that nouveau supports the 900 series, that might be possible in a few mesa and kernel version down the line, who knows (or soon by building your own versions from git I guess).
]]>Anyway they only seem to be discussing the GPU shutdown issue and not the boot hangs with bumblebee enabled, maybe it's unrelated.
]]>might be the same as your patch, but this one still does not fix everything.
]]>$ cat /proc/acpi/bbswitch
0000:02:00.0 OFF
$ primusrun glxgears -info
$ cat /proc/acpi/bbswitch
0000:02:00.0 OFF
However it still doesn't solve the issue with not being able to boot with bumblebee enabled But at least that's one problem less
I compiled it using the bumblebee-git AUR package and changing the source in PKGBUILD to
source=("$_gitname::git://github.com/arafey/Bumblebee.git#branch=master")
I compared the changes to official bumblebee project and right now (as of the commit linked above) it only contains the one fix and seems to be OK (eg. not malicious), but ofc that can change in the future, so be careful.
BTW: I tried chromium and it didn't turn my GPU on.
]]>