Revert "radv: acquire pstate on-demand when capturing with RGP"

This change is wrong for two reasons:
- it hangs most of the time maybe, because changing PSTATE when the
  application is running is broken somehow
- it increases the time between triggering and generating the capture
  considerably, because there is a delay for changing PSTATE

This restores previous logic where PSTATE is set to profile_peak at
logical device creation. Though, it also re-introduces an issue with
multiple logical devices (kernel returns -EBUSY) but this will be
fixed in the next commit.

This fixes GPU hangs when trying to record RGP captures on my NAVI21.
Note that profile_peak is only required for some RDNA2 chips (including
VanGogh).

Cc: mesa-stable
This reverts commit 923a864d94.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21222>
This commit is contained in:
Samuel Pitoiset
2023-02-09 15:16:47 +01:00
committed by Marge Bot
parent c426e5677f
commit 663877e894
2 changed files with 4 additions and 6 deletions
+1 -6
View File
@@ -512,10 +512,6 @@ radv_handle_thread_trace(VkQueue _queue)
radv_end_thread_trace(queue);
thread_trace_enabled = false;
if (!radv_device_set_pstate(queue->device, false)) {
fprintf(stderr, "radv: Failed to restore previous pstate, ignoring.\n");
}
/* TODO: Do something better than this whole sync. */
queue->device->vk.dispatch_table.QueueWaitIdle(_queue);
@@ -551,8 +547,7 @@ radv_handle_thread_trace(VkQueue _queue)
#endif
if (frame_trigger || file_trigger || resize_trigger) {
if (!radv_device_set_pstate(queue->device, true) ||
ac_check_profile_state(&queue->device->physical_device->rad_info)) {
if (ac_check_profile_state(&queue->device->physical_device->rad_info)) {
fprintf(stderr, "radv: Canceling RGP trace request as a hang condition has been "
"detected. Force the GPU into a profiling mode with e.g. "
"\"echo profile_peak > "
+3
View File
@@ -526,6 +526,9 @@ radv_thread_trace_init(struct radv_device *device)
if (!radv_thread_trace_init_bo(device))
return false;
if (!radv_device_acquire_performance_counters(device))
return false;
list_inithead(&thread_trace_data->rgp_pso_correlation.record);
simple_mtx_init(&thread_trace_data->rgp_pso_correlation.lock, mtx_plain);