From ff2c3dfcca98f769e82ce1c8c28d4dd16b38a8ff Mon Sep 17 00:00:00 2001 From: Ruili Ji Date: Sat, 23 Dec 2023 14:43:51 +0800 Subject: [PATCH] To fix sdma segment fault for error address pad_size address shall start from command_addr not (command_addr + total_command_size) Change-Id: I3d8491986caf2d4d5dc41b1d90286c21e7c0a457 [ROCm/ROCR-Runtime commit: 4b693513942d93043a2cadc9f131f023e739982b] --- .../runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp index ff33788fe2..669402b047 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp @@ -471,6 +471,7 @@ hsa_status_t BlitSdma: wrapped_index += fence_command_size_; BuildTrapCommand(command_addr, out_signal.signal_.event_id); + command_addr += trap_command_size_; bytes_written_[wrapped_index] = post_bytes; wrapped_index += trap_command_size_; } @@ -481,7 +482,7 @@ hsa_status_t BlitSdma: if (pad_size) { memset(command_addr, 0, pad_size); uint32_t *dword_command_addr = reinterpret_cast(command_addr); - dword_command_addr[total_command_size/4] = (pad_size/4 - 1) << 16; + dword_command_addr[0] = (pad_size/4 - 1) << 16; } ReleaseWriteAddress(curr_index, total_command_size + pad_size);