bumblebee: bbswitch-dkms causes forced shutdown (even in reboot)

Bug #1231725 reported by Sergio Benjamim
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bumblebee (Ubuntu)
Confirmed
Undecided
Bruno Pagani

Bug Description

I instaled bumblebee-nvidia for Optimus support in my Asus laptop and bbswitch-dkms causes forced shutdown, even if I reboot system. My HDD makes a loud noise, It is as if the power went out, the forced shutdown is very violent (there is not plymouth shutdown screen). I know that bbswitch is used for turn on and turn off nvidia card, but somehow it is affecting shutdown/reboot.

Steps to reproduce:

- Install nvidia-319-updates (319.49) and bumblebee-nvidia (in trusty, nvidia-331-updates and bumblebee package);
- Configure bumblebee files to works with nvidia module;
- Reboot system, bbswitch will be active in the next login;
- After login system, try to turn off the system, or reboot. System will causes a forced shutdown (it seems it can be reproduced if you use nvidia card in the session);

There is workaround to avoid this problem, runs:

sudo modprobe -r bbswitch

before every shutdown or reboot.

Or add the next initscript (/etc/init/bbswitch.conf) :

description "Save power by disabling nvidia on Optimus"
author "Lekensteyn <email address hidden>"
start on runlevel [2345]
stop on runlevel [016]
pre-start exec /sbin/modprobe bbswitch load_state=0 unload_state=1
pre-stop exec /sbin/rmmod bbswitch

More info: https://github.com/Bumblebee-Project/bbswitch

Please, this is a important (and dangerous) bug, anyone that tries to get Optimus tecnology works in Ubuntu and uses Bumblebee probably will get a HDD broken in a few months of use, without knowing why.

---

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: ubiquity 2.17.1
ProcVersionSignature: Ubuntu 3.12.0-7.15-generic 3.12.4
Uname: Linux 3.12.0-7-generic x86_64
ApportVersion: 2.12.7-0ubuntu2
Architecture: amd64
CasperVersion: 1.336ubuntu1
Date: Tue Dec 17 01:55:05 2013
LiveMediaBuild: Xubuntu 14.04 LTS "Trusty Tahr" - Alpha amd64 (20131216)
ProcEnviron:
 LANGUAGE=en_US
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ubiquity
UpgradeStatus: No upgrade log present (probably fresh install)

Ubuntu Saucy Salamander (development branch) \n \l

Linux sergio-X751JB 3.11.0-8-generic #15-Ubuntu SMP Fri Sep 20 04:11:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

baseboard-manufacturer: ASUSTeK COMPUTER INC.
baseboard-product-name: X750JB
baseboard-version : 1.0
system-manufacturer : ASUSTeK COMPUTER INC.
system-product-name : X750JB
system-version : 1.0
bios-vendor : American Megatrends Inc.
bios-version : X750JB.207
bios-release-date : 05/24/2013

optirun (Bumblebee) 3.2.1

bbswitch-dkms:
  Installed: 0.7-2
  Candidate: 0.7-2
  Version table:
 *** 0.7-2 0
        500 http://archive.ubuntu.com/ubuntu/ saucy/universe amd64 Packages
        100 /var/lib/dpkg/status

00:02.0 VGA compatible controller [0300]: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller [8086:0416] (rev 06) (prog-if 00 [VGA controller])
01:00.0 3D controller [0302]: NVIDIA Corporation GK208M [GeForce GT 740M] [10de:1292] (rev ff) (prog-if ff)

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: bbswitch-dkms 0.7-2
ProcVersionSignature: Ubuntu 3.11.0-8.15-generic 3.11.1
Uname: Linux 3.11.0-8-generic x86_64
ApportVersion: 2.12.4-0ubuntu1
Architecture: amd64
Date: Thu Sep 26 23:41:36 2013
InstallationDate: Installed on 2013-09-20 (6 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Alpha amd64 (20130920)
MarkForUpload: True
SourcePackage: bbswitch
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Sergio Benjamim (sergio-br2) wrote :
tags: added: bumblebee
description: updated
Revision history for this message
Ivan Kukobko (ivan-kukobko) wrote :

My laptop shuts down when I run programs with primusrun or optirun. Is about this dkms issue, or sould I report to compiz one ( https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/981076 )

Revision history for this message
Vincent Cheng (vincent-c) wrote :

What happens if you try to tell bbswitch not to disable your nvidia card at shutdown? To accomplish this, see the "Enable card on shutdown" section in /usr/share/doc/bbswitch-dkms/README.md.gz, i.e.:

### Enable card on shutdown

Some machines do not like the card being disabled at shutdown.
Add the next initscript (`/etc/init/bbswitch.conf`) :
     description "Save power by disabling nvidia on Optimus"
     author "Lekensteyn <email address hidden>"
     start on runlevel [2345]
     stop on runlevel [016]
     pre-start exec /sbin/modprobe bbswitch load_state=0 unload_state=1
     pre-stop exec /sbin/rmmod bbswitch

Changed in bbswitch (Ubuntu):
status: New → Incomplete
Revision history for this message
Sergio Benjamim (sergio-br2) wrote :

Well, it works fine.

Changed in bbswitch (Ubuntu):
status: Incomplete → New
tags: added: trusty
description: updated
Revision history for this message
Sergio Benjamim (sergio-br2) wrote :

It seems that nvidia-prime bring a solution for this bbswitch issue:

"- Make sure that NVIDIA is always enabled on shutdown.
      This will avoid issues with the BIOS." -- changelog of version 0.5

So, is it better to change the package affected to bumblebee? It should install /etc/init/bbswitch.conf, like comment #3.

(see Bug #1268217, there is a problem about bumblebee and nvidia-prime, the 2 packages must conflict, but they don't)

affects: bbswitch (Ubuntu) → bumblebee (Ubuntu)
summary: - bbswitch-dkms causes forced shutdown (even in reboot)
+ bumblebee: bbswitch-dkms causes forced shutdown (even in reboot)
Revision history for this message
Bruno Pagani (b-pagani) wrote :

I have suscribed both myself and Peter Lekensteyn to this bug.

Peter, do you think we should install the bbswitch.conf file by default to remove bbswitch on halt for everyone? I see no downside of doing these, since powered on card on exit won’t hurt anyone, while it helps some people.

Changed in bumblebee (Ubuntu):
assignee: nobody → Bruno Pagani (b-pagani)
status: New → Confirmed
Revision history for this message
Peter Wu (lekensteyn) wrote :

The bbswitch init script is only recommended if you do not use bumblebee with bumblebeed.

Otherwise, I suggest to set `TurnCardOffAtExit=false` in /etc/bumblebee/bumblebee.conf.

Revision history for this message
Bruno Pagani (b-pagani) wrote :

Sorry for the delay…

I meant, it’s recommended only when you don’t use bumblebeed, but do you think it can cause any harm if installed for everyone? For instance, can this conflict with the setting in bumblebeed?

Currently, bumblebeed starts, loads bbswitch, and shutdown the card. Right? On exit (with "TurnCardOffAtExit=false" which is the default and that I suspect to be set like that in above case, without preventing the issue to happen for an unknown reason)

If I have /etc/modprobe.d/bbswitch.conf with "options bbswitch load_state=1 unload_state=1" and I start bumblebeed, bbswitch won’t turn off the card on start, then bumblebeed will ask him to do so, and the card will still be disabled on bumblebeed start, right?

With load_state=0, bbswitch will disable the card when modprobed for bumblebeed, then bumblebeed will see the card is already disabled and won’t ask bbswitch to turn it off, correct?

Next, if I stop bumblebeed, it will turn on the card and remove bbswitch, which will do nothing since the card is already ON. Does bumblebee remove bbswitch if I set "TurnCardOffAtExit=true"? If so, it seems to me to be an issue because then the card won’t be powered on again before shutdown, and even if not, having the modprobe conf file seems needed, else on shut down when bbswitch will be removed, it won’t turn ON the card, right?

Finally, similarly to this latest case, what if bumblebee get killed for any reason? Does it handle correctly bbswitch and PM in this case before being killed? I suppose not, because a killed program is not supposed to do anything, right?

So if I’m all right, I think we might ship /etc/modprobe.d/bbswitch.conf with "options bbswitch load_state=0 unload_state=1" in bbswitch-dkms package.

Revision history for this message
Peter Wu (lekensteyn) wrote :

The default params are load_state=-1 unload_state=-1 ("do not change").

bumblebeed will write OFF to /proc/acpi/bbswitch which has no effect if it was already off. So it does not matter what values you use for load_state, the end result will be comparable to load_state=0.

On stop, bumblebeed does not rmmod bbswitch. It writes OFF to /proc/acpi/bbswitch (having the same effect as unload_state=0 && rmmod bbswitch).

Creating the bbswitch.conf modprobe conffile won't help if nothing unloads the module (as mentioned in the README). There are probably kernel interfaces to get notified on shutdown, maybe that could be used. On kernel panic and such, it will not be called anyway though.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.