BR: Incorrect SystemStats info on Apple Silicon

CPU Vendor is empty
Megahertz is 0
Neon is no

1 Like

doCPUID is probably dead in the water seeing that Apple Silicon is ARM64 and this system stats func is for Intel only…

We can use sysctl with hw.optional.neon to check for Neon support, but I’m not sure about the others: hw.cpufrequency is missing on Apple silicon, as is machdep.cpu.vendor and we also can’t use cpuid here like we do for Intel as it uses Intel-specific inline ASM.

Wouldn’t this simply be “Apple”?

I wouldn’t worry about the other extensions since ARM just doesn’t support them (eg: MMX, FMA, SSE, AVX).

It is definitely strange to hear that hw.tbfrequency is missing though… Have you given this a shot: sysctlbyname.c ?

I think it should be the processor ID which is a specific 12 character string like “GenuineIntel” or “AuthenticAMD” but I don’t know whether this is supported on ARM.

My mistake, I meant hw.cpufrequency not tbfrequency - I’ve edited my post.

Not sure what happened to this in the meantime and in later JUCE versions, but I just wanted to mention this:
In older plugins (using JUCE 5.4.1 in my case) the CPUVendor shows up as “GenuineIntel” when a plugin built for Intel only (not a universal binary yet) is ran on an M1-based Mac. Of course, that may be because it is then running in Rosetta 2.

Just noting that this is still an issue with JUCE 6.1.6.

Same app built for intel and Apple Silicon (each on a native machine) reports different systemStats when running on the M1 machine with Monterey 12.2

Built on/for x86_64 running under Rosetta:
System OS: Mac OSX 10.16
System Device: MacBookPro18,2
System CPU Model: Apple M1 Max
System CPU Count: 10 Physical
System CPU Vendor: GenuineIntel

Built on/for arm64 running natively on M1Max:
System OS: Mac OSX 12.2
System Device: MacBookPro18,2
System CPU Model: Apple M1 Max
System CPU Count: 10 Physical
System CPU Vendor: [EMPTY STRING]

I should add that the System OS is being pulled from getOperatingSystemName()

1 Like