Fix rocprofv3 pmc crash on gfx1151 (#2169) (#2171)

* Fix #2169: rocprofv3 pmc crash on gfx1151

This PR addresses two issues for gfx1151:
- In Pm4Factory::GetGpuId, the first matching entry from the gfxip_map
  vector was taken, but "gfx115" came after "gfx11".
- HsaRsrcFactory::GetHsaAgentsCallback would fail when it saw an NPU
  agent. Now it ignores it and continues.
This commit is contained in:
Matthias Gehre
2025-12-05 16:58:48 +01:00
committed by GitHub
parent 06a3a5ca10
commit e9e972144d
4 changed files with 16 additions and 14 deletions
@@ -56,11 +56,11 @@ static const char* cpp_demangle(const char* symname) {
// Callback function to get available in the system agents
hsa_status_t HsaRsrcFactory::GetHsaAgentsCallback(hsa_agent_t agent, void* data) {
hsa_status_t status = HSA_STATUS_ERROR;
HsaRsrcFactory* hsa_rsrc = reinterpret_cast<HsaRsrcFactory*>(data);
const AgentInfo* agent_info = hsa_rsrc->AddAgentInfo(agent);
if (agent_info != NULL) status = HSA_STATUS_SUCCESS;
return status;
// AddAgentInfo may return NULL for unsupported agent types (e.g., NPU).
// We should continue iterating regardless.
hsa_rsrc->AddAgentInfo(agent);
return HSA_STATUS_SUCCESS;
}
// This function checks to see if the provided