From 07fb34525c0639e2e2f462fecfcf6e7b45c871e1 Mon Sep 17 00:00:00 2001 From: Jianxin Xiong Date: Tue, 29 Oct 2024 11:40:18 -0700 Subject: [PATCH] prov/verbs: Enable implicit dmabuf mr reg for more HMEM ifaces Now all the non-system HMEM ifaces have get_dmabuf_fd method defined, it's safe to always try the dmabuf based memory registration first. If it fails for any reason (e.g. CUDA is not configured with dmabuf support), the failover path will try the peer memory approach when available. Signed-off-by: Jianxin Xiong --- prov/verbs/src/verbs_mr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/prov/verbs/src/verbs_mr.c b/prov/verbs/src/verbs_mr.c index 9c7199d99eb..47ccf9d97ce 100644 --- a/prov/verbs/src/verbs_mr.c +++ b/prov/verbs/src/verbs_mr.c @@ -142,12 +142,9 @@ vrb_mr_reg_common(struct vrb_mem_desc *md, int vrb_access, const void *base_addr md->mr = ibv_reg_dmabuf_mr(md->domain->pd, (uintptr_t) buf, len, (uintptr_t) base_addr + (uintptr_t) buf, (int) device, vrb_access); - else if (vrb_gl_data.dmabuf_support && - (iface == FI_HMEM_ZE || - iface == FI_HMEM_SYNAPSEAI || - iface == FI_HMEM_ROCR)) + else if (vrb_gl_data.dmabuf_support && iface != FI_HMEM_SYSTEM) md->mr = vrb_reg_hmem_dmabuf(iface, md->domain->pd, buf, len, - vrb_access); + vrb_access); else #endif md->mr = ibv_reg_mr(md->domain->pd, (void *) buf, len,