diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index f213250b84..1913e179e7 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -1177,6 +1177,12 @@ void Runtime::LoadTools() { add = (tool_add_t)os::GetExportAddress(tool, "AddAgent"); if (add) add(this); } +#ifndef NDEBUG + else { + if (flag().report_tool_load_failures()) + fprintf(stderr, "Tool lib \"%s\" failed to load.\n", names[i].c_str()); + } +#endif } } } diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/util/flag.h b/projects/rocr-runtime/runtime/hsa-runtime/core/util/flag.h index ce256e6bdd..49298177dd 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/util/flag.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/util/flag.h @@ -85,6 +85,9 @@ class Flag { scratch_mem_size_ = atoi(var.c_str()); tools_lib_names_ = os::GetEnvVar("HSA_TOOLS_LIB"); + + var = os::GetEnvVar("HSA_TOOLS_REPORT_LOAD_FAILURE"); + report_tool_load_failures_ = (var == "0") ? false : true; } bool check_flat_scratch() const { return check_flat_scratch_; } @@ -107,6 +110,8 @@ class Flag { std::string tools_lib_names() const { return tools_lib_names_; } + bool report_tool_load_failures() const { return report_tool_load_failures_; } + private: bool check_flat_scratch_; bool enable_vm_fault_message_; @@ -115,6 +120,7 @@ class Flag { bool running_valgrind_; bool sdma_wait_idle_; bool enable_queue_fault_message_; + bool report_tool_load_failures_; uint32_t max_queues_;