vulkan: add MESA_VK_TRACE_PER_SUBMIT

To capture RGP per-submit for compute-only workloads. Other capture
tools like RMV are not covered here.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32370>
This commit is contained in:
Samuel Pitoiset
2024-11-27 10:47:09 +01:00
committed by Marge Bot
parent 86465a3f2b
commit 851a8a481b
3 changed files with 15 additions and 2 deletions

View File

@@ -365,14 +365,21 @@ Core Mesa environment variables
- Creating RMV captures requires the ``scripts/setup.sh`` script in the
Radeon Developer Tools folder to be run beforehand
.. envvar:: MESA_VK_TRACE_PER_SUBMIT
Enables per-submit capture for compute-only workload. Disabled by default
and only valid with MESA_VK_TRACE=rgp.
.. envvar:: MESA_VK_TRACE_FRAME
Specifies a frame index at which a trace capture is automatically triggered.
Ignored when MESA_VK_TRACE_PER_SUBMIT is enabled.
.. envvar:: MESA_VK_TRACE_TRIGGER
Specifies a trigger file. Creating the file triggers the capture. (e.g.
``export MESA_VK_TRACE_TRIGGER=/tmp/trigger`` and then ``touch /tmp/trigger``)
Ignored when MESA_VK_TRACE_PER_SUBMIT is enabled.
.. envvar:: MESA_LOADER_DRIVER_OVERRIDE

View File

@@ -200,8 +200,11 @@ vk_instance_init(struct vk_instance *instance,
}
instance->trace_mode = parse_debug_string(getenv("MESA_VK_TRACE"), trace_options);
instance->trace_frame = (uint32_t)debug_get_num_option("MESA_VK_TRACE_FRAME", 0xFFFFFFFF);
instance->trace_trigger_file = secure_getenv("MESA_VK_TRACE_TRIGGER");
instance->trace_per_submit = debug_get_bool_option("MESA_VK_TRACE_PER_SUBMIT", false);
if (!instance->trace_per_submit) {
instance->trace_frame = (uint32_t)debug_get_num_option("MESA_VK_TRACE_FRAME", 0xFFFFFFFF);
instance->trace_trigger_file = secure_getenv("MESA_VK_TRACE_TRIGGER");
}
#if !VK_LITE_RUNTIME_INSTANCE
glsl_type_singleton_init_or_ref();

View File

@@ -173,6 +173,9 @@ struct vk_instance {
uint32_t trace_frame;
char *trace_trigger_file;
/** Whether the capture mode is per-submit. */
bool trace_per_submit;
};
VK_DEFINE_HANDLE_CASTS(vk_instance, base, VkInstance,