<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 15, 2021, at 11:37 AM, Robert McQueen <<a href="mailto:rob@endlessos.org" class="">rob@endlessos.org</a>> wrote:</div><div class=""><div class=""><br class="">2. The far trickier problem comes from derived runtimes. GL drivers and<br class="">some other binaries which appear in extension points are often built at<br class="">the same time as the runtime, or they could be rebuilt after a symbol<br class="">has been added to the runtime, acquiring an implicit dependency on the<br class="">new release. In the case there is a derived runtime (eg GNOME or KDE)<br class="">that re-uses binaries or recipes from the Freedesktop SDK, you can have<br class="">the situation that a new base runtime upgrades a core library, so the<br class="">extensions might implicitly depend on some new symbols or interfaces,<br class="">but the /derived/ runtime has not been updated/rebuilt to include these<br class="">symbols. This means these extensions are "from the future" compared to<br class="">the derived runtime, and they could at best fail to load, or prevent<br class="">anything from working. Although typically the extensions have a limited<br class="">interface surface (a handful of libraries rather than the dozens in the<br class="">whole platform), it only takes once glibc itself versions all symbols<br class="">and so it's very easy to trip over this situation even with relatively<br class="">minor platform updates.<br class=""><br class=""></div></div></blockquote><div><br class=""></div><div><div>I have run into this exact scenario more than once. Here is a concrete</div><div>example of the problem here.</div><div><br class=""></div><div>My Flatpak (com.moonlight_stream.Moonlight) is a Qt app that uses the</div><div>org.kde.Platform//5.15 runtime and org.freedesktop.Platform.VAAPI.Intel</div><div>extension for VAAPI hardware video acceleration on Intel platforms. The</div><div>trouble is that libva is baked into the KDE runtime while the VAAPI</div><div>driver is included in the Freedesktop VAAPI extension.</div><div><br class=""></div><div>VAAPI's ABI compatibility works by using versioned entrypoints like</div><div>__vaDriverInit_1_7, __vaDriverInit_1_8, __vaDriverInit_1_9, etc. in the</div><div>drivers. This allows newer libva versions to support older VAAPI drivers</div><div>by trying each supported __vaDriverInit function in descending order.</div><div><br class=""></div><div><div>The problem is that the VAAPI drivers have only a single entrypoint that</div><div>corresponds to the version of libva they were built with. For example,</div><div>a driver built for libva 2.10 will have __vaDriverInit_1_10 and no other</div><div>entrypoints. In other words, libva is backwards compatible with older</div><div>VAAPI drivers, but the VAAPI drivers are only _forwards_ compatible with</div><div>equal or newer libva versions to the one they were built with.</div><div><br class=""></div><div>When the Freedesktop runtime and org.freedesktop.Platform.VAAPI.Intel</div><div>were updated to libva 2.10 [0], I had the VAAPI extension built for libva</div><div>2.10 (which had __vaDriverInit_1_10) running with libva 2.9 (which only</div><div>knows about entrypoints up to __vaDriverInit_1_9) from the KDE runtime.</div><div>This version mismatch broke hardware acceleration in my app for a couple</div><div>weeks until org.kde.Platform//5.15 was rebuilt for unrelated patches.</div></div><div><br class=""></div><div>This same breakage happens every time the Freedesktop folks update the</div><div>version of libva used to build org.freedesktop.Platform.VAAPI.Intel.</div><div><br class=""></div><div>[0]: <a href="https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/merge_requests/4262" class="">https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/merge_requests/4262</a></div><div><br class=""></div><div>Regards,</div><div>Cameron</div></div></div><br class=""></body></html>