From 766ea9842577cbe5aa8c0c0c4aa1f08bea304c52 Mon Sep 17 00:00:00 2001 From: Graham Sider Date: Tue, 20 Sep 2022 11:32:37 -0400 Subject: [PATCH] libhsakmt: Skip hsa_gfxip_table search for GFX11+ Prior to launch some ASICs may re-use PCI DIDs from older generations. This can cause issues during topology initialization as hsa_gfxip_table lookups will override sysfs-provided gfx versions, causing incorrect gfxip selection. Since no new entries will be added to hsa_gfxip_table, limit its search only to pre-GFX11 ASICs. Signed-off-by: Graham Sider Change-Id: I53eaefac5db2650a36a6ce9f21daf750f50cfd26 [ROCm/ROCR-Runtime commit: 79279e860f042938e2c3c4525a328e56809559f0] --- projects/rocr-runtime/src/topology.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/rocr-runtime/src/topology.c b/projects/rocr-runtime/src/topology.c index 4aea77e276..2887c661bc 100644 --- a/projects/rocr-runtime/src/topology.c +++ b/projects/rocr-runtime/src/topology.c @@ -800,8 +800,11 @@ err1: return ret; } -static const struct hsa_gfxip_table *find_hsa_gfxip_device(uint16_t device_id) +static const struct hsa_gfxip_table *find_hsa_gfxip_device(uint16_t device_id, uint8_t gfxv_major) { + if (gfxv_major > 10) + return NULL; + uint32_t i, table_size; table_size = sizeof(gfxip_lookup_table)/sizeof(struct hsa_gfxip_table); @@ -1192,7 +1195,7 @@ static HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id, gfxv_minor = HSA_GET_GFX_VERSION_MINOR(gfxv); gfxv_stepping = HSA_GET_GFX_VERSION_STEP(gfxv); - hsa_gfxip = find_hsa_gfxip_device(props->DeviceId); + hsa_gfxip = find_hsa_gfxip_device(props->DeviceId, gfxv_major); if (hsa_gfxip || gfxv) { envvar = getenv("HSA_OVERRIDE_GFX_VERSION"); if (envvar) {