"error: Could not enable discrete graphics card" after wake up from suspend

bumblebee
nvidia
suspend

#1

Distro: Manjaro KDE Edition 17.0.5
Kernel: 4.9.51-1-MANJARO
Model: HP Pavilion 15-n233sl with Intel Core i7-4500U
Graphic cards:

  • Integrated: Intel HD 4400
  • Discrete: NVIDIA GeForce GT 740M (PCI: 0a:00.0)
    Bumblebee version: optirun (Bumblebee) 3.2.1

Behaviour: Before suspending, “optirun” works fine, though the last line in systemlog sounds suspicious:
ott 01 14:55:56 Void kernel: bbswitch: enabling discrete graphics ott 01 14:55:57 Void kernel: nvidia-modeset: Allocated GPU:0 (GPU-63e62e05-5940-9c26-5368-5bd666cfcc0c) @ PCI:0000:0a:00.0 ott 01 14:55:57 Void kernel: nvidia-modeset: Freed GPU:0 (GPU-63e62e05-5940-9c26-5368-5bd666cfcc0c) @ PCI:0000:0a:00.0 ott 01 14:56:20 Void kernel: bbswitch: disabling discrete graphics ott 01 14:56:20 Void kernel: pci 0000:0a:00.0: Refused to change power state, currently in D0

After suspend and wake up, “optirun” returns:
[ 2861.882768] [ERROR]Cannot access secondary GPU - error: Could not enable discrete graphics card
[ 2861.882796] [ERROR]Aborting because fallback start is disabled.

Systemlog says:
ott 01 14:59:28 Void kernel: bbswitch: enabling discrete graphics ott 01 14:59:28 Void kernel: pci 0000:0a:00.0: Refused to change power state, currently in D3

Bumblebee configuration is:
# Configuration file for Bumblebee. Values should **not** be put between quotes

## Server options. Any change made in this section will need a server restart
# to take effect.
[bumblebeed]
# The secondary Xorg server DISPLAY number
VirtualDisplay=:8
# Should the unused Xorg server be kept running? Set this to true if waiting
# for X to be ready is too long and don't need power management at all.
KeepUnusedXServer=false
# The name of the Bumbleblee server group name (GID name)
ServerGroup=bumblebee
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
TurnCardOffAtExit=false
# The default behavior of '-f' option on optirun. If set to "true", '-f' will
# be ignored.
NoEcoModeOverride=false
# The Driver used by Bumblebee server. If this value is not set (or empty),
# auto-detection is performed. The available drivers are nvidia and nouveau
# (See also the driver-specific sections below)
Driver=nvidia
# Directory with a dummy config file to pass as a -configdir to secondary X
XorgConfDir=/etc/bumblebee/xorg.conf.d
# Xorg binary to run
XorgBinary=Xorg

## Client options. Will take effect on the next optirun executed.
[optirun]
# Acceleration/ rendering bridge, possible values are auto, virtualgl and
# primus.
Bridge=auto
# The method used for VirtualGL to transport frames between X servers.
# Possible values are proxy, jpeg, rgb, xv and yuv.
VGLTransport=proxy
# List of paths which are searched for the primus libGL.so.1 when using
# the primus bridge
PrimusLibraryPath=/usr/lib/primus:/usr/lib32/primus
# Should the program run under optirun even if Bumblebee server or nvidia card
# is not available?
AllowFallbackToIGC=false

# Driver-specific settings are grouped under [driver-NAME]. The sections are
# parsed if the Driver setting in [bumblebeed] is set to NAME (or if auto-
# detection resolves to NAME).
# PMMethod: method to use for saving power by disabling the nvidia card, valid
# values are: auto - automatically detect which PM method to use
# bbswitch - new in BB 3, recommended if available
# switcheroo - vga_switcheroo method, use at your own risk
# none - disable PM completely
# https://github.com/Bumblebee-Project/Bumblebee/wiki/Comparison-of-PM-methods

## Section with nvidia driver specific options, only parsed if Driver=nvidia
[driver-nvidia]
# Module name to load, defaults to Driver if empty or unset
KernelDriver=nvidia
PMMethod=bbswitch
# colon-separated path to the nvidia libraries
LibraryPath=/usr/lib/nvidia:/usr/lib32/nvidia:/usr/lib:/usr/lib32
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/usr/lib/nvidia/xorg,/usr/lib/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

## Section with nouveau driver specific options, only parsed if Driver=nouveau
[driver-nouveau]
KernelDriver=nouveau
PMMethod=bbswitch
XorgConfFile=/etc/bumblebee/xorg.conf.nouveau

TLP configuration is:
+++ Runtime Power Management
Device blacklist = 0a:00.0
Driver blacklist = nouveau nvidia

/sys/bus/pci/devices/0000:00:00.0/power/control = on (0x060000, Host bridge, hsw_uncore)
/sys/bus/pci/devices/0000:00:02.0/power/control = on (0x030000, VGA compatible controller, i915)
/sys/bus/pci/devices/0000:00:03.0/power/control = on (0x040300, Audio device, snd_hda_intel)
/sys/bus/pci/devices/0000:00:14.0/power/control = on (0x0c0330, USB controller, xhci_hcd)
/sys/bus/pci/devices/0000:00:16.0/power/control = on (0x078000, Communication controller, mei_me)
/sys/bus/pci/devices/0000:00:1b.0/power/control = on (0x040300, Audio device, snd_hda_intel)
/sys/bus/pci/devices/0000:00:1c.0/power/control = on (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:1c.1/power/control = on (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:1c.2/power/control = on (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:1c.3/power/control = on (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:1c.4/power/control = on (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:1d.0/power/control = on (0x0c0320, USB controller, ehci-pci)
/sys/bus/pci/devices/0000:00:1f.0/power/control = on (0x060100, ISA bridge, lpc_ich)
/sys/bus/pci/devices/0000:00:1f.2/power/control = on (0x010601, SATA controller, ahci)
/sys/bus/pci/devices/0000:00:1f.3/power/control = on (0x0c0500, SMBus, i801_smbus)
/sys/bus/pci/devices/0000:08:00.0/power/control = on (0x028000, Network controller, rtl8188ee)
/sys/bus/pci/devices/0000:09:00.0/power/control = on (0x020000, Ethernet controller, r8169)
/sys/bus/pci/devices/0000:0a:00.0/power/control = on (0x030200, 3D controller, no driver)

But I doubt this problem is related to TLP, since I’ve uninstalled it once and the problem persisted.
I think it’s related to bbswitch: in fact, if I unload the module bbswitch before suspending and reload it after wake up, “optirun” returns no error but it hangs.

What do you think? Thanks in advance.


#2
$ lspci | grep 3D
01:00.0 3D controller: NVIDIA ...

In

/etc/default/tlp

Set

RUNTIME_PM_BLACKLIST="01:00.0"

Reboot.

EDIT :

I had a similar issue on a new install with the exact same card, related to nvidia-smi temperature sensor data in KDE preventing the nvidia module from unloading.


#3

Thanks, how can I achieve that?
I disabled acpi_thermal_pm by putting thermal.off=1 in /etc/default/grub but nothing changed.


#4

Did you regenerate your grub?

sudo update-grub

#5

Yes, I did. In fact, after reboot, the process acpi_thermal_pm was off.