easybuilders / easybuild-easyconfigs

A collection of easyconfig files that describe which software to build using which build options with EasyBuild.
https://easybuild.io
GNU General Public License v2.0
373 stars 699 forks source link

__EGL_VENDOR_LIBRARY_DIRS isn't working correctly #13296

Closed Micket closed 5 months ago

Micket commented 3 years ago

We currently set a few system paths (primarily for finding nvidia drivers), and we prepend Mesa's directory when it is loaded. Meaning we typically end up with e.g:

declare -x __EGL_VENDOR_LIBRARY_DIRS="/apps/Test2/software/Mesa/20.2.1-GCCcore-10.2.0/share/glvnd/egl_vendor.d:/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d"

I haven't looked through the logic, but https://github.com/NVIDIA/libglvnd/blob/master/src/EGL/icd_enumeration.md makes me believe that perhaps we should append and not prepend Mesa's paths, to allow system nvidia to be used with higher priority?

In addition, with glewinfo (EGL variant) Mesa seems to want to use a nonexistent nouveau dri driver. Not sure how to even change that, but, we should make it use whatever is it's own lib/dri directory, which, at least for me case, is just swrast_dri.so.

Micket commented 3 years ago

Having gone through the code, I'm quite confident that glvnd considers the order of the library dirs first; and the listing fo the files inside the directories as a secondary sorting criteria.

This means that Mesa comes up first, even if /usr/share/glvnd/egl_vendor.d contains nvidia variants that you really want to use.

Just having Mesa append the directory instead of prepending would probably be an acceptable workaround for most systems.

akesandgren commented 3 years ago

Yes, I agree. One could also, on a per-use case override the _DIRS search order using an explicit list in __EGL_VENDOR_LIBRARY_FILENAMES

akesandgren commented 3 years ago

However, the problem then gets that if there is a system mesa installed that is the one being picked up and not ours...

Micket commented 2 years ago

I considered another option; patching glvnd, but, it's a pretty major patch but definitely possible.

Micket commented 5 months ago

Mesa easyconfigs have been appending this path for some time now. Fixed.