Skip to content
Snippets Groups Projects

runtime: Ignore nvidia-vaapi-driver when capturing VA-API drivers

Merged Simon McVittie requested to merge wip/dota2-issue2392-ignore-nv-vaapi into main
All threads resolved!
1 file
+ 16
2
Compare changes
  • Side-by-side
  • Inline
  • Normally, we can rely on driver modules such as DRI, VA-API, Vulkan and
    GLX having relatively minimal, low-level dependencies, which are not too
    much trouble to import into the container. However, nvidia-vaapi-driver
    pulls in GStreamer core libraries, all of GLib, elfutils' libdw, and
    several compression libraries.
    
    The more libraries we import into the container, the more likely we
    are to have one of the failure modes that our container is designed
    to avoid: either a library that causes trouble for some reason (like
    libbz2 in Dota-2#2392), or a game developer accidentally relying on
    application-level functionality of a newer operating system that our
    container cannot guarantee to provide in a portable way.
    
    GStreamer is particularly problematic here, because it has its own
    plugin architecture. Importing a driver that links to GStreamer, but
    none of GStreamer's plugins, is unlikely to work as desired: it will be
    unable to encode or decode any videos, likely making nvidia-vaapi-driver
    essentially useless.
    
    Resolves: https://github.com/ValveSoftware/Dota-2/issues/2392
    
    
    Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
+ 16
2
@@ -6436,10 +6436,24 @@ collect_dri_drivers (PvRuntime *self,
for (icd_iter = va_api_drivers, j = 0; icd_iter != NULL; icd_iter = icd_iter->next, j++)
{
g_autoptr(IcdDetails) details = icd_details_new (icd_iter->data);
g_autoptr(IcdDetails) details = NULL;
g_autofree gchar *resolved = NULL;
resolved = srt_va_api_driver_resolve_library_path (icd_iter->data);
if (g_str_has_suffix (resolved, "/nvidia_drv_video.so"))
{
/* https://github.com/elFarto/nvidia-vaapi-driver depends on
* GStreamer, which is rather more than our dependency-handling
* mechanisms are really prepared to deal with. */
g_info ("Avoiding use of \"%s\" because it has a lot of dependencies",
resolved);
continue;
}
details = icd_details_new (icd_iter->data);
g_assert (details->resolved_libraries[multiarch_index] == NULL);
details->resolved_libraries[multiarch_index] = srt_va_api_driver_resolve_library_path (details->icd);
details->resolved_libraries[multiarch_index] = g_steal_pointer (&resolved);
g_assert (details->resolved_libraries[multiarch_index] != NULL);
g_assert (g_path_is_absolute (details->resolved_libraries[multiarch_index]));
g_ptr_array_add (details_arr, g_steal_pointer (&details));
Loading