|
| 1 | +From 979b23865d1908c55aef1a2d080463580b37e276 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Zhan Xue <zhan.xue@intel.com> |
| 3 | +Date: Wed, 19 Nov 2025 17:29:43 +0800 |
| 4 | +Subject: [PATCH 1/2] Enable xpu gdr |
| 5 | + |
| 6 | +Signed-off-by: Cherry Zhang <cherry.zhang@intel.com> |
| 7 | +Signed-off-by: Yihua Xu <yihua.xu@intel.com> |
| 8 | +--- |
| 9 | + src/uct/ib/base/ib_md.c | 6 ++++++ |
| 10 | + src/uct/ze/copy/ze_copy_md.c | 3 ++- |
| 11 | + 2 files changed, 8 insertions(+), 1 deletion(-) |
| 12 | + |
| 13 | +diff --git a/src/uct/ib/base/ib_md.c b/src/uct/ib/base/ib_md.c |
| 14 | +index b771eb91c..46c6b2a3b 100644 |
| 15 | +--- a/src/uct/ib/base/ib_md.c |
| 16 | ++++ b/src/uct/ib/base/ib_md.c |
| 17 | +@@ -1337,6 +1337,12 @@ ucs_status_t uct_ib_md_open_common(uct_ib_md_t *md, |
| 18 | + /* check if ROCM KFD driver is loaded */ |
| 19 | + uct_ib_check_gpudirect_driver(md, "/dev/kfd", UCS_MEMORY_TYPE_ROCM); |
| 20 | + |
| 21 | ++#if HAVE_ZE |
| 22 | ++ uct_ib_check_gpudirect_driver( |
| 23 | ++ md, "/sys/module/xe/srcversion", |
| 24 | ++ UCS_MEMORY_TYPE_ZE_DEVICE); |
| 25 | ++#endif |
| 26 | ++ |
| 27 | + /* Check for dma-buf support */ |
| 28 | + uct_ib_md_check_dmabuf(md); |
| 29 | + } |
| 30 | +diff --git a/src/uct/ze/copy/ze_copy_md.c b/src/uct/ze/copy/ze_copy_md.c |
| 31 | +index f60ec1ebd..0a59bd0c8 100644 |
| 32 | +--- a/src/uct/ze/copy/ze_copy_md.c |
| 33 | ++++ b/src/uct/ze/copy/ze_copy_md.c |
| 34 | +@@ -48,7 +48,8 @@ static ucs_status_t uct_ze_copy_md_query(uct_md_h md, uct_md_attr_v2_t *md_attr) |
| 35 | + md_attr->alloc_mem_types = UCS_BIT(UCS_MEMORY_TYPE_ZE_HOST) | |
| 36 | + UCS_BIT(UCS_MEMORY_TYPE_ZE_DEVICE) | |
| 37 | + UCS_BIT(UCS_MEMORY_TYPE_ZE_MANAGED); |
| 38 | +- md_attr->access_mem_types = UCS_BIT(UCS_MEMORY_TYPE_ZE_HOST) | |
| 39 | ++ md_attr->access_mem_types = UCS_BIT(UCS_MEMORY_TYPE_HOST) | |
| 40 | ++ UCS_BIT(UCS_MEMORY_TYPE_ZE_HOST) | |
| 41 | + UCS_BIT(UCS_MEMORY_TYPE_ZE_DEVICE) | |
| 42 | + UCS_BIT(UCS_MEMORY_TYPE_ZE_MANAGED); |
| 43 | + md_attr->detect_mem_types = UCS_BIT(UCS_MEMORY_TYPE_ZE_HOST) | |
| 44 | +-- |
| 45 | +2.43.0 |
| 46 | + |
| 47 | + |
| 48 | +From f5c4c8e0538af488272a86cae0176cfdcbc9d667 Mon Sep 17 00:00:00 2001 |
| 49 | +From: Zhan Xue <zhan.xue@intel.com> |
| 50 | +Date: Fri, 21 Nov 2025 22:46:25 +0800 |
| 51 | +Subject: [PATCH 2/2] Fix compilation |
| 52 | + |
| 53 | +Signed-off-by: Zhan Xue <zhan.xue@intel.com> |
| 54 | +--- |
| 55 | + src/uct/ze/copy/ze_copy_iface.c | 6 +++--- |
| 56 | + src/uct/ze/copy/ze_copy_md.c | 4 ++-- |
| 57 | + 2 files changed, 5 insertions(+), 5 deletions(-) |
| 58 | + |
| 59 | +diff --git a/src/uct/ze/copy/ze_copy_iface.c b/src/uct/ze/copy/ze_copy_iface.c |
| 60 | +index f09949933..9de97bff4 100644 |
| 61 | +--- a/src/uct/ze/copy/ze_copy_iface.c |
| 62 | ++++ b/src/uct/ze/copy/ze_copy_iface.c |
| 63 | +@@ -196,9 +196,9 @@ uct_ze_copy_estimate_perf(uct_iface_h tl_iface, uct_perf_attr_t *perf_attr) |
| 64 | + |
| 65 | + static uct_iface_internal_ops_t uct_ze_copy_iface_internal_ops = { |
| 66 | + .iface_estimate_perf = uct_ze_copy_estimate_perf, |
| 67 | +- .iface_vfs_refresh = ucs_empty_function, |
| 68 | +- .ep_query = ucs_empty_function_return_unsupported, |
| 69 | +- .ep_invalidate = ucs_empty_function_return_unsupported, |
| 70 | ++ .iface_vfs_refresh = (void (*)(struct uct_iface *))ucs_empty_function, |
| 71 | ++ .ep_query = (ucs_status_t (*)(struct uct_ep *, uct_ep_attr_t *))ucs_empty_function_return_unsupported, |
| 72 | ++ .ep_invalidate = (ucs_status_t (*)(struct uct_ep *, unsigned int))ucs_empty_function_return_unsupported, |
| 73 | + .ep_connect_to_ep_v2 = (uct_ep_connect_to_ep_v2_func_t)ucs_empty_function_return_unsupported, |
| 74 | + .iface_is_reachable_v2 = uct_ze_copy_iface_is_reachable_v2, |
| 75 | + .ep_is_connected = uct_base_ep_is_connected |
| 76 | +diff --git a/src/uct/ze/copy/ze_copy_md.c b/src/uct/ze/copy/ze_copy_md.c |
| 77 | +index 0a59bd0c8..98c8ed428 100644 |
| 78 | +--- a/src/uct/ze/copy/ze_copy_md.c |
| 79 | ++++ b/src/uct/ze/copy/ze_copy_md.c |
| 80 | +@@ -249,9 +249,9 @@ static uct_md_ops_t md_ops = { |
| 81 | + .mem_free = uct_ze_copy_mem_free, |
| 82 | + .mem_advise = (uct_md_mem_advise_func_t)ucs_empty_function_return_unsupported, |
| 83 | + .mem_reg = uct_ze_copy_mem_reg, |
| 84 | +- .mem_dereg = ucs_empty_function_return_success, |
| 85 | ++ .mem_dereg = (ucs_status_t (*)(struct uct_md *, const uct_md_mem_dereg_params_t *)) ucs_empty_function_return_success, |
| 86 | + .mem_query = uct_ze_copy_md_mem_query, |
| 87 | +- .mkey_pack = ucs_empty_function_return_success, |
| 88 | ++ .mkey_pack = (ucs_status_t (*)(struct uct_md *, void *, void *, size_t, const uct_md_mkey_pack_params_t *, void *))ucs_empty_function_return_success, |
| 89 | + .mem_attach = (uct_md_mem_attach_func_t)ucs_empty_function_return_unsupported, |
| 90 | + .detect_memory_type = uct_ze_copy_md_detect_memory_type, |
| 91 | + }; |
| 92 | +-- |
| 93 | +2.43.0 |
| 94 | + |
0 commit comments