Skip to content

Commit 835157b

Browse files
authored
Add Support for Reporting IPC Fabric Accessible handle type creation (#450)
* Add IPC Fabric Accessible Support flag and expectations * Refine documentation on the IPC handle types Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent b97930a commit 835157b

3 files changed

Lines changed: 32 additions & 3 deletions

File tree

scripts/core/EXT_IPC_MEM_HANDLE_TYPE.rst

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@ When users are requesting IPC handles for L0 memory, there may be requirements f
3939

4040
To facilitate this, the IPC Memory Handle Type Extension provides a mechanism to specify the type of IPC handle to be created during memory allocation or when obtaining an IPC handle for existing memory.
4141

42+
Checking IPC Support
43+
~~~~~~~~~~~~~~~~~~~~~
44+
45+
Before requesting a specific IPC handle type, users can query the driver to determine what IPC handle types are supported by checking the IPC property flags:
46+
47+
.. parsed-literal::
48+
49+
${x}_ipc_properties_t ipcProps;
50+
${x}DeviceGetIpcProperties(hDevice, &ipcProps);
51+
52+
if (ipcProps.flags & ${X}_IPC_PROPERTY_FLAG_FABRIC_ACCESSIBLE) {
53+
// Driver supports fabric accessible IPC handles
54+
} else {
55+
// Fabric accessible IPC handles are not supported
56+
}
57+
58+
This approach allows applications to determine available IPC capabilities before attempting to create handles or allocate memory with specific IPC requirements.
59+
4260
Get IPC Handle Usage Example
4361
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4462

@@ -55,6 +73,10 @@ To request an IPC handle for L0 memory that is fabric accessible, the user would
5573
ze_ipc_mem_handle_t ipcHandle;
5674
ze_result_t result = zeMemGetIpcHandleWithProperties(hContext, ptr, &ipcHandle, &desc);
5775
76+
.. note::
77+
78+
If the driver does not support ``ZE_IPC_MEM_HANDLE_TYPE_FLAG_FABRIC_ACCESSIBLE``, the function will return ``ZE_RESULT_ERROR_UNSUPPORTED_FEATURE``. Applications can proactively check for support by querying ``${x}_ipc_properties_t`` as shown in the "Checking IPC Support" section above.
79+
5880

5981
Memory Allocation Usage Example
6082
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -94,4 +116,8 @@ To allocate L0 memory with an IPC handle that is fabric accessible, the user wou
94116
.size = size
95117
};
96118
void* physical_ptr = NULL;
97-
ze_result_t result = zePhysicalMemCreate(hContext, &physicalDesc, &physical_ptr);
119+
ze_result_t result = zePhysicalMemCreate(hContext, &physicalDesc, &physical_ptr);
120+
121+
.. note::
122+
123+
If the driver does not support ``ZE_IPC_MEM_HANDLE_TYPE_FLAG_FABRIC_ACCESSIBLE``, the memory allocation functions (``zeMemAllocDevice``, ``zeMemAllocHost``, ``zePhysicalMemCreate``) will return ``ZE_RESULT_ERROR_UNSUPPORTED_FEATURE``. Applications can proactively check for support by querying ``${x}_ipc_properties_t`` as shown in the "Checking IPC Support" section above.

scripts/core/driver.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,9 @@ etors:
299299
desc: "Supports passing memory allocations between processes. See $xMemGetIpcHandle."
300300
- name: EVENT_POOL
301301
desc: "Supports passing event pools between processes. See $xEventPoolGetIpcHandle."
302+
- name: FABRIC_ACCESSIBLE
303+
version: "1.16"
304+
desc: "Supports creating a handle type for memory allocations and event pools between processes on different physical devices connected through a fabric interconnect. See $x_ipc_mem_handle_type_ext_desc_t."
302305
--- #--------------------------------------------------------------------------
303306
type: struct
304307
desc: "IPC properties queried using $xDriverGetIpcProperties"

scripts/core/ipcMemHandleType.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ version: "1.15"
3333
etors:
3434
- name: DEFAULT
3535
value: "$X_BIT(0)"
36-
desc: "Local IPC memory handle type for use within the same machine."
36+
desc: "Local IPC memory handle type for use within the same device. This is the default if no flags are specified and does not indicate if the handle is shareable across devices or machines."
3737
- name: FABRIC_ACCESSIBLE
3838
value: "$X_BIT(1)"
39-
desc: "Fabric accessible IPC memory handle type for use across machines via a supported fabric."
39+
desc: "Fabric accessible IPC memory handle type for use across devices or machines via a supported fabric."
4040
--- #--------------------------------------------------------------------------
4141
type: struct
4242
desc:

0 commit comments

Comments
 (0)