kfdtest: fix MigrateLargeBufTest issue

Since the amdgpu driver commit 1f4ac94b59aebebf.
https://lore.kernel.org/all/a121a72c-b441-4f42-94a3-4597b7f19e7d@amd.com/T/
gtt and vram are available for compute.
So, the vramSize obtained by function GetSysMemSize is actually about 50% system memory.
But small APUs don't have large system memory, and kernel memory limit is smaller for them.
Therefore, it will fail to register SVM Range for SysBuffer and SysBuffer2.

Example:
  System Memory size: 3373M   Kernel memory limit:1791M
  VRAM Memory Size: 256M    GTT Memory Size: 1686M

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Change-Id: Ib3826933100ab7b432cb476caaf2d91cc9cdb948
Signed-off-by: Chris Freehill <cfreehil@amd.com>


[ROCm/ROCR-Runtime commit: 1abd02af32]
This commit is contained in:
Jesse Zhang
2024-05-23 08:34:23 +08:00
zatwierdzone przez Chris Freehill
rodzic 6fec39ae64
commit f38a5ea841
@@ -814,6 +814,13 @@ TEST_P(KFDSVMRangeTest, MigrateLargeBufTest) {
BufferSize = MIN(BufferSize, vramSize * 3 / 4);
/* Check if the system memory size is sufficient
* to register the system buffer and system buffer 2
*/
if(BufferSize * 2 > GetSysMemSize() / 2) {
LOG() << "Skipping test: Not enough system memory." << std::endl;
return;
}
HsaSVMRange SysBuffer(BufferSize, defaultGPUNode);
SysBuffer.Fill(0x1);