Skip to content

Bumblebee (optirun, primusrun) doesn't work with Flatpak #869

@doraskayo

Description

@doraskayo

I've been testing the new Steam Flatpak with my Optimus setup, and I ran into a some issues. Most importantly, couldn't get it to play well with Bumblebee (either optirun or primusrun). Obviously, the sandboxed Steam doesn't have access to the primusrun or optirun executables, so I couldn't use the official trick of changing the games' launch settings to use primusrun %command%. So I tried the other trick that normally works; running Steam itself using optirun or primusrun, and expecting games that it launches to "inherit" the use of the discrete card. For that, I used optirun -b primus flatpak run com.valvesoftware.Steam. However, to my disappointment, it didn't work at all. In fact, Steam itself didn't seem to use the discrete GPU either, not just games. I confirmed this using the org.freedesktop.GlxInfo Flatpak.

I've ran quite a few commands in sequence and logged their output, in hopes it would help identify the issue. Let me know if you need me to test anything or run any other commands.

[user@hostname ~]$ glxinfo | grep "renderer string"
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
 
[user@hostname ~]$ primusrun glxinfo | grep "renderer string"
OpenGL renderer string: GeForce GT 750M/PCIe/SSE2
 
[user@hostname ~]$ optirun glxinfo | grep "renderer string"
OpenGL renderer string: GeForce GT 750M/PCIe/SSE2
 
[user@hostname ~]$ optirun -b none glxinfo | grep "renderer string"
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
 
[user@hostname ~]$ optirun -b primus glxinfo | grep "renderer string"
OpenGL renderer string: GeForce GT 750M/PCIe/SSE2
 
[user@hostname ~]$ optirun -b virtualgl glxinfo | grep "renderer string"
OpenGL renderer string: GeForce GT 750M/PCIe/SSE2
 
[user@hostname ~]$ flatpak --version
Flatpak 0.9.6
 
[user@hostname ~]$ flatpak --gl-drivers
default
host
 
[user@hostname ~]$ primusrun flatpak --gl-drivers
default
host
 
[user@hostname ~]$ optirun flatpak --gl-drivers
nvidia-381-22
default
host
 
[user@hostname ~]$ optirun -b none flatpak --gl-drivers
nvidia-381-22
default
host
 
[user@hostname ~]$ optirun -b primus flatpak --gl-drivers
nvidia-381-22
default
host
 
[user@hostname ~]$ optirun -b virtualgl flatpak --gl-drivers
nvidia-381-22
default
host
 
[user@hostname ~]$ flatpak run --command=bash org.freedesktop.GlxInfo
bash-4.3$ glxinfo | grep "renderer string"
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
bash-4.3$ exit
exit
 
[user@hostname ~]$ primusrun flatpak run --command=bash org.freedesktop.GlxInfo
bash-4.3$ glxinfo | grep "renderer string"
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
bash-4.3$ exit
exit
 
[user@hostname ~]$ optirun flatpak run --command=bash org.freedesktop.GlxInfo
ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libvglfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libvglfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
bash-4.3$ glxinfo | grep "renderer string"
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
bash-4.3$ exit
exit
 
[user@hostname ~]$ optirun -b none flatpak run --command=bash org.freedesktop.GlxInfo
bash-4.3$ glxinfo | grep "renderer string"
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
bash-4.3$ exit
exit
 
[user@hostname ~]$ optirun -b primus flatpak run --command=bash org.freedesktop.GlxInfo
bash-4.3$ glxinfo | grep "renderer string"
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
bash-4.3$ exit
exit
 
[user@hostname ~]$ optirun -b virtualgl flatpak run --command=bash org.freedesktop.GlxInfo
ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libvglfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libvglfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
bash-4.3$ glxinfo | grep "renderer string"
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
bash-4.3$ exit
exit
OS: Arch Linux (25.6.17)
mesa: 17.1.3-1, lib32-mesa: 17.1.3-1
nvidia: 381.22-3, lib32-nvidia-utils: 381.22-1
bumblebee: 3.2.1-15
bbswitch: 0.8-68
primus: 20151110-7, lib32-primus: 20151110-3
virtualgl: 2.5.2-2, lib32-virtualgl: 2.5.2-2
flatpak: 0.9.6-1

Flatpak refs:
app/com.valvesoftware.Steam/x86_64/stable/07159702acb4770ea36d308748413e4ce27cd11f394e5a18c022a31a46864194
app/org.freedesktop.GlxInfo/x86_64/1.6/1b4e06c3d31be07894dd017011b7f1e11e978e807c71b32a3f808a6f844db0b6
runtime/org.freedesktop.Platform/x86_64/1.6/d59ac3d34995954d531c7027e6d62e0a350a29ae48fea4c4733ee26ab5a03957
runtime/org.freedesktop.Platform.GL.nvidia-381-22/x86_64/1.4/d62a785a5b8052cd8f87a381d5119d3fb6ae45424add71d86ef93fdaf23e79ed
runtime/org.freedesktop.Platform.GL32.nvidia-381-22/x86_64/1.4/aeebe06952b89df4064fe6c4cf61198aa26938238acadeb8b308e01f35ad678c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions