libhsakmt: Support contiguous VRAM allocation flag

Add HsaMemFlags Contiguous bit for hsaKmtAllocMemory to allocate
contiguous VRAM, to support RDMA device with limited scatter-gather
ability.

Check KFD ioctl minor version >= 17.

Change-Id: I0db00dad125b2b7be523f343082641f59b850423
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
This commit is contained in:
Philip Yang
2024-02-05 19:34:14 -05:00
parent e2d742ac6f
commit 97497c7efc
4 changed files with 9 additions and 1 deletions
+2 -1
View File
@@ -569,7 +569,8 @@ typedef struct _HsaMemFlags
unsigned int ExtendedCoherent: 1; // system-scope coherence on atomic instructions
unsigned int GTTAccess: 1; // default = 0; If 1: The caller indicates this memory will be mapped to GART for MES
// KFD will allocate GTT memory with the Preferred_node set as gpu_id for GART mapping
unsigned int Reserved: 10;
unsigned int Contiguous: 1; // Allocate contiguous VRAM
unsigned int Reserved: 9;
} ui32;
HSAuint32 Value;
+1
View File
@@ -1029,6 +1029,7 @@ struct kfd_ioctl_acquire_vm_args {
#define KFD_IOC_ALLOC_MEM_FLAGS_COHERENT (1 << 26)
#define KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED (1 << 25)
#define KFD_IOC_ALLOC_MEM_FLAGS_EXT_COHERENT (1 << 24)
#define KFD_IOC_ALLOC_MEM_FLAGS_CONTIGUOUS_BEST_EFFORT (1 << 23)
/* Allocate memory for later SVM (shared virtual memory) mapping.
*