Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 770193

Summary: x11-misc/primus-0.2-r2: Segfault with primus_vk on GLVND systems
Product: Gentoo Linux Reporter: Benjamin Resch <XmainframeX>
Component: Current packagesAssignee: No maintainer - Look at if you want to take care of it <maintainer-needed>
Status: UNCONFIRMED ---    
Severity: normal CC: ionen
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---

Description Benjamin Resch 2021-02-12 09:32:22 UTC
When [primus_vk](, which uses primus as backend, is built from source and "pvkrun vkcube" is run, this ends with a segfault.

After some [debugging]( together with the owner of primus_vk, it turned out that on systems with GLVND enabled, applications should always use the libglvnd-provided library which then determines the correct vendor-specifig libGL. The vendor-specific GLVND-compatible libGLs are apparently not required to export all the GL-related symbols.

Therefore, we considered the injection of the primus-0.2-r2.ebuild of
export PRIMUS_libGLa='/usr/$LIB/'
export PRIMUS_libGLd='/usr/$LIB/'
into primusrun when libglvnd is considered active to be a bug, especially due to the fact that the segfault problens disappear when primusrun is modified to contain
export PRIMUS_libGLa='/usr/$LIB/'
export PRIMUS_libGLd='/usr/$LIB/'

Please refer to the original [bug report]( for details.

Reproducible: Always

Steps to Reproduce:
1. Install [primus_vk]( from source - you will have to patch the libdir in the Makefile as well as one include in primus_vp.cpp.
2. Run "pvkrun vkcube"
Actual Results:  
vkcube segfaults in /usr/lib64/

Expected Results:  
vkcube runs on the dedicated GPU

Refer to for details on how to reproduce the bug, on how we tracked it down and on some background information of how glvnd is supposed to work with references to its specifications.
Comment 1 Benjamin Resch 2021-02-12 09:44:59 UTC
There's also a suggestion of primus_vk's author in to avoid all this "export PRIMUS_libGL..." for finding the correct libraries in primus and configure it correctly in bumblebee.conf, because primus seems to fetch it from optirun when it has no own values set - so this would be the general solution.

Does it make more sense to fix it step by step (first export the correct libraries for primusrun, then fix bumblebee, then remove exports from primusrun again) or should this better be a combined effort where both packages are updated at once?