Community Packages

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#67818 - [virtualgl] change library path to avoid messing up lib search order

Attached to Project: Community Packages
Opened by Oliver Mangold (omangold) - Thursday, 03 September 2020, 10:33 GMT
Last edited by freswa (frederik) - Friday, 04 September 2020, 21:45 GMT
Task Type Bug Report
Category Packages
Status Assigned
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No



vglrun adds the vgl libdir to LD_LIBRARY_PATH. If this is /usr/lib, as is the case for the arch package, this will change the search order for libraries, moving /usr/lib before the dirs given in /etc/ I think this is a (potential) source for various kinds of trouble. Actually I have reason to override some system libraries on my installation by adding extra entries in /etc/

An easy fix is to change the vgl libdir to something else, which contains *only* the vgl libs, e.g. /usr/lib/virtualgl. See patch below.

Additional info:
* package version(s): 2.6.4-1


--- PKGBUILD.orig 2020-09-03 12:19:23.201260540 +0200
+++ PKGBUILD 2020-09-03 12:19:33.277890889 +0200
@@ -32,7 +32,7 @@
-DTJPEG_INCLUDE_DIR=/usr/include \
-DTJPEG_LIBRARY=/usr/lib/ \
+ -DCMAKE_INSTALL_LIBDIR=/usr/lib/virtualgl \
-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${pkgname} \
This task depends upon

Comment by Sven-Hendrik Haase (Svenstaro) - Sunday, 18 October 2020, 01:02 GMT
Upstream apparently doesn't do this for their official deb and rpm packages and I can't find any issues on the upstream bug tracker discussing this issue. I have to admit: I don't really understand the current problem case here.

Could you discuss this with upstream (via GitHub issue and link it here) and/or illustrate to me how the current dir can become a problem in regard to order?
Comment by Oliver Mangold (omangold) - Sunday, 18 October 2020, 09:51 GMT
The specific problem I encounter is somewhat Arch-specific. The proprietary Nvidia drivers are notoriously annoying because they need the version of the libs match the version of the loaded kernel module, so after an update of the nvidia-utils package opengl/cl stops working. My fix is to make a copy of the currently installed nvidia .so files at boot and add the location of the copies to /etc/ By the linker these will be prioritized over the updated versions in /usr/lib, so everything works fine.

But as LD_LIBRARY_PATH takes priority over /etc/, adding /usr/lib there will mess it up, but it would not if it were a different directory. Apparently virtualgl is prepared to deal with the situation of having its libs installed elsewhere and uses LD_LIBRARY_PATH exactly for the purpose so that they can still be found then:

--- /usr/bin/.vglrun.vars64 ---
# If the faker libraries are packaged in a non-system directory, then this
# script adds that directory to VGL_LIBRARY_PATH, which is later added to
# LD_LIBRARY_PATH so that LD_PRELOAD can find the libraries.