hsakmt: Enable graphics handle registration with a virtual address

Currently registering graphics memory without specifying a target
node will return a memory handle that's not a virtual address.

As a result, ROCr is forced to register with a target node for
IPC usage.

Mapping memory without specifying a target node afterwards will
result in mapping to the target node that was imported because the
previous import call flags this node targeting action to future mapping.

For ROCr IPC usage, ROCr wants to map to all GPU nodes if the target node
is not specified.

Allow the caller to register graphics handles that returns a virtual
address without having to specify the target node so that the caller
can make a subsequent map call to all GPUs.

Change-Id: I5a935092b885cc3568e4f3a5dd951c7ec6c84fca
Tá an tiomantas seo le fáil i:
Jonathan Kim
2024-09-27 15:15:33 -04:00
tuismitheoir f27ae44b8c
tiomantas 03463ed2c0
D'athraigh 5 comhad le 47 breiseanna agus 4 scriosta
+15
Féach ar an gComhad
@@ -512,6 +512,21 @@ hsaKmtRegisterGraphicsHandleToNodes(
HSAuint32* NodeArray //IN
);
/**
Similar to hsaKmtRegisterGraphicsHandleToNodes but provides registration
options via RegisterFlags.
*/
HSAKMT_STATUS
HSAKMTAPI
hsaKmtRegisterGraphicsHandleToNodesExt(
HSAuint64 GraphicsResourceHandle, //IN
HsaGraphicsResourceInfo *GraphicsResourceInfo, //OUT
HSAuint64 NumberOfNodes, //IN
HSAuint32* NodeArray, //IN
HSA_REGISTER_MEM_FLAGS RegisterFlags //IN
);
/**
* Export a dmabuf handle and offset for a given memory address
*
+9
Féach ar an gComhad
@@ -1488,6 +1488,15 @@ typedef struct _HsaPcSamplingInfo
}
HsaPcSamplingInfo;
typedef union
{
HSAuint32 Value;
struct
{
unsigned int requiresVAddr : 1; // Requires virtual address
} ui32;
} HSA_REGISTER_MEM_FLAGS;
#pragma pack(pop, hsakmttypes_h)