Skip to content

Commit

Permalink
Fix reporting of ARM Neoverse V2 (eg. Nvidia Grace)
Browse files Browse the repository at this point in the history
  • Loading branch information
njansson committed May 30, 2024
1 parent f9c1d0b commit a60891b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/common/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void system_cpuid(char *name, int len) {
/* Generic ARM unless we found something known */
strncpy(name, "ARM", len);
int cpufj = 0;
int cpuarm = 0;
#endif
while (fgets (buf, MAXLEN, fp)) {
#if defined(_ARCH_PPC64)
Expand All @@ -52,6 +53,10 @@ void system_cpuid(char *name, int len) {
cpufj = 1;
continue;
}
else if(strstr(token, "0x41")) {
cpuarm = 1;
continue;
}
}

if (strstr(buf, "CPU part") && cpufj) {
Expand All @@ -60,7 +65,16 @@ void system_cpuid(char *name, int len) {
if (strstr(token, "0x001")) {
strncpy(name, "A64FX", len);
break;
}
}
}

if (strstr(buf, "CPU part") && cpuarm) {
char *token = strtok (buf, delim);
token = strtok (NULL, delim);
if (strstr(token, "0xd4f")) {
strncpy(name, "ARM Neoverse V2", len);
break;
}
}
#endif
}
Expand Down

0 comments on commit a60891b

Please sign in to comment.