From bac3d632d0af62e7fd3eff49d5d69a22ef7fd9bb Mon Sep 17 00:00:00 2001 From: "Jonathan R. Madsen" Date: Thu, 30 Mar 2023 11:15:19 -0500 Subject: [PATCH] rocprofler_iterate_info workaround v2 (#271) Revert agent_info->dev_index in hsa_rsrc_factory.cpp - disable using the driver_node_id and, instead, start at zero because it breaks the lookup for rocprofiler_pool_fetch lookup in rocprofiler.cpp. On my system (one AMD GPU and one NVIDIA GPU), it has a value of 1, not 0 and the pool size is 1 -- resulting in segfault [ROCm/rocprofiler-systems commit: ab8894082b107ff68147eafce70109411bcd0016] --- .../lib/omnitrace/library/rocm/hsa_rsrc_factory.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/projects/rocprofiler-systems/source/lib/omnitrace/library/rocm/hsa_rsrc_factory.cpp b/projects/rocprofiler-systems/source/lib/omnitrace/library/rocm/hsa_rsrc_factory.cpp index 705a508d5f..e4f8578fc8 100644 --- a/projects/rocprofiler-systems/source/lib/omnitrace/library/rocm/hsa_rsrc_factory.cpp +++ b/projects/rocprofiler-systems/source/lib/omnitrace/library/rocm/hsa_rsrc_factory.cpp @@ -467,12 +467,17 @@ HsaRsrcFactory::AddAgentInfo(const hsa_agent_t agent) agent_info->vgpr_block_size = 4; // Set GPU index - uint32_t driver_node_id; + /*uint32_t driver_node_id; status = hsa_api_.hsa_agent_get_info( agent, static_cast(HSA_AMD_AGENT_INFO_DRIVER_NODE_ID), &driver_node_id); CHECK_STATUS("hsa_agent_get_info(gpu hsa_driver_node_id)", status); - agent_info->dev_index = driver_node_id; + agent_info->dev_index = driver_node_id;*/ + // disable this change above (found in the rocprofiler library) + // because it breaks the lookup for rocprofiler_pool_fetch + // lookup in rocprofiler.cpp. On my system (one AMD GPU and one NVIDIA GPU), + // it has a value of 1, not 0 and the pool size is 1 + agent_info->dev_index = gpu_list_.size(); gpu_list_.push_back(agent_info); gpu_agents_.push_back(agent); }