Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 0.20240321.x
  • main
  • v0.20231013.x
  • wip/case_insensitive_fs
  • wip/denittis/line_based
  • wip/denittis/portal_helper
  • wip/denittis/t17372
  • wip/denittis/t20052
  • wip/denittis/t20177
  • wip/denittis/t7017
  • wip/denittis/tasks239
  • wip/denittis/up_libcapsule
  • wip/diagnose-task724
  • wip/fix_archlinux_ci
  • wip/flatpak_exports_for_run_host
  • wip/gameoverlayrenderer
  • wip/input-device-diagnostic
  • wip/input-portal
  • wip/issue18
  • wip/luigipiucco/nixos
  • wip/protected/ci
  • wip/protected/scout-on-soldier
  • wip/protected/smcv-ci
  • wip/protected/smcv-merge-slr
  • wip/protected/task679
  • wip/refi64/check-steam-running
  • wip/refi64/ci-coverage-demo
  • wip/refi64/ci-coverage-expose
  • wip/refi64/mr_template_test
  • wip/refi64/openxr
  • wip/refi64/openxr-rt-pv
  • wip/refi64/openxr-socket
  • wip/refi64/openxr-sysinfo
  • wip/refi64/vk-layers
  • wip/regenerate-ldso-cache
  • wip/shorten_socket
  • wip/smcv/always-copy-runtime
  • wip/smcv/ci
  • wip/smcv/clang
  • wip/smcv/delete-in-background
  • wip/smcv/dev-lib-symlinks
  • wip/smcv/diagnose-sfl10602
  • wip/smcv/diffable
  • wip/smcv/doc
  • wip/smcv/docs
  • wip/smcv/fex-3
  • wip/smcv/gcc11
  • wip/smcv/guessed-library-arch
  • wip/smcv/inspect-library
  • wip/smcv/into-library
  • wip/smcv/ld-so-wrapper
  • wip/smcv/lxc
  • wip/smcv/no-nvidia-pkcs11
  • wip/smcv/pv-wrap-to-journal
  • wip/smcv/refcount-locks
  • wip/smcv/relocatable-bin
  • wip/smcv/spawn-really-async
  • wip/smcv/staging
  • wip/smcv/steam-portal
  • wip/smcv/task149-nonfhs
  • wip/smcv/task212-basename
  • wip/smcv/task370-debug
  • wip/smcv/test-diagnostics
  • wip/smcv/variant-init-statically
  • wip/smcv/vulkan-1-1
  • wip/sr640
  • wip/sr684
  • wip/task293-v1
  • wip/task342-3
  • wip/task466
  • wip/task466-more
  • wip/task481-test
  • wip/task488-test
  • wip/task595
  • wip/task634
  • wip/task647
  • wip/task88
  • wip/task88-pre
  • wip/vulkan_shaders
  • wip/xytovl/openxr
  • pressure-vessel-v0.20180430.0
  • pressure-vessel-v0.20180517.0
  • pressure-vessel-v0.20180517.1
  • pressure-vessel-v0.20180518.0
  • pressure-vessel-v0.20180518.1
  • pressure-vessel-v0.20190510.0
  • pressure-vessel-v0.20190815.0
  • pressure-vessel-v0.20190819.0
  • pressure-vessel-v0.20190820.0
  • pressure-vessel-v0.20190822.0
  • pressure-vessel-v0.20190823.0
  • pressure-vessel-v0.20190912.0
  • pressure-vessel-v0.20190926.0
  • pressure-vessel-v0.20190927.0
  • pressure-vessel-v0.20191112.0
  • pressure-vessel-v0.20191112.1
  • pressure-vessel-v0.20191115.0
  • pressure-vessel-v0.20191216.0
  • pressure-vessel-v0.20200108.0
  • pressure-vessel-v0.20200331.0
  • pressure-vessel-v0.20200624.0
  • pressure-vessel-v0.20200708.0
  • pressure-vessel-v0.20200709.0
  • pressure-vessel-v0.20200805.0
  • pressure-vessel-v0.20200819.0
  • pressure-vessel-v0.20200908.0
  • pressure-vessel-v0.20200909.0
  • steamrt/0.20190926.0-0+steamrt1.2
  • v0.20190717.0
  • v0.20190801.0
  • v0.20190802.0
  • v0.20190806.0
  • v0.20190816.0
  • v0.20190820.0
  • v0.20190820.1
  • v0.20190822.0
  • v0.20190909.0
  • v0.20190926.0
  • v0.20190926.1
  • v0.20191024.0
  • v0.20191120.0
  • v0.20191205.0
  • v0.20191209.0
  • v0.20200108.0
  • v0.20200109.0
  • v0.20200306.0
  • v0.20200331.0
  • v0.20200331.1
  • v0.20200415.0
  • v0.20200624.0
  • v0.20200908.0
  • v0.20200908.1
  • v0.20200914.0
  • v0.20201002.0
  • v0.20201007.0
  • v0.20201022.0
  • v0.20201124.0
  • v0.20201203.0
  • v0.20210105.0
  • v0.20210114.0
  • v0.20210126.0
  • v0.20210201.0
  • v0.20210203.0
  • v0.20210305.0
  • v0.20210312.0
  • v0.20210317.0
  • v0.20210331.0
  • v0.20210415.0
  • v0.20210430.0
  • v0.20210518.0
  • v0.20210608.0
  • v0.20210608.1
  • v0.20210608.2
  • v0.20210608.3
  • v0.20210617.0
  • v0.20210617.1
  • v0.20210630.0
  • v0.20210722.0
  • v0.20210806.0
  • v0.20210809.0
  • v0.20210809.1
  • v0.20210820.0
  • v0.20210906.0
  • v0.20210906.1
  • v0.20210906.2
  • v0.20211027.0
  • v0.20211207.0
  • v0.20220107.0
  • v0.20220111.0
  • v0.20220119.0
  • v0.20220131.0
  • v0.20220311.0
  • v0.20220315.0
  • v0.20220420.0
  • v0.20220601.0
  • v0.20220620.0
  • v0.20220624.0
  • v0.20220725.0
  • v0.20220725.1
  • v0.20220726.0
180 results

Target

Select target project
  • steamrt/steam-runtime-tools
1 result
Select Git revision
  • 0.20240321.x
  • main
  • v0.20231013.x
  • wip/case_insensitive_fs
  • wip/denittis/line_based
  • wip/denittis/portal_helper
  • wip/denittis/t17372
  • wip/denittis/t20052
  • wip/denittis/t20177
  • wip/denittis/t7017
  • wip/denittis/tasks239
  • wip/denittis/up_libcapsule
  • wip/diagnose-task724
  • wip/fix_archlinux_ci
  • wip/flatpak_exports_for_run_host
  • wip/gameoverlayrenderer
  • wip/input-device-diagnostic
  • wip/input-portal
  • wip/issue18
  • wip/luigipiucco/nixos
  • wip/protected/ci
  • wip/protected/scout-on-soldier
  • wip/protected/smcv-ci
  • wip/protected/smcv-merge-slr
  • wip/protected/task679
  • wip/refi64/check-steam-running
  • wip/refi64/ci-coverage-demo
  • wip/refi64/ci-coverage-expose
  • wip/refi64/mr_template_test
  • wip/refi64/openxr
  • wip/refi64/openxr-rt-pv
  • wip/refi64/openxr-socket
  • wip/refi64/openxr-sysinfo
  • wip/refi64/vk-layers
  • wip/regenerate-ldso-cache
  • wip/shorten_socket
  • wip/smcv/always-copy-runtime
  • wip/smcv/ci
  • wip/smcv/clang
  • wip/smcv/delete-in-background
  • wip/smcv/dev-lib-symlinks
  • wip/smcv/diagnose-sfl10602
  • wip/smcv/diffable
  • wip/smcv/doc
  • wip/smcv/docs
  • wip/smcv/fex-3
  • wip/smcv/gcc11
  • wip/smcv/guessed-library-arch
  • wip/smcv/inspect-library
  • wip/smcv/into-library
  • wip/smcv/ld-so-wrapper
  • wip/smcv/lxc
  • wip/smcv/no-nvidia-pkcs11
  • wip/smcv/pv-wrap-to-journal
  • wip/smcv/refcount-locks
  • wip/smcv/relocatable-bin
  • wip/smcv/spawn-really-async
  • wip/smcv/staging
  • wip/smcv/steam-portal
  • wip/smcv/task149-nonfhs
  • wip/smcv/task212-basename
  • wip/smcv/task370-debug
  • wip/smcv/test-diagnostics
  • wip/smcv/variant-init-statically
  • wip/smcv/vulkan-1-1
  • wip/sr640
  • wip/sr684
  • wip/task293-v1
  • wip/task342-3
  • wip/task466
  • wip/task466-more
  • wip/task481-test
  • wip/task488-test
  • wip/task595
  • wip/task634
  • wip/task647
  • wip/task88
  • wip/task88-pre
  • wip/vulkan_shaders
  • wip/xytovl/openxr
  • pressure-vessel-v0.20180430.0
  • pressure-vessel-v0.20180517.0
  • pressure-vessel-v0.20180517.1
  • pressure-vessel-v0.20180518.0
  • pressure-vessel-v0.20180518.1
  • pressure-vessel-v0.20190510.0
  • pressure-vessel-v0.20190815.0
  • pressure-vessel-v0.20190819.0
  • pressure-vessel-v0.20190820.0
  • pressure-vessel-v0.20190822.0
  • pressure-vessel-v0.20190823.0
  • pressure-vessel-v0.20190912.0
  • pressure-vessel-v0.20190926.0
  • pressure-vessel-v0.20190927.0
  • pressure-vessel-v0.20191112.0
  • pressure-vessel-v0.20191112.1
  • pressure-vessel-v0.20191115.0
  • pressure-vessel-v0.20191216.0
  • pressure-vessel-v0.20200108.0
  • pressure-vessel-v0.20200331.0
  • pressure-vessel-v0.20200624.0
  • pressure-vessel-v0.20200708.0
  • pressure-vessel-v0.20200709.0
  • pressure-vessel-v0.20200805.0
  • pressure-vessel-v0.20200819.0
  • pressure-vessel-v0.20200908.0
  • pressure-vessel-v0.20200909.0
  • steamrt/0.20190926.0-0+steamrt1.2
  • v0.20190717.0
  • v0.20190801.0
  • v0.20190802.0
  • v0.20190806.0
  • v0.20190816.0
  • v0.20190820.0
  • v0.20190820.1
  • v0.20190822.0
  • v0.20190909.0
  • v0.20190926.0
  • v0.20190926.1
  • v0.20191024.0
  • v0.20191120.0
  • v0.20191205.0
  • v0.20191209.0
  • v0.20200108.0
  • v0.20200109.0
  • v0.20200306.0
  • v0.20200331.0
  • v0.20200331.1
  • v0.20200415.0
  • v0.20200624.0
  • v0.20200908.0
  • v0.20200908.1
  • v0.20200914.0
  • v0.20201002.0
  • v0.20201007.0
  • v0.20201022.0
  • v0.20201124.0
  • v0.20201203.0
  • v0.20210105.0
  • v0.20210114.0
  • v0.20210126.0
  • v0.20210201.0
  • v0.20210203.0
  • v0.20210305.0
  • v0.20210312.0
  • v0.20210317.0
  • v0.20210331.0
  • v0.20210415.0
  • v0.20210430.0
  • v0.20210518.0
  • v0.20210608.0
  • v0.20210608.1
  • v0.20210608.2
  • v0.20210608.3
  • v0.20210617.0
  • v0.20210617.1
  • v0.20210630.0
  • v0.20210722.0
  • v0.20210806.0
  • v0.20210809.0
  • v0.20210809.1
  • v0.20210820.0
  • v0.20210906.0
  • v0.20210906.1
  • v0.20210906.2
  • v0.20211027.0
  • v0.20211207.0
  • v0.20220107.0
  • v0.20220111.0
  • v0.20220119.0
  • v0.20220131.0
  • v0.20220311.0
  • v0.20220315.0
  • v0.20220420.0
  • v0.20220601.0
  • v0.20220620.0
  • v0.20220624.0
  • v0.20220725.0
  • v0.20220725.1
  • v0.20220726.0
180 results
Show changes
Commits on Source (6)
......@@ -290,6 +290,28 @@ class Gui:
self.grid.attach(label, 1, row, 1, 1)
row += 1
self.import_vulkan_layers_check = Gtk.CheckButton.new_with_label(
'Import Vulkan layers'
)
import_val = boolean_environment(
'PRESSURE_VESSEL_IMPORT_VULKAN_LAYERS', True
)
self.import_vulkan_layers_check.set_active(import_val)
self.grid.attach(self.import_vulkan_layers_check, 1, row, 1, 1)
row += 1
label = Gtk.Label.new('')
label.set_markup(
'<small><i>'
'If you are experiencing crashes, or other issues, you may try '
'disabling this and check whether it helps.'
'</i></small>'
)
label.set_halign(Gtk.Align.START)
label.set_line_wrap(True)
self.grid.attach(label, 1, row, 1, 1)
row += 1
self.xterm_check = Gtk.CheckButton.new_with_label('Run in an xterm')
self.xterm_check.set_active(False)
self.grid.attach(self.xterm_check, 1, row, 1, 1)
......@@ -521,6 +543,11 @@ class Gui:
else:
argv.append('--remove-game-overlay')
if self.import_vulkan_layers_check.get_active():
argv.append('--import-vulkan-layers')
else:
argv.append('--no-import-vulkan-layers')
if self.xterm_check.get_active():
argv.append('--terminal=xterm')
else:
......
......@@ -166,6 +166,12 @@ typedef struct
* - etc.
* Size is completely arbitrary, expand as needed */
const char *multilib[3];
/* Known values that ${PLATFORM} can expand to.
* Refer to sysdeps/x86/cpu-features.c and sysdeps/x86/dl-procinfo.c
* in glibc.
* Size is completely arbitrary, expand as needed */
const char *platforms[5];
} MultiarchDetails;
/*
......@@ -176,10 +182,12 @@ static const MultiarchDetails multiarch_details[] =
{
.tuple = "x86_64-linux-gnu",
.multilib = { "lib64", "x86_64-pc-linux-gnu/lib", NULL },
.platforms = { "xeon_phi", "haswell", "x86_64", NULL },
},
{
.tuple = "i386-linux-gnu",
.multilib = { "lib32", "i686-pc-linux-gnu/lib", NULL }
.multilib = { "lib32", "i686-pc-linux-gnu/lib", NULL },
.platforms = { "i686", "i586", "i486", "i386", NULL },
},
};
G_STATIC_ASSERT (G_N_ELEMENTS (multiarch_details)
......@@ -2437,36 +2445,53 @@ collect_vulkan_layers (PvRuntime *self,
if (!srt_vulkan_layer_check_error (layer, NULL))
continue;
/* If the library_path is relative to the JSON file, turn it into an
* absolute path. If it's already absolute, or if it's a basename to be
* looked up in the system library search path, use it as-is. */
details->resolved_library = srt_vulkan_layer_resolve_library_path (layer);
g_assert (details->resolved_library != NULL);
if (g_strcmp0 (self->provider_in_host_namespace, "/") == 0)
if (strchr (details->resolved_library, '/') != NULL &&
(strstr (details->resolved_library, "$ORIGIN/") != NULL ||
strstr (details->resolved_library, "${ORIGIN}") != NULL ||
strstr (details->resolved_library, "$LIB/") != NULL ||
strstr (details->resolved_library, "${LIB}") != NULL ||
strstr (details->resolved_library, "$PLATFORM/") != NULL ||
strstr (details->resolved_library, "${PLATFORM}") != NULL))
{
issues = srt_check_library_presence (details->resolved_library,
arch->details->tuple, NULL,
SRT_LIBRARY_SYMBOLS_FORMAT_PLAIN,
&library);
if (issues & (SRT_LIBRARY_ISSUES_CANNOT_LOAD |
SRT_LIBRARY_ISSUES_UNKNOWN |
SRT_LIBRARY_ISSUES_TIMEOUT))
/* When loading a library by its absolute or relative path
* (but not when searching the library path for its basename),
* glibc expands dynamic string tokens: LIB, PLATFORM, ORIGIN.
* libcapsule cannot expand these special tokens: the only thing
* that knows the correct magic values for them is glibc, which has
* no API to tell us. The only way we can find out the library's
* real location is to tell libdl to load (dlopen) the library, and
* see what the resulting path is. */
if (g_strcmp0 (self->provider_in_current_namespace, "/") == 0)
{
/* It's in our current namespace, so we can dlopen it. */
issues = srt_check_library_presence (details->resolved_library,
arch->details->tuple, NULL,
SRT_LIBRARY_SYMBOLS_FORMAT_PLAIN,
&library);
if (issues & (SRT_LIBRARY_ISSUES_CANNOT_LOAD |
SRT_LIBRARY_ISSUES_UNKNOWN |
SRT_LIBRARY_ISSUES_TIMEOUT))
{
g_debug ("Unable to load library %s: %s", details->resolved_library,
srt_library_get_messages (library));
continue;
}
g_free (details->resolved_library);
details->resolved_library = g_strdup (srt_library_get_absolute_path (library));
}
else
{
g_debug ("Unable to load library %s: %s", details->resolved_library,
srt_library_get_messages (library));
/* Sorry, we can't know how to load this. */
g_debug ("Cannot support ld.so special tokens, e.g. ${LIB}, when provider "
"is not the root filesystem");
continue;
}
g_free (details->resolved_library);
details->resolved_library = g_strdup (srt_library_get_absolute_path (library));
}
else if (strstr (details->resolved_library, "$ORIGIN/") != NULL ||
strstr (details->resolved_library, "${ORIGIN}") != NULL ||
strstr (details->resolved_library, "$LIB/") != NULL ||
strstr (details->resolved_library, "${LIB}") != NULL ||
strstr (details->resolved_library, "$PLATFORM/") != NULL ||
strstr (details->resolved_library, "${PLATFORM}") != NULL)
{
g_debug ("Cannot support ld.so special tokens, e.g. ${LIB}, when provider "
"is not the root filesystem");
continue;
}
if (!bind_icd (self, arch, j, dir_name, details, error))
......@@ -2595,60 +2620,63 @@ pv_runtime_use_provider_graphics_stack (PvRuntime *self,
g_ptr_array_add (vulkan_icd_details, icd_details_new (icd));
}
g_debug ("Enumerating Vulkan explicit layers on provider system...");
vulkan_explicit_layers = srt_system_info_list_explicit_vulkan_layers (system_info);
vulkan_exp_layer_details = g_ptr_array_new_full (g_list_length (vulkan_explicit_layers),
(GDestroyNotify) G_CALLBACK (icd_details_free));
for (icd_iter = vulkan_explicit_layers, j = 0;
icd_iter != NULL;
icd_iter = icd_iter->next, j++)
if (self->flags & PV_RUNTIME_FLAGS_IMPORT_VULKAN_LAYERS)
{
SrtVulkanLayer *layer = icd_iter->data;
const gchar *path = srt_vulkan_layer_get_json_path (layer);
GError *local_error = NULL;
g_debug ("Enumerating Vulkan explicit layers on provider system...");
vulkan_explicit_layers = srt_system_info_list_explicit_vulkan_layers (system_info);
vulkan_exp_layer_details = g_ptr_array_new_full (g_list_length (vulkan_explicit_layers),
(GDestroyNotify) G_CALLBACK (icd_details_free));
if (!srt_vulkan_layer_check_error (layer, &local_error))
for (icd_iter = vulkan_explicit_layers, j = 0;
icd_iter != NULL;
icd_iter = icd_iter->next, j++)
{
g_debug ("Failed to load Vulkan Layer #%" G_GSIZE_FORMAT " from %s: %s",
j, path, local_error->message);
g_clear_error (&local_error);
continue;
}
SrtVulkanLayer *layer = icd_iter->data;
const gchar *path = srt_vulkan_layer_get_json_path (layer);
GError *local_error = NULL;
g_debug ("Vulkan explicit layer #%" G_GSIZE_FORMAT " at %s: %s",
j, path, srt_vulkan_layer_get_library_path (layer));
if (!srt_vulkan_layer_check_error (layer, &local_error))
{
g_debug ("Failed to load Vulkan Layer #%" G_GSIZE_FORMAT " from %s: %s",
j, path, local_error->message);
g_clear_error (&local_error);
continue;
}
g_ptr_array_add (vulkan_exp_layer_details, icd_details_new (layer));
}
g_debug ("Vulkan explicit layer #%" G_GSIZE_FORMAT " at %s: %s",
j, path, srt_vulkan_layer_get_library_path (layer));
g_debug ("Enumerating Vulkan implicit layers on provider system...");
vulkan_implicit_layers = srt_system_info_list_implicit_vulkan_layers (system_info);
g_ptr_array_add (vulkan_exp_layer_details, icd_details_new (layer));
}
vulkan_imp_layer_details = g_ptr_array_new_full (g_list_length (vulkan_implicit_layers),
(GDestroyNotify) G_CALLBACK (icd_details_free));
g_debug ("Enumerating Vulkan implicit layers on provider system...");
vulkan_implicit_layers = srt_system_info_list_implicit_vulkan_layers (system_info);
for (icd_iter = vulkan_implicit_layers, j = 0;
icd_iter != NULL;
icd_iter = icd_iter->next, j++)
{
SrtVulkanLayer *layer = icd_iter->data;
const gchar *path = srt_vulkan_layer_get_json_path (layer);
GError *local_error = NULL;
vulkan_imp_layer_details = g_ptr_array_new_full (g_list_length (vulkan_implicit_layers),
(GDestroyNotify) G_CALLBACK (icd_details_free));
if (!srt_vulkan_layer_check_error (layer, &local_error))
for (icd_iter = vulkan_implicit_layers, j = 0;
icd_iter != NULL;
icd_iter = icd_iter->next, j++)
{
g_debug ("Failed to load Vulkan Layer #%" G_GSIZE_FORMAT " from %s: %s",
j, path, local_error->message);
g_clear_error (&local_error);
continue;
}
SrtVulkanLayer *layer = icd_iter->data;
const gchar *path = srt_vulkan_layer_get_json_path (layer);
GError *local_error = NULL;
if (!srt_vulkan_layer_check_error (layer, &local_error))
{
g_debug ("Failed to load Vulkan Layer #%" G_GSIZE_FORMAT " from %s: %s",
j, path, local_error->message);
g_clear_error (&local_error);
continue;
}
g_debug ("Vulkan implicit layer #%" G_GSIZE_FORMAT " at %s: %s",
j, path, srt_vulkan_layer_get_library_path (layer));
g_debug ("Vulkan implicit layer #%" G_GSIZE_FORMAT " at %s: %s",
j, path, srt_vulkan_layer_get_library_path (layer));
g_ptr_array_add (vulkan_imp_layer_details, icd_details_new (layer));
g_ptr_array_add (vulkan_imp_layer_details, icd_details_new (layer));
}
}
/* We set this FALSE later if we decide not to use the provider libc
......@@ -2866,15 +2894,18 @@ pv_runtime_use_provider_graphics_stack (PvRuntime *self,
return FALSE;
}
g_debug ("Collecting Vulkan explicit layers from host system...");
if (!collect_vulkan_layers (self, vulkan_exp_layer_details, arch,
"vulkan_exp_layer", error))
return FALSE;
if (self->flags & PV_RUNTIME_FLAGS_IMPORT_VULKAN_LAYERS)
{
g_debug ("Collecting Vulkan explicit layers from host system...");
if (!collect_vulkan_layers (self, vulkan_exp_layer_details, arch,
"vulkan_exp_layer", error))
return FALSE;
g_debug ("Collecting Vulkan implicit layers from host system...");
if (!collect_vulkan_layers (self, vulkan_imp_layer_details, arch,
"vulkan_imp_layer", error))
return FALSE;
g_debug ("Collecting Vulkan implicit layers from host system...");
if (!collect_vulkan_layers (self, vulkan_imp_layer_details, arch,
"vulkan_imp_layer", error))
return FALSE;
}
g_debug ("Enumerating %s VDPAU ICDs on host system...", arch->details->tuple);
vdpau_drivers = srt_system_info_list_vdpau_drivers (system_info,
......@@ -3127,6 +3158,31 @@ pv_runtime_use_provider_graphics_stack (PvRuntime *self,
if (!try_bind_dri (self, arch, bwrap, g_ptr_array_index (dirs, j), error))
return FALSE;
}
/* Unfortunately VDPAU_DRIVER_PATH can hold just a single path, so we can't
* easily list both x86_64 and i386 paths. As a workaround we set
* VDPAU_DRIVER_PATH based on ${PLATFORM} - but each of our
* supported ABIs can have multiple values for ${PLATFORM}, so we
* need to create symlinks. Try to avoid making use of this,
* because it's fragile (a new glibc version can introduce
* new platform strings), but for some things like VDPAU it's our
* only choice. */
for (j = 0; j < G_N_ELEMENTS (arch->details->platforms); j++)
{
g_autofree gchar *platform_link = NULL;
if (arch->details->platforms[j] == NULL)
break;
platform_link = g_strdup_printf ("%s/lib/platform-%s",
self->overrides,
arch->details->platforms[j]);
if (symlink (arch->details->tuple, platform_link) != 0)
return glnx_throw_errno_prefix (error,
"Unable to create symlink %s -> %s",
platform_link, arch->details->tuple);
}
}
}
......@@ -3370,17 +3426,20 @@ pv_runtime_use_provider_graphics_stack (PvRuntime *self,
vulkan_path, error))
return FALSE;
g_debug ("Setting up Vulkan explicit layer JSON...");
if (!setup_vulkan_loadable_json (self, bwrap, "explicit_layer.d",
vulkan_exp_layer_details,
vulkan_exp_layer_path, error))
return FALSE;
if (self->flags & PV_RUNTIME_FLAGS_IMPORT_VULKAN_LAYERS)
{
g_debug ("Setting up Vulkan explicit layer JSON...");
if (!setup_vulkan_loadable_json (self, bwrap, "explicit_layer.d",
vulkan_exp_layer_details,
vulkan_exp_layer_path, error))
return FALSE;
g_debug ("Setting up Vulkan implicit layer JSON...");
if (!setup_vulkan_loadable_json (self, bwrap, "implicit_layer.d",
vulkan_imp_layer_details,
vulkan_imp_layer_path, error))
return FALSE;
g_debug ("Setting up Vulkan implicit layer JSON...");
if (!setup_vulkan_loadable_json (self, bwrap, "implicit_layer.d",
vulkan_imp_layer_details,
vulkan_imp_layer_path, error))
return FALSE;
}
for (j = 0; j < va_api_icd_details->len; j++)
{
......@@ -3424,27 +3483,30 @@ pv_runtime_use_provider_graphics_stack (PvRuntime *self,
else
g_hash_table_add (extra_locked_vars_to_unset, g_strdup ("VK_ICD_FILENAMES"));
/* Implicit layers are not affected by "VK_LAYER_PATH". So instead of using
* this environment variable, we prepend our "/overrides/share" to
* "XDG_DATA_DIRS" to cover any explicit and implicit layers that we may
* have. */
if (vulkan_exp_layer_path->len != 0 || vulkan_imp_layer_path->len != 0)
if (self->flags & PV_RUNTIME_FLAGS_IMPORT_VULKAN_LAYERS)
{
const gchar *xdg_data_dirs;
g_autofree gchar *prepended_data_dirs = NULL;
g_autofree gchar *override_share = NULL;
/* Implicit layers are not affected by "VK_LAYER_PATH". So instead of using
* this environment variable, we prepend our "/overrides/share" to
* "XDG_DATA_DIRS" to cover any explicit and implicit layers that we may
* have. */
if (vulkan_exp_layer_path->len != 0 || vulkan_imp_layer_path->len != 0)
{
const gchar *xdg_data_dirs;
g_autofree gchar *prepended_data_dirs = NULL;
g_autofree gchar *override_share = NULL;
xdg_data_dirs = g_environ_getenv (self->original_environ, "XDG_DATA_DIRS");
override_share = g_build_filename (self->overrides_in_container, "share", NULL);
xdg_data_dirs = g_environ_getenv (self->original_environ, "XDG_DATA_DIRS");
override_share = g_build_filename (self->overrides_in_container, "share", NULL);
if (xdg_data_dirs != NULL)
prepended_data_dirs = g_strdup_printf ("%s:%s", override_share, xdg_data_dirs);
else
prepended_data_dirs = g_steal_pointer (&override_share);
if (xdg_data_dirs != NULL)
prepended_data_dirs = g_strdup_printf ("%s:%s", override_share, xdg_data_dirs);
else
prepended_data_dirs = g_steal_pointer (&override_share);
flatpak_bwrap_set_env (bwrap, "XDG_DATA_DIRS", prepended_data_dirs, TRUE);
flatpak_bwrap_set_env (bwrap, "XDG_DATA_DIRS", prepended_data_dirs, TRUE);
}
g_hash_table_add (extra_locked_vars_to_unset, g_strdup ("VK_LAYER_PATH"));
}
g_hash_table_add (extra_locked_vars_to_unset, g_strdup ("VK_LAYER_PATH"));
if (va_api_path->len != 0)
flatpak_bwrap_set_env (bwrap, "LIBVA_DRIVERS_PATH", va_api_path->str, TRUE);
......@@ -3455,47 +3517,13 @@ pv_runtime_use_provider_graphics_stack (PvRuntime *self,
* Unfortunately VDPAU_DRIVER_PATH can hold just a single path, so we can't
* easily list both x86_64 and i386 drivers path.
* As a workaround we set VDPAU_DRIVER_PATH to
* "/overrides/lib/${PLATFORM}-linux-gnu/vdpau". And because we can't control
* the ${PLATFORM} placeholder value we also create symlinks from `i486`, up
* to `i686`, to the library directory `i386` that we expect to have
* already. */
g_autofree gchar *vdpau_val = g_strdup_printf ("%s/lib/${PLATFORM}-linux-gnu/vdpau",
* "/overrides/lib/platform-${PLATFORM}/vdpau" (which is a symlink that we
* already created). */
g_autofree gchar *vdpau_val = g_strdup_printf ("%s/lib/platform-${PLATFORM}/vdpau",
self->overrides_in_container);
flatpak_bwrap_set_env (bwrap, "VDPAU_DRIVER_PATH", vdpau_val, TRUE);
static const char * const extra_multiarch_tuples[] =
{
"i486-linux-gnu",
"i586-linux-gnu",
"i686-linux-gnu",
NULL
};
g_autofree gchar *i386_libdir_in_current_namespace = g_build_filename (self->overrides,
"lib",
"i386-linux-gnu",
NULL);
for (i = 0; i < G_N_ELEMENTS (extra_multiarch_tuples) - 1; i++)
{
g_autofree gchar *extra_libdir_in_current_namespace = g_build_filename (self->overrides,
"lib",
extra_multiarch_tuples[i],
NULL);
if (!g_file_test (extra_libdir_in_current_namespace, G_FILE_TEST_EXISTS) &&
g_file_test (i386_libdir_in_current_namespace, G_FILE_TEST_IS_DIR))
{
g_unlink (extra_libdir_in_current_namespace);
if (symlink ("i386-linux-gnu", extra_libdir_in_current_namespace) != 0)
return glnx_throw_errno_prefix (error,
"Unable to create symlink %s -> i386-linux-gnu",
extra_libdir_in_current_namespace);
}
}
return TRUE;
}
......
......@@ -34,6 +34,8 @@
* @PV_RUNTIME_FLAGS_PROVIDER_GRAPHICS_STACK: Use provider graphics stack
* @PV_RUNTIME_FLAGS_GENERATE_LOCALES: Generate missing locales
* @PV_RUNTIME_FLAGS_GC_RUNTIMES: Garbage-collect old temporary runtimes
* @PV_RUNTIME_FLAGS_VERBOSE: Be more verbose
* @PV_RUNTIME_FLAGS_IMPORT_VULKAN_LAYERS: Include host Vulkan layers
* @PV_RUNTIME_FLAGS_NONE: None of the above
*
* Flags affecting how we set up the runtime.
......@@ -44,6 +46,7 @@ typedef enum
PV_RUNTIME_FLAGS_GENERATE_LOCALES = (1 << 1),
PV_RUNTIME_FLAGS_GC_RUNTIMES = (1 << 2),
PV_RUNTIME_FLAGS_VERBOSE = (1 << 3),
PV_RUNTIME_FLAGS_IMPORT_VULKAN_LAYERS = (1 << 4),
PV_RUNTIME_FLAGS_NONE = 0
} PvRuntimeFlags;
......@@ -52,6 +55,7 @@ typedef enum
| PV_RUNTIME_FLAGS_GENERATE_LOCALES \
| PV_RUNTIME_FLAGS_GC_RUNTIMES \
| PV_RUNTIME_FLAGS_VERBOSE \
| PV_RUNTIME_FLAGS_IMPORT_VULKAN_LAYERS \
)
typedef struct _PvRuntime PvRuntime;
......
......@@ -69,6 +69,13 @@ pressure-vessel-wrap - run programs in a bubblewrap container
*COMMAND*. If *COMMAND* is run in a container, the path of the
*MODULE* will be adjusted appropriately.
`--import-vulkan-layers`, `--no-import-vulkan-layers`
: If `--no-import-vulkan-layers` is specified, the Vulkan layers will
not be imported from the host system. Please note that some layers might
still be reachable from inside the container. E.g. layers located in
`~/.local/share/vulkan` if used in combination with `--share-home`.
The default is `--import-vulkan-layers`.
`--keep-game-overlay`, `--remove-game-overlay`
: If `--remove-game-overlay` is specified, remove the Steam Overlay
from the `LD_PRELOAD`. The default is `--keep-game-overlay`.
......@@ -240,6 +247,10 @@ The following environment variables (among others) are read by
: If set to `1`, equivalent to `--with-host-graphics`.
If set to `0`, equivalent to `--without-host-graphics`.
`PRESSURE_VESSEL_IMPORT_VULKAN_LAYERS` (boolean)
: If set to `1`, equivalent to `--import-vulkan-layers`.
If set to `0`, equivalent to `--no-import-vulkan-layers`.
`PRESSURE_VESSEL_REMOVE_GAME_OVERLAY` (boolean)
: If set to `1`, equivalent to `--remove-game-overlay`.
If set to `0`, equivalent to `--keep-game-overlay`.
......
......@@ -728,6 +728,7 @@ static char *graphics_provider_mount_point = NULL;
static gboolean opt_launcher = FALSE;
static gboolean opt_only_prepare = FALSE;
static gboolean opt_remove_game_overlay = FALSE;
static gboolean opt_import_vulkan_layers = TRUE;
static PvShell opt_shell = PV_SHELL_NONE;
static GPtrArray *opt_ld_preload = NULL;
static GArray *opt_pass_fds = NULL;
......@@ -1056,6 +1057,20 @@ static GOptionEntry options[] =
"Do not disable the Steam Overlay. "
"[Default unless $PRESSURE_VESSEL_REMOVE_GAME_OVERLAY is 1]",
NULL },
{ "import-vulkan-layers", '\0',
G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, &opt_import_vulkan_layers,
"Import Vulkan layers from the host system. "
"[Default unless $PRESSURE_VESSEL_IMPORT_VULKAN_LAYERS is 0]",
NULL },
{ "no-import-vulkan-layers", '\0',
G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &opt_import_vulkan_layers,
"Do not import Vulkan layers from the host system. Please note that "
"certain Vulkan layers might still continue to be reachable from inside "
"the container. This could be the case for all the layers located in "
" `~/.local/share/vulkan` for example, because we usually share the real "
"home directory."
"[Default if $PRESSURE_VESSEL_IMPORT_VULKAN_LAYERS is 0]",
NULL },
{ "runtime", '\0',
G_OPTION_FLAG_NONE, G_OPTION_ARG_FILENAME, &opt_runtime,
"Mount the given sysroot or merged /usr in the container, and augment "
......@@ -1282,6 +1297,9 @@ main (int argc,
opt_remove_game_overlay = pv_boolean_environment ("PRESSURE_VESSEL_REMOVE_GAME_OVERLAY",
FALSE);
opt_import_vulkan_layers = pv_boolean_environment ("PRESSURE_VESSEL_IMPORT_VULKAN_LAYERS",
TRUE);
opt_share_home = tristate_environment ("PRESSURE_VESSEL_SHARE_HOME");
opt_gc_runtimes = pv_boolean_environment ("PRESSURE_VESSEL_GC_RUNTIMES", TRUE);
opt_generate_locales = pv_boolean_environment ("PRESSURE_VESSEL_GENERATE_LOCALES", TRUE);
......@@ -1744,6 +1762,9 @@ main (int argc,
if (opt_verbose)
flags |= PV_RUNTIME_FLAGS_VERBOSE;
if (opt_import_vulkan_layers)
flags |= PV_RUNTIME_FLAGS_IMPORT_VULKAN_LAYERS;
g_debug ("Configuring runtime %s...", opt_runtime);
runtime = pv_runtime_new (opt_runtime,
......