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>
[ROCm/ROCR-Runtime commit: 97497c7efc]
This commit is contained in:
@@ -1579,6 +1579,9 @@ void *fmm_allocate_device(uint32_t gpu_id, uint32_t node_id, void *address,
|
||||
if (mflags.ui32.ExtendedCoherent)
|
||||
ioc_flags |= KFD_IOC_ALLOC_MEM_FLAGS_EXT_COHERENT;
|
||||
|
||||
if (mflags.ui32.Contiguous)
|
||||
ioc_flags |= KFD_IOC_ALLOC_MEM_FLAGS_CONTIGUOUS_BEST_EFFORT;
|
||||
|
||||
mem = __fmm_allocate_device(gpu_id, address, size, aperture, &mmap_offset,
|
||||
ioc_flags, &vm_obj);
|
||||
|
||||
|
||||
@@ -115,6 +115,9 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtAllocMemory(HSAuint32 PreferredNode,
|
||||
|
||||
CHECK_KFD_OPEN();
|
||||
|
||||
if (MemFlags.ui32.Contiguous)
|
||||
CHECK_KFD_MINOR_VERSION(17);
|
||||
|
||||
pr_debug("[%s] node %d\n", __func__, PreferredNode);
|
||||
|
||||
result = validate_nodeid(PreferredNode, &gpu_id);
|
||||
|
||||
Reference in New Issue
Block a user