From 976cf45b0c70762dedd5d8a657b83649d8c640a0 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 [ROCm/ROCR-Runtime commit: 15691ae4602bcf26b49c81194682f47673f9fdff] --- .../rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp | 1 + 1 file changed, 1 insertion(+) 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 d3c5197a34..4db85ab4b8 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/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; }