From 77116d34eafa17f2d848017bfeeef00e07c73136 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 29 Mar 2022 10:23:40 +0200 Subject: [PATCH] radeonsi: make sure profile_peak is used before using sqtt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using sqtt without this profile can cause hangs. Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_pipe.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 5c5942faca6..0ddb3bfa14c 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -820,7 +820,12 @@ static struct pipe_context *si_pipe_create_context(struct pipe_screen *screen, v ctx = si_create_context(screen, flags); if (ctx && sscreen->info.chip_class >= GFX9 && sscreen->debug_flags & DBG(SQTT)) { - if (!si_init_thread_trace((struct si_context *)ctx)) { + if (ac_check_profile_state(&sscreen->info)) { + fprintf(stderr, "radeonsi: Canceling RGP trace request as a hang condition has been " + "detected. Force the GPU into a profiling mode with e.g. " + "\"echo profile_peak > " + "/sys/class/drm/card0/device/power_dpm_force_performance_level\"\n"); + } else if (!si_init_thread_trace((struct si_context *)ctx)) { FREE(ctx); return NULL; }