Docker and cpuinfo
Written by Dominik Pantůček on 2025-11-06
dockerlinuxBenchmarking different implementations of the same algorithm against each other can be done only if comparable systems are used. Our vlibench package ensures that CPU model information is present in benchmarking models. However if the package is run on Linux under x86_64 emulation on ARM, strange things happen.
Getting CPU model information on Linux systems can be as easy as reading the
/proc/cpuinfo file. A typical example on a Intel-based laptop might look
as follows:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 140
model name : 11th Gen Intel(R) Core(TM) i7-1160G7 @ 1.20GHz
stepping : 1
microcode : 0xbc
cpu MHz : 1200.036
cache size : 12288 KB
physical id : 0
siblings : 8
core id : 3
cpu cores : 4
apicid : 7
initial apicid : 7
fpu : yes
fpu_exception : yes
cpuid level : 27
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities
vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple pml ept_mode_based_exec tsc_scaling
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb gds bhi
bogomips : 4224.00
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
Extracting the model name is trivial - just find the line starting with model
name and look for the contents after the colon. And this is exactly what the
vlibench package does. Looking at an example from Qi build at
https://drym-org.github.io/qi/competitive-benchmarks/ shows (at the time of this
writing): AMD EPYC 7763 64-Core Processor.
However when running under x86_64 emulation on ARM CPU the contents of the
/proc/cpuinfo file are taken from the original host. And on ARM there is
usually no model name key present. Typical contents can be seen below:
processor : 0
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp flagm2 frint bf16 afp
CPU implementer : 0x61
CPU architecture: 8
CPU variant : 0x0
CPU part : 0x000
CPU revision : 0
The same happens when running under Docker which made this into an almost blocker issue for the upcoming Racket 9.0 release.
A short-term fix is to default back to "unknown" CPU model if the key is not
present. Yet in the future, a proper handling of numeric CPU identification as provided
for example by lscpu command from the util-linux package is probably a good
idea.
Hope you liked this little venture into cross-platform problems - although this was a short one. See ya next time!