Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/topology.c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cleaner than the strcat, I think:
snprintf(per_device_override_name, sizeof(per_device_override_name), "HSA_OVERRIDE_GFX_VERSION_%d", node_id);

I'll test this out internally and if it works (and doesn't break any other flows), I'll get it pushed out. Hopefully for 6.2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's much better, thank you! Changed in da8055d. And thanks for giving it a spin internally!

Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,7 @@ static HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id,
char *read_buf, *p, *envvar, dummy = '\0';
char prop_name[256];
char path[256];
char per_node_override[32];
unsigned long long prop_val = 0;
uint32_t prog, major = 0, minor = 0, step = 0;
int read_size;
Expand Down Expand Up @@ -1209,8 +1210,8 @@ static HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id,

hsa_gfxip = find_hsa_gfxip_device(props->DeviceId, gfxv_major);
if (hsa_gfxip || gfxv) {
envvar = getenv("HSA_OVERRIDE_GFX_VERSION");
if (envvar) {
snprintf(per_node_override, sizeof(per_node_override), "HSA_OVERRIDE_GFX_VERSION_%d", node_id);
if ((envvar = getenv(per_node_override)) || (envvar = getenv("HSA_OVERRIDE_GFX_VERSION"))) {
/* HSA_OVERRIDE_GFX_VERSION=major.minor.stepping */
if ((sscanf(envvar, "%u.%u.%u%c",
&major, &minor, &step, &dummy) != 3) ||
Expand Down