Skip to content

Commit

Permalink
Merge pull request #1987 from npmiller/load-log
Browse files Browse the repository at this point in the history
Add dlerror output to loader logs
  • Loading branch information
omarahmed1111 authored Aug 19, 2024
2 parents bd3094c + 4e825ba commit d88215c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/common/linux/ur_lib_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ LibLoader::loadAdapterLibrary(const char *name) {
}
#endif
HMODULE handle = dlopen(name, mode);
logger::info("loaded adapter 0x{} ({})", handle, name);
if (!handle) {
char *err = dlerror();
logger::info("failed to load adapter '{}' with error: {}", name,
err ? err : "unknown error");
} else {
logger::info("loaded adapter 0x{} ({})", handle, name);
}
return std::unique_ptr<HMODULE, LibLoader::lib_dtor>(handle);
}

Expand Down

0 comments on commit d88215c

Please sign in to comment.