libhsakmt: Fix improper usage of hsaKmtRegisterMemoryToNodes

It's unnecessary to register non-userptr.

Change-Id: Iefd329578365e036e2fe7e4d5c9c0c3d0976f67c
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>
This commit is contained in:
Lang Yu authored and Chris Freehill committed 2024-06-24 14:26:21 -05:00
1 parent 5eb2a2660c
commit a7a712fb36
3 files changed
+8 -15

No files matched your search

+6 -1
View File
@@ -363,11 +363,16 @@ void *allocate_exec_aligned_memory_gpu(uint32_t size, uint32_t align, uint32_t g
if (NodeId != 0) {
uint32_t nodes_array[1] = {NodeId};
HsaMemMapFlags map_flags = {0};
HSAKMT_STATUS result;
if (hsaKmtRegisterMemoryToNodes(mem, size, 1, nodes_array) != HSAKMT_STATUS_SUCCESS) {
result = hsaKmtMapMemoryToGPUNodes(mem, size, &gpu_va, map_flags, 1, nodes_array);
if (result != HSAKMT_STATUS_SUCCESS) {
hsaKmtFreeMemory(mem, size);
return NULL;
}
return mem;
}
if (hsaKmtMapMemoryToGPU(mem, size, &gpu_va) != HSAKMT_STATUS_SUCCESS) {