eglexternalplatform
eglexternalplatform copied to clipboard
Please consider standardizing how EGL external platform modules are discovered
App-container technologies like Flatpak and Steam's Steam Linux Runtime need to understand NVIDIA's proprietary EGL driver finds external platforms, so that they can alter the search path as required for the "shape" of their containers, particularly if they are borrowing graphics drivers from the host system rather than shipping their own.
It would be useful if there was either a spec or an open-source reference implementation for how the external platforms are to be discovered, so that we can make sure that what we're doing is compatible.
The external platform modules seem to be designed to be non-NVIDIA-specific, so it would presumably also be helpful to have a spec that other ICD authors can implement.
My best guess at the spec is that it's the same as GLVND EGL ICDs, but with some names changed:
- if
$__EGL_EXTERNAL_PLATFORM_CONFIG_FILENAMESis set and we are not setuid, search exactly those JSON manifest files in that order, "most important" first; - else if
$__EGL_EXTERNAL_PLATFORM_CONFIG_DIRSis set and we are not setuid, read*.jsonin those directories, "most important" first, with files earlier in lexicographic (strcmp) order treated as "most important" within each directory; - else search the hard-coded path
/etc/egl/egl_external_platform.d:/usr/share/egl/egl_external_platform.d, again looking for*.jsonin lexicographic order; - each
*.jsonfile is in exactly the same format as a GLVND ICD JSON manifest, version 1.0, with a top-level object with keys includingfile_format_version(a string) andICD(an object with keys includinglibrary_path) - the
library_pathcan either be:- a bare filename with no
/, interpreted as aSONAMEin the system library search path (this is what's used in practice) - an absolute path, possibly containing special tokens like
${LIB} - a relative path, interpreted as relative to the JSON manifest, and possibly containing special tokens like
${LIB}
- a bare filename with no
Is that guess correct?
The Flatpak developers would also find it useful if the loader searched the XDG basedirs, similar to how Vulkan ICDs are located.