Bumblebee - linux-surface/surface-hotplug GitHub Wiki

Configuration / Troubleshooting for Bumbleblee

While it is generally preferred to use something like system76-power and PRIME offloading, this requires rebooting to be able to unload the nvidia driver, which is a requirement to detach the clipboard. You can allow for the driver to be unloaded by blacklisting all drivers at boot, ensuring that XWayland/X11 won't load and bind to them, which however breaks PRIME, leaving you bumblebee/optirun/primusrun/pvkrun as pretty much the only solution.

Note that the same reason, i.e. XWayland/X11 loading and binding to the driver/device, will break D3cold support, so there is also a case to be made for bumblebee if you care about power savings and don't actively use the dGPU often.

For details on configuration, please refer to https://wiki.archlinux.org/index.php/bumblebee#Configuration or the documentation of your respective distribution. In this regard, the Surface devices are no different than many other non-Surface devices. Additionally, you may want to ensure that you have the following configuration options set:

  • In /etc/bumblebee/bumblebee.conf:

    [bumblebeed]
    # ...
    Driver=nvidia             # use nvidia driver stub below
    # ...
    
    [driver-nvidia]
    KernelDriver=nvidia       # use the NVIDIA kernel driver
    PMMethod=none             # don't use bbswitch/vga-switcheroo, runtime PM should do this for us
    # ...
    XorgConfFile=/etc/bumblebee/xorg.conf.nvidia    # xorg config to use
    # ...
    
  • In /etc/bumblebee/xorg.conf.nvidia:

    Section "Device"
        Identifier  "DiscreteNvidia"
        Driver      "nvidia"
        VendorName  "NVIDIA Corporation"
    
        BusID       "PCI:02:00:0"                   # set this to the PCI ID of your dGPU
        # ...
    EndSection
    

    Make sure to set the BusID to the PCI device, bus, and function number of your dGPU. See Finding the dGPU PCIe Device on how to find those.

Also ensure that the nvidia persistence daemon is not running with something like sudo ps aux | grep nvidia. It intentionally prevents the driver from releasing the dGPU and therefore stops it from going to D3cold. On Debian 11 the nvidia-persistenced systemd unit is enabled by default and systemctl disable nvidia-persistenced solves the problem.