MongoDB 5.0 CPU Intel G4650 compatibility

According to the Production notes, mongod and the legacy mongo shell require Sandy Bridge or later microarchitectures.
I tried to execute mongo and mongod with an Intel G4560. This processor belongs to the Kaby Lake Intel CPU generation, that is later than Sandy Bridge, so it should work.
However mongo and mongod fail with an Illegal Instruction message (while mongosh works).
I got exactly the same result with Ubuntu 18.04 and Ubuntu 20.04.

The syslog line corresponding to the event is the following:
Jul 25 14:56:18 ubuntu kernel: [ 2725.110420] traps: mongo[24364] trap invalid opcode ip:563cbf6db39a sp:7ffde34aa360 error:0 in mongo[563cbd6f0000+2c4d000]

MongoDB worked without problem for years on this hardware up to and including 4.4.
May I have some advice about the support of this chip by M 5.0 ?

The CPU model name is Intel(R) Pentium(R) CPU G4560 @ 3.50GHz
The flags (from cpuinfo) are:
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 pni pclmulqdq dtes64 monitor ds_cpl est tm2 ssse3 sdbg cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust smep erms invpcid mpx rdseed smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d

Hi @Jean-Marie_Gouarne,

I looked into this a bit further and the underling requirement for the MongoDB 5.0 binary server packages is CPUs with AVX instructions. These are broadly Sandy Bridge or newer Intel CPUs, but there is a caveat:

Not all CPUs from the listed families support AVX. Generally, CPUs with the commercial denomination Core i3/i5/i7/i9 support them, whereas Pentium and Celeron CPUs do not.

The Intel G4560 appears to be branded as a Pentium processor and is likely missing the required AVX support.

One option would be to Build MongoDB from Source with an older gcc microarchitecture target, eg:

CCFLAGS=-march=nehalem

or

CCFLAGS=-march=i686

NOTE: This CPU microarchitecture is not tested or supported for MongoDB 5.0+ if you run into unexpected behaviour or issues.

I created DOCS-14684: Clarify requirement for “Sandy Bridge or newer” in MongoDB 5.0 production notes to add clearer guidance to the production notes.

Regards,
Stennie

1 Like