Fix windows system memory lookup

This refines the gpu package error handling and fixes a bug with the
system memory lookup on windows.
This commit is contained in:
Daniel Hiltgen
2023-12-22 15:43:31 -08:00
parent 5fea4410be
commit a2ad952440
8 changed files with 68 additions and 20 deletions

View File

@@ -40,9 +40,11 @@ void rocm_init(rocm_init_resp_t *resp) {
resp->rh.handle = LOAD_LIBRARY(rocm_lib_paths[i], RTLD_LAZY);
}
if (!resp->rh.handle) {
char *msg = LOAD_ERR();
snprintf(buf, buflen,
"Unable to load %s library to query for Radeon GPUs: %s\n",
rocm_lib_paths[0], LOAD_ERR());
rocm_lib_paths[0], msg);
free(msg);
resp->err = strdup(buf);
return;
}
@@ -51,8 +53,10 @@ void rocm_init(rocm_init_resp_t *resp) {
*l[i].p = LOAD_SYMBOL(resp->rh.handle, l[i].s);
if (!l[i].p) {
UNLOAD_LIBRARY(resp->rh.handle);
char *msg = LOAD_ERR();
snprintf(buf, buflen, "symbol lookup for %s failed: %s", l[i].s,
LOAD_ERR());
msg);
free(msg);
resp->err = strdup(buf);
return;
}