From b66b6991b0ab90c133c8d8507208c3bcf5869230 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Wed, 21 May 2025 17:42:48 +0000 Subject: [PATCH] rocr: Remove scratch_backing_memory_byte_size scratch_backing_memory_byte_size was originally removed, and then put back in e1301722181a4c89f80d09bc879322cf8fad6c62. This was because it was used by rocgdb. rocgdb code has been updated to not use this field. Bumped _amdgpu_r_debug for the ABI change. [ROCm/ROCR-Runtime commit: 3c0af843e3d18ee5104c18e9f8bd40c74eb1861e] --- .../runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp | 9 --------- .../runtime/hsa-runtime/core/runtime/runtime.cpp | 2 +- .../rocr-runtime/runtime/hsa-runtime/inc/amd_hsa_queue.h | 6 +++--- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp index 53f7acfbc6..600b674bbb 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp @@ -1841,15 +1841,6 @@ void AqlQueue::InitScratchSRD() { amd_queue_.alt_scratch_backing_memory_location = queue_scratch_.alt_queue_process_offset; const auto& agent_props = agent_->properties(); - const uint32_t num_xcc = agent_props.NumXcc; - - // FIXME: amd_queue_.scratch_backing_memory_byte_size is not used by CP, but it - // is used by the debugger. Putting back the scratch_backing_memory_byte_size - // field. But we need to find a location for alt_scratch_backing_memory_byte_size - - // report size per XCC - amd_queue_.scratch_backing_memory_byte_size = queue_scratch_.main_size / num_xcc; - //amd_queue_.alt_scratch_backing_memory_byte_size = queue_scratch_.alt_size / num_xcc; // For backwards compatibility this field records the per-lane scratch // for a 64 lane wavefront. If scratch was allocated for 32 lane waves diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index c9450b0119..baebbe6017 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -2012,7 +2012,7 @@ Runtime::Runtime() asyncExceptions_.monitor_exceptions = true; g_use_interrupt_wait = true; g_use_mwaitx = true; - ::_amdgpu_r_debug = {10, + ::_amdgpu_r_debug = {11, nullptr, reinterpret_cast( &_loader_debug_state), diff --git a/projects/rocr-runtime/runtime/hsa-runtime/inc/amd_hsa_queue.h b/projects/rocr-runtime/runtime/hsa-runtime/inc/amd_hsa_queue.h index 0f3a759a21..9f16f9b2e5 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/inc/amd_hsa_queue.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/inc/amd_hsa_queue.h @@ -93,12 +93,12 @@ typedef struct AMD_QUEUE_ALIGN amd_queue_s { uint32_t compute_tmpring_size; uint32_t scratch_resource_descriptor[4]; uint64_t scratch_backing_memory_location; - uint64_t scratch_backing_memory_byte_size; + uint32_t reserved3[2]; uint32_t scratch_wave64_lane_byte_size; amd_queue_properties32_t queue_properties; - uint32_t reserved3[2]; + uint32_t reserved4[2]; hsa_signal_t queue_inactive_signal; - uint32_t reserved4[14]; + uint32_t reserved5[14]; } amd_queue_t; /*