Fix a hang in './test/hsa/ctrl ctrl_hsa_input_trace'
At the end of the test, the tracer tool is unloaded and the active memory pools are flushed. In the flush callback, to get the activity operation string, the RocpLoader instance is neeeded, and if the RocpLoader is not already loaded, it attempts to dlopen the rocprofiler library. Calling dlopen from a global destructor hangs because the dynamic loader lock is already owned (e.g. by dlclose). To temporarily work around the issue, instanciate the RocpLoader when the activities needing it are enabled. Change-Id: I712c66d88c43694fe53a95d6a61d7b22abb75262
This commit is contained in:
@@ -939,6 +939,7 @@ static roctracer_status_t roctracer_enable_activity_fun(roctracer_domain_t domai
|
||||
switch (domain) {
|
||||
case ACTIVITY_DOMAIN_HSA_OPS: {
|
||||
if (op == HSA_OP_ID_COPY) {
|
||||
roctracer::RocpLoader::Instance();
|
||||
roctracer::hsa_support::async_copy_callback_enabled = true;
|
||||
roctracer::hsa_support::async_copy_callback_memory_pool =
|
||||
reinterpret_cast<roctracer::MemoryPool*>(pool);
|
||||
@@ -958,6 +959,7 @@ static roctracer_status_t roctracer_enable_activity_fun(roctracer_domain_t domai
|
||||
case ACTIVITY_DOMAIN_HSA_API:
|
||||
break;
|
||||
case ACTIVITY_DOMAIN_HSA_EVT:
|
||||
roctracer::RocpLoader::Instance();
|
||||
break;
|
||||
case ACTIVITY_DOMAIN_HIP_OPS: {
|
||||
if (roctracer::HipLoader::Instance().Enabled() == false) break;
|
||||
|
||||
Reference in New Issue
Block a user