diff --git a/include/hsakmttypes.h b/include/hsakmttypes.h index 9f1b2ccb24..86cf248fa2 100644 --- a/include/hsakmttypes.h +++ b/include/hsakmttypes.h @@ -567,7 +567,9 @@ typedef struct _HsaMemFlags unsigned int NoAddress: 1; // only do vram allocation, return a handle, not allocate virtual address. unsigned int OnlyAddress: 1; // only do virtal address allocation without vram allocation. unsigned int ExtendedCoherent: 1; // system-scope coherence on atomic instructions - unsigned int Reserved: 11; + 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; } ui32; HSAuint32 Value; diff --git a/src/memory.c b/src/memory.c index 5eeaa9fecc..f121726f77 100644 --- a/src/memory.c +++ b/src/memory.c @@ -152,7 +152,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtAllocMemory(HSAuint32 PreferredNode, } /* GPU allocated system memory */ - if (!gpu_id || !MemFlags.ui32.NonPaged || zfb_support) { + if (!gpu_id || !MemFlags.ui32.NonPaged || zfb_support || MemFlags.ui32.GTTAccess) { /* Backwards compatibility hack: Allocate system memory if app * asks for paged memory from a GPU node. */