my project config:

springboot 3.1.1 jdk17

I made the image mvn spring-boot:build-image -pnative with the following command, and then it ran fine locally and failed to boot on a machine in a corporate environment and threw the following exception:

The current machine does not support all of the following CPU features that are required by the image: [CX8, CMOV, FXSR, MMX, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, POPCNT, LZCNT, AVX, AVX2, BMI1, BMI2, FMA]. Please rebuild the executable with an appropriate setting of the -march option.

Comment From: wang-xiaowu

same question here the source addr:https://github.com/behappy-java-study/customerservice-spring-boot-3 follow the docker image i pushed

docker run --name spring-boot-3-native -d -p 8501:8500 wangxiaowu950330/customerservice-spring-boot-3:0.0.1-SNAPSHOT-native
docker run --name spring-boot-3-original -d -p 8502:8500 wangxiaowu950330/customerservice-spring-boot-3:0.0.1-SNAPSHOT-original

spring-boot-3-original is ok,and when i execute spring-boot-3-native container,it shows error:The current machine does not support all of the following CPU features that are required by the image: [CX8, CMOV, FXSR, MMX, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, POPCNT, LZCNT, AVX, AVX2, BMI1, BMI2, FMA]. Please rebuild the executable with an appropriate setting of the -march option. and this is my machine's infomation:

[root@development1 ~]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    1
Core(s) per socket:    8
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 165
Model name:            Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
Stepping:              3
CPU MHz:               2903.998
BogoMIPS:              5807.99
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              12288K
NUMA node0 CPU(s):     0-7
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 movbe popcnt aes rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single rsb_ctxsw ibrs_enhanced fsgsbase bmi1 bmi2 invpcid rdseed clflushopt md_clear flush_l1d arch_capabilities

Comment From: mhalbritter

Can you try to pass in -march=compatibility in the BP_NATIVE_IMAGE_BUILD_ARGUMENTS buildpack configuration? This disables the CPU optimizations.

Comment From: GeTOUO

thanks! -march=compatibility in the BP_NATIVE_IMAGE_BUILD_ARGUMENTS is ok!

Comment From: scottfrederick

@GeTOUO I'm glad the suggestion worked for you, thanks for letting us know.

As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. If you have any follow-up questions, please post them on Stack Overflow.

Comment From: DaspawnW

Hi @scottfrederick ,

sorry to say but this is a bug rather then a question. I have a project where exactly this issue occurs, the image is build on a github runner (infrastructure unknown) and running on a machine with an Intel x86-64 which should be possible without any issues.

Now out of the sudden it doesn't work anymore with this issue. Probably Github has at this point in time another runner in place which has other CPU features and this lead to issues while starting new applications. I would question if a compatibility shouldn't be the default as I guess a lot of people could run into exactly the same issue.

Comment From: wilkinsona

@DaspawnW please make that suggestion to the maintainers of the native image buildpack. I'm not sure that they'll accept it but that's where the change belongs if it's to be made anywhere.