From b4f26534eb2b4369af3a2bfbe932cef394fd677f Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 25 Oct 2022 22:38:47 +0000 Subject: [PATCH] No-Op for allow access on imported IPC If hsa_amd_agents_allow_access is called for an imported IPC handle, ignore the request as this pointer will already have these pointers mapped to other GPUs during IPCAttach() Change-Id: I4bf33ed57e93b5a3ead749d4f87ab6f2750bed58 --- runtime/hsa-runtime/core/runtime/runtime.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/hsa-runtime/core/runtime/runtime.cpp b/runtime/hsa-runtime/core/runtime/runtime.cpp index a4cb90280f..50eac54c0b 100644 --- a/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -555,6 +555,12 @@ hsa_status_t Runtime::AllowAccess(uint32_t num_agents, } amd_region = reinterpret_cast(it->second.region); + + // Imported IPC handle entries inside allocation_map_ do not have an amd_region because they + // were allocated in the other process. Access is already granted during IPCAttach(). + if (!amd_region) + return HSA_STATUS_SUCCESS; + alloc_size = it->second.size; }