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



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.
# The secondary Xorg server DISPLAY number
# 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.
# The name of the Bumbleblee server group name (GID name)
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
# The default behavior of '-f' option on optirun. If set to "true", '-f' will
# be ignored.
# 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)
# Directory with a dummy config file to pass as a -configdir to secondary X
# Xorg binary to run

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

# 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
# Module name to load, defaults to Driver if empty or unset
# colon-separated path to the nvidia libraries
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path

## Section with nouveau driver specific options, only parsed if Driver=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.

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







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.


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


Did you regenerate your grub?

sudo update-grub


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