libhsakmt: allocate va in host path

Change-Id: I40a4395aca99ea8dfd8ff0ecde64eb2c3840d867
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com>


[ROCm/ROCR-Runtime commit: 26f001d3cb]
This commit is contained in:
Longlong Yao
2025-02-08 14:34:14 +08:00
committed by Yat Sin, David
parent fcd8d9795b
commit 082c6b7830
2 changed files with 6 additions and 1 deletions
@@ -1830,6 +1830,10 @@ static void *fmm_allocate_host_gpu(uint32_t gpu_id, uint32_t node_id, void *addr
if (mflags.ui32.AQLQueueMemory)
size = MemorySizeInBytes * 2;
/* special case for va allocation without real memory alloc */
if (mflags.ui32.OnlyAddress)
return fmm_allocate_va(gpu_id, address, size, aperture, alignment, mflags);
/* Paged memory is allocated as a userptr mapping, non-paged
* memory is allocated from KFD
*/
+2 -1
View File
@@ -176,7 +176,8 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtAllocMemoryAlign(HSAuint32 PreferredNode,
}
/* GPU allocated system memory */
if (!gpu_id || !MemFlags.ui32.NonPaged || hsakmt_zfb_support || MemFlags.ui32.GTTAccess) {
if (!gpu_id || !MemFlags.ui32.NonPaged || hsakmt_zfb_support || MemFlags.ui32.GTTAccess
|| MemFlags.ui32.OnlyAddress) {
/* Backwards compatibility hack: Allocate system memory if app
* asks for paged memory from a GPU node.
*/