libhsakmt: Set CWSR range granularity

Set CWSR svm range granularity to 0xff, then KFD will migrate the entire
CWSR range from VRAM back to system memory when recovering the CPU page
fault if rocgdb access CWSR area, this avoid the partial CWSR range
migration and stall CWSR GPU mapping issue.

This is a temporary workaround, it should be reverted once the KFD is
fixed.

Change-Id: I80a7248244574edba25b13858b7ebcf1c77b8930
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 85a47fa66b]
This commit is contained in:
Philip Yang
2023-10-04 08:41:18 -04:00
förälder 254e8219b3
incheckning cf6745a36c
+3 -1
Visa fil
@@ -413,7 +413,7 @@ static HSAKMT_STATUS register_svm_range(void *mem, uint32_t size,
flags |= HSA_SVM_FLAG_GPU_ALWAYS_MAPPED;
}
nattr = 5;
nattr = 6;
s_attr = sizeof(*attrs) * nattr;
attrs = (HSA_SVM_ATTRIBUTE *)alloca(s_attr);
@@ -427,6 +427,8 @@ static HSAKMT_STATUS register_svm_range(void *mem, uint32_t size,
attrs[3].value = flags;
attrs[4].type = HSA_SVM_ATTR_ACCESS;
attrs[4].value = gpuNode;
attrs[5].type = HSA_SVM_ATTR_GRANULARITY;
attrs[5].value = 0xFF;
return hsaKmtSVMSetAttr(mem, size, nattr, attrs);
}