wsl/hsakmt: Introduce WSL_CHECK_AVAIL_SYSRAM environment variable
By default, this variable is 0. Set it to 1 to compare available system memory with the requested amount before allocation. It helps identify system hangs caused by excessive memory allocation. Signed-off-by: lyndonli <Lyndon.Li@amd.com> Reviewed-by: Flora Cui <flora.cui@amd.com> Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/32>
This commit is contained in:
@@ -129,6 +129,11 @@ static HSAKMT_STATUS init_vars_from_env(void) {
|
||||
if (envvar)
|
||||
enable_vendor_packet = atoi(envvar);
|
||||
|
||||
/* Decide whether to check available system memory before allocation */
|
||||
envvar = getenv("WSL_CHECK_AVAIL_SYSRAM");
|
||||
if (envvar)
|
||||
check_avail_sysram = !strcmp(envvar, "1");
|
||||
|
||||
return HSAKMT_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user