From 8f7c7458aa7e93021bb723dc40e9b2022113f7d1 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 22 May 2025 23:44:43 +0000 Subject: [PATCH] rocr: Remove extra check for page-aligned ROCr initially had a bug where memory allocations that were not 4K aligned were internally 4K aligned but ROCr would not keep track of user-requested size. This would cause some pointer_info queries to fail, but HIP was already aligning the buffer sizes for IPC requests. For backward compatibility accross 2 minor versions, we allowed IPC look-ups to be both aligned and un-aligned. Removing this check as this 4 minor versions have been released since then. [ROCm/ROCR-Runtime commit: d52f1d045304c426e8fc4681f5314580f6c6d6b4] --- .../runtime/hsa-runtime/core/runtime/runtime.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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 38620c8e73..4413a017be 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -1215,13 +1215,8 @@ hsa_status_t Runtime::IPCCreate(void* ptr, size_t len, hsa_amd_ipc_memory_t* han if (PtrInfo(ptr, &info, nullptr, nullptr, nullptr, &block) != HSA_STATUS_SUCCESS) return HSA_STATUS_ERROR_INVALID_ARGUMENT; - // Temporary: Previous versions of HIP will call hsa_amd_ipc_memory_create with the len aligned to - // granularity. We need to maintain backward compatibility for 2 releases so we temporarily allow - // this. After 2 releases, we will only allow info.sizeInBytes != len. - if ((info.agentBaseAddress != ptr) || - (info.sizeInBytes != len && AlignUp(info.sizeInBytes, pageSize) != len)) { + if (info.agentBaseAddress != ptr || info.sizeInBytes != len) return HSA_STATUS_ERROR_INVALID_ARGUMENT; - } bool useFrag = (block.base != ptr || block.length != len); // Assume all pointers and blocks are 4Kb aligned.