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
This commit is contained in:
Jonathan Kim
2024-09-27 15:15:33 -04:00
parent f27ae44b8c
commit 03463ed2c0
5 changed files with 47 additions and 4 deletions
+15
View File
@@ -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
View File
@@ -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)