Skip to content

Commit

Permalink
prov/verbs: Enable implicit dmabuf mr reg for more HMEM ifaces
Browse files Browse the repository at this point in the history
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 <jianxin.xiong@intel.com>
  • Loading branch information
j-xiong committed Oct 30, 2024
1 parent 6cdfb7e commit 07fb345
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions prov/verbs/src/verbs_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 07fb345

Please sign in to comment.