libhsakmt: add env var to en/dis registration through SVM

Setting this variable to '0' will force to disable memory
registration/allocation through SVM API mechanism.
Not setting this or setting to '1', SVM API will be used only if all
GPUs support it.

Signed-off-by: Alex Sierra <Alex.Sierra@amd.com>
Change-Id: Icdf7656de09aa9988b567ec6c024953398e9bb48


[ROCm/ROCR-Runtime commit: 8a746bdaed]
This commit is contained in:
Alex Sierra
2022-10-31 21:29:39 +00:00
committed by Alejandro Sierra Guiza
parent e1b6def53c
commit 6789a0f3bd
+4 -2
View File
@@ -2263,7 +2263,7 @@ HSAKMT_STATUS fmm_init_process_apertures(unsigned int NumNodes)
uint32_t num_of_sysfs_nodes;
HSAKMT_STATUS ret = HSAKMT_STATUS_SUCCESS;
char *disableCache, *pagedUserptr, *checkUserptr, *guardPagesStr, *reserveSvm;
char *maxVaAlignStr;
char *maxVaAlignStr, *useSvmStr;
unsigned int guardPages = 1;
uint64_t svm_base = 0, svm_limit = 0;
uint32_t svm_alignment = 0;
@@ -2302,6 +2302,9 @@ HSAKMT_STATUS fmm_init_process_apertures(unsigned int NumNodes)
if (!maxVaAlignStr || sscanf(maxVaAlignStr, "%u", &svm.alignment_order) != 1)
svm.alignment_order = 9;
useSvmStr = getenv("HSA_USE_SVM");
svm.is_svm_api_supported = !(useSvmStr && !strcmp(useSvmStr, "0"));
gpu_mem_count = 0;
g_first_gpu_mem = NULL;
@@ -2319,7 +2322,6 @@ HSAKMT_STATUS fmm_init_process_apertures(unsigned int NumNodes)
*/
is_dgpu = false;
svm.is_svm_api_supported = true;
for (i = 0; i < NumNodes; i++) {
HsaNodeProperties props;