From 541d0dbbaeb31107e58102eafa2a670e9a49453d Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Fri, 29 Mar 2024 17:11:21 +0000 Subject: [PATCH] Set NUMA region to 0 when using GTTAccess flag When allocating memory for MES AQL queue structure, the PreferredNode is set to the device index of GPU to hint the location where the BO needs to be created. But we need to ignore the device index when calling bind_mem_to_numa. Change-Id: Iae69fe02bfd48c5a3bd495319f6f2706d6e8aea2 --- src/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/memory.c b/src/memory.c index f121726f77..964becdc0a 100644 --- a/src/memory.c +++ b/src/memory.c @@ -161,8 +161,8 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtAllocMemory(HSAuint32 PreferredNode, if (zfb_support && gpu_id && MemFlags.ui32.NonPaged == 1) MemFlags.ui32.CoarseGrain = 1; - *MemoryAddress = fmm_allocate_host(gpu_id, PreferredNode, *MemoryAddress, - SizeInBytes, MemFlags); + *MemoryAddress = fmm_allocate_host(gpu_id, MemFlags.ui32.GTTAccess ? 0 : PreferredNode, + *MemoryAddress, SizeInBytes, MemFlags); if (!(*MemoryAddress)) { pr_err("[%s] failed to allocate %lu bytes from host\n",