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 <Graham.Sider@amd.com>
Change-Id: I53eaefac5db2650a36a6ce9f21daf750f50cfd26


[ROCm/ROCR-Runtime commit: 79279e860f]
此提交包含在:
Graham Sider
2022-09-20 11:32:37 -04:00
父節點 54539f06c7
當前提交 766ea98425
+5 -2
查看文件
@@ -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) {