Bumblebee-Project / bbswitch

Disable discrete graphics (currently nvidia only)
GNU General Public License v2.0
487 stars 78 forks source link

nVidia card is ON after resuming from sleep #90

Open ov1d1u opened 10 years ago

ov1d1u commented 10 years ago

Hi,

Sometimes after I resume my laptop from sleep my nVidia card turns on and stays on even if there isn't any application using it (fuser -v /dev/nvidiactl returns nothing). Running something like optirun echo turns it off. I'm not able to reproduce this every time and it seems to happens only when I'm on battery.

I'm using bumblebee 3.1.4 on Manjaro Linux x86_64 with 3.13.1-1 kernel (but this happens with other kernels, too). My desktop environment is KDE and the videocard is nVidia 740M. If you need any further details about my system configuration, feel free to ask.

Is there any way to force the nVidia card to go off after resuming the system?

intelfx commented 10 years ago

Affected too. Arch current, Nvidia 540M.

tohyf commented 9 years ago

Oops, I didn't notice about this issue and I posted it as issue #107 ....

ArchangeGabriel commented 8 years ago

They are existing issues with suspend for sure. If any of you still have issue here, please tell so in order for those to be included in the incoming summary.

tapir commented 7 years ago

I have this issue on Xiaomi Air 13 laptop. Everytime laptop is resumed, nvidia is turned on. Arch linux head.

Lekensteyn commented 7 years ago

@tapir Issues like this can be device specific, better to create new issue. And always include relevant log files (for example journalctl -b > journal.txt) and upload a tarball according to https://bugs.launchpad.net/lpbugreporter/+bug/752542

bm0 commented 6 years ago

@tapir I have the same laptop with the same problem OS: Arch Linux

I also described this problem at https://github.com/Bumblebee-Project/Bumblebee/issues/830

mihkel-t commented 4 years ago

As this issue is still open, I'm digging it up a bit. I'm also running Arch, with nvidia-dkms and nvidia-utils installed and Bumblebee working correctly (both after cold boot and after resuming from standby).

It seems the issue is at least here and now caused by the presence of this file: /usr/lib/systemd/system-sleep/nvidia (owned by nvidia-utils), with contents:

#!/bin/sh

case "$1" in
    post)
        /usr/bin/nvidia-sleep.sh "resume"
        ;;
esac

What solved the issue (or rather, worked around it) on my system was to create a file called e.g. 00-bumblebee.sh in the same directory, /usr/lib/systemd/system-sleep/, with following contents [1]:

#!/bin/sh
case $1/$2 in
  pre/*)
    systemctl stop bumblebeed.service
    ;;
  post/*)
    systemctl start bumblebeed.service
    ;;
esac

Now Bumblebee service is turned off early during suspend sequence, and the Nvidia card isn't getting turned on anymore on resume, as confirmed by nvidia-smi and optirun --status.

[1] Based on https://github.com/Bumblebee-Project/Bumblebee-old/issues/147, via https://github.com/Bumblebee-Project/Bumblebee/issues/830