Open steverweber opened 4 years ago
@steverweber I'm confused - are you talking about x86_64 vs arm64? Or something else? 🤔
Something else
CPUs often have 'family' or microarchitecture names. After some testing it seems that the file is not always reliable.
root@jupyter-p03:~# salt-call grains.get cpu_model
local:
AMD EPYC 7702P 64-Core Processor
root@jupyter-p03:~# cat /sys/devices/cpu/caps/pmu_name
cat: /sys/devices/cpu/caps/pmu_name: No such file or directory
** I assume newer kernels will have this output `zen2`
root@jupyter-p03:~# gcc -march=native -Q --help=target|grep march
-march= znver2
Some Intel CPUs
salt cpu\* cmd.run 'cat /sys/devices/cpu/caps/pmu_name'
cpu145:
broadwell
cpu150:
skylake
cpu21:
sandybridge
The architecture family of a cpu would be helpful to have in grains. This would make it more simple when installing packages that are architecture family related.
My previous workaround was looking at the cpu_flags.
On many Linux systems you can
cat /sys/devices/cpu/caps/pmu_name
I'm not sure about other kernels