ROCR-Runtime
ROCR-Runtime copied to clipboard
Supports architectures and operating systems that use large page size
This patch will support architectures and operating systems( centos or openEuler on aarch64 ) that use large page size, like 64KB, 2MB PAGE SEZE.
I found a memory allocation error, when rocm-info runs on an operating system with PAGE_SIZE_64KB. The debug information is shown in the figure.

The function call path that caused the error is as follows: BindVmFaultHandler->InterruptSignal->LocalSignal->Shared->SharedSignalPool_t::alloc->Runtime::AllocateMemory->MemoryRegion::Allocate->AllocateKfdMemory->hsaKmtAllocMemory->fmm_allocate_host->fmm_allocate_host_gpu->aperture_allocate_area->reserved_aperture_allocate_aligned. After the function aperture_allocate_area is called, mmap will be called immediately and cause an error.
Since kPageSize_ in ROCR is set to 4K, the memory allocated by the function reserved_aperture_allocate_aligned in ROCT-Thunk-Interface is always aligned with 4K. When the kernel page size is other values, the anonymous mmap with MAP_FIXED called later will fail.