From 15691ae4602bcf26b49c81194682f47673f9fdff Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 31 Jan 2024 16:19:58 -0500 Subject: [PATCH] Fix DMABuf FD closure for IPC attach client We should also close the client side dmabuf fd after importing for target nodes. Change-Id: I74f61dd65bebb03dc002f5df7301efd1ef8d9603 --- runtime/hsa-runtime/core/runtime/runtime.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/hsa-runtime/core/runtime/runtime.cpp b/runtime/hsa-runtime/core/runtime/runtime.cpp index d3c5197a34..4db85ab4b8 100644 --- a/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -1375,6 +1375,7 @@ hsa_status_t Runtime::IPCAttach(const hsa_amd_ipc_memory_t* handle, size_t len, if (ret != HSA_STATUS_SUCCESS) return HSA_STATUS_ERROR_INVALID_ARGUMENT; if (ipc_dmabuf_supported_) { + close(dmabuf_fd); importAddress = info.MemoryAddress; importSize = info.SizeInBytes; }