wsl/libhsakmt: set default node

Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Tianci Yin <tianci.yin@amd.com>
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/82>
This commit is contained in:
Flora Cui
2025-06-30 13:50:50 +08:00
committed by Frank Min
parent b3c685585e
commit 67332944d2
3 changed files with 13 additions and 1 deletions
+8
View File
@@ -116,6 +116,14 @@ static HSAKMT_STATUS init_vars_from_env(void) {
if (envvar)
dxg_runtime->enable_thunk_sub_allocator = atoi(envvar);
envvar = getenv("ROCR_VISIBLE_DEVICES");
if (envvar) {
std::string devices(envvar);
size_t first_num_pos = devices.find_first_of("0123456789");
if (first_num_pos != std::string::npos)
dxg_runtime->default_node = std::stoi(devices.substr(first_num_pos)) + 1;
}
return HSAKMT_STATUS_SUCCESS;
}