Skip to content

Commit

Permalink
Topology updates and ARM specific fixes
Browse files Browse the repository at this point in the history
- Add some topological info to likwid-perfctr -i
- Add Nvidia Grace to supported chips
- Topology: remove some errors with returns if info is optional
- Fix for SVE CPU feature detection
  • Loading branch information
TomTheBear committed Sep 17, 2024
1 parent 2811905 commit c1cb331
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/applications/likwid-perfctr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,8 @@ end
if print_info or verbose > 0 then
print_stdout(string.format("CPU family:\t%u", cpuinfo["family"]))
print_stdout(string.format("CPU model:\t%u", cpuinfo["model"]))
print_stdout(string.format("CPU vendor:\t%u", cpuinfo["vendor"]))
print_stdout(string.format("CPU part:\t%u", cpuinfo["part"]))
print_stdout(string.format("CPU short:\t%s", cpuinfo["short_name"]))
print_stdout(string.format("CPU stepping:\t%u", cpuinfo["stepping"]))
print_stdout(string.format("CPU features:\t%s", cpuinfo["features"]))
Expand All @@ -936,7 +938,9 @@ if print_info or verbose > 0 then
print_stdout(string.format("PERFMON number of counters:\t\t%u", cpuinfo["perf_num_ctr"]))
print_stdout(string.format("PERFMON width of counters:\t\t%u", cpuinfo["perf_width_ctr"]))
print_stdout(string.format("PERFMON number of fixed counters:\t%u", cpuinfo["perf_num_fixed_ctr"]))
print_stdout(string.format("PERFMON supports desktop memory controllers:\t%u", cpuinfo["supportClientmem"]))
end
print_stdout(string.format("PERFMON supports Uncore:\t%u", cpuinfo["supportUncore"]))
---------------------------
if nvSupported and cudatopo then
print_stdout(likwid.hline)
Expand Down
16 changes: 9 additions & 7 deletions src/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,17 +1219,20 @@ topology_setName(void)
case ZEN_RYZEN:
cpuid_info.name = amd_zen_str;
cpuid_info.short_name = short_zen;
cpuid_info.supportUncore = 1;
break;
case ZENPLUS_RYZEN:
case ZENPLUS_RYZEN2:
cpuid_info.name = amd_zenplus_str;
cpuid_info.short_name = short_zen;
cpuid_info.supportUncore = 1;
break;
case ZEN2_RYZEN:
case ZEN2_RYZEN2:
case ZEN2_RYZEN3:
cpuid_info.name = amd_zen2_str;
cpuid_info.short_name = short_zen2;
cpuid_info.supportUncore = 1;
break;
default:
err = -EFAULT;
Expand All @@ -1245,13 +1248,15 @@ topology_setName(void)
case ZEN3_EPYC_TRENTO:
cpuid_info.name = amd_zen3_str;
cpuid_info.short_name = short_zen3;
cpuid_info.supportUncore = 1;
break;
case ZEN4_RYZEN:
case ZEN4_RYZEN2:
case ZEN4_EPYC:
case ZEN4_RYZEN_PRO:
cpuid_info.name = amd_zen4_str;
cpuid_info.short_name = short_zen4;
cpuid_info.supportUncore = 1;
break;
default:
err = -EFAULT;
Expand Down Expand Up @@ -1325,6 +1330,7 @@ topology_setName(void)
case NVIDIA_GRACE:
cpuid_info.name = arm_nvidia_grace;
cpuid_info.short_name = short_nvidia_grace;
cpuid_info.supportUncore = 1;
break;
default:
err = -EFAULT;
Expand Down Expand Up @@ -1544,14 +1550,9 @@ topology_init(void)
ret = topology_setName();
if (ret < 0)
{
errno = ret;
ERROR_PRINT(Failed to set CPU name);
free(cpuid_info.osname);
memset(&cpuid_info, 0, sizeof(CpuInfo));
memset(&cpuid_topology, 0, sizeof(CpuTopology));
return ret;
DEBUG_PRINT(DEBUGLEV_INFO, Cannot use machine-given CPU name);
}
funcs.init_cpuFeatures();
ret = funcs.init_cpuFeatures();
if (ret < 0)
{
errno = ret;
Expand Down Expand Up @@ -1863,6 +1864,7 @@ print_supportedCPUs (void)
printf("\t%s\n",arm_neoverse_v1);
printf("\t%s\n",arm_huawei_tsv110);
printf("\t%s\n",apple_m1_studio);
printf("\t%s\n",arm_nvidia_grace);
printf("\n");
printf("Supported ARMv7 processors:\n");
printf("\t%s\n",armv7l_str);
Expand Down
2 changes: 1 addition & 1 deletion src/topology_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ proc_init_cpuFeatures(void)
setBit(cpuid_info.featureFlags, PMULL);
bcatcstr(bfeatures, "PMULL ");
}
else if (bisstemeqblk(flaglist->entry[i], "sve", 3) == 1)
else if (bisstemeqblk(flaglist->entry[i], "sve", 3) == 1 && (!testBit(cpuid_info.featureFlags, SVE)))
{
setBit(cpuid_info.featureFlags, SVE);
bcatcstr(bfeatures, "SVE ");
Expand Down

0 comments on commit c1cb331

Please sign in to comment.