Bumblebee-Project/Bumblebee — Issue #143: Bumblebee and Suspend
Author: ArchangeGabriel
Created: 2011-10-27 12:00:26+00:00
State: open
Labels: Bug, Dev Notice, High Priority, New Feature

First of all, going to suspend while an VGL X server is running means freeze (either while trying to go suspend or while trying to resume), so I think we should kill bumblebee X server if running while going to suspend.

Next, a lot of people are complaining about the fact they can't use bumblebee after suspend, and I've just confirmed that issue. The problem comes from Xorg/nvidia :
```[ 486.009] (EE) NVIDIA(0): Failed to initialize the NVIDIA GPU at PCI:1:0:0. Please
[ 486.009] (EE) NVIDIA(0): check your system's kernel log for additional error
[ 486.009] (EE) NVIDIA(0): messages and refer to Chapter 8: Common Problems in the
[ 486.009] (EE) NVIDIA(0): README for additional information.
[ 486.009] (EE) NVIDIA(0): Failed to initialize the NVIDIA graphics device!```

Note that it does not depend on whether PM is enabled or not.

However, rmmoding nvidia solves the issue.

Finally, some laptops needs their nvidia card to be ON when going to suspend.

So, what I'm suggesting is to do the following :
-stop bumblebee service when suspending
-start it again when resuming

With stopping the service doing the followings :
- if nvidia is loaded then :
- check is bumblebee X server is running, and kill it in this case
- rmmod nvidia
- else, if the card is disabled, enable it

And starting the daemon should do the followings :
- rmmod any driver even if PM is disabled (we're having some issue with nvidia loading just after rmmoding nouveau)
- if PM is enabled, disable the card