Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Native Image] Native image compiled with -march=native fails to execute on the same machine (Linux Arch) #10037

Closed
1 task done
gavr123456789 opened this issue Nov 5, 2024 · 4 comments
Assignees

Comments

@gavr123456789
Copy link

Describe the Issue

Can't run the binary which was compiled with -march=native, if this flags removed, it runs.

CPU: 12th Gen Intel® Core™ i9-12900H × 20

This was not the case with GraalVM 21.

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

java --version
java 23.0.1 2024-10-15
Java(TM) SE Runtime Environment Oracle GraalVM 23.0.1+11.1 (build 23.0.1+11-jvmci-b01)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 23.0.1+11.1 (build 23.0.1+11-jvmci-b01, mixed mode, sharing)

Operating System and Version

Linux precision5570 6.11.6-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Fri, 01 Nov 2024 03:30:35 +0000 x86_64 GNU/Linux

Build Command

Using id("org.graalvm.buildtools.native") version "0.10.3"

graalvmNative {
    binaries {
        named("main") {
            mainClass.set("main.MainKt")
        }
    }
    binaries.all {

        imageName.set("niva")
        buildArgs.add("-O3")
        this.runtimeArgs()
        buildArgs.add("--no-fallback")
        buildArgs.add("-march=native")
        buildArgs.add("--initialize-at-build-time")
    }
}

Expected Behavior

The resulting binary runs on the same machine on which it was compiled.

Actual Behavior

Getting

The current machine does not support all of the following CPU features that are required by the image: [CX8, CMOV, FXSR, MMX, AMD_3DNOW_PREFETCH, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, POPCNT, LZCNT, TSC, TSCINV_BIT, AVX, AVX2, AES, ERMS, CLMUL, BMI1, BMI2, ADX, SHA, FMA, VZEROUPPER, FLUSH, FLUSHOPT, CLWB, SERIALIZE, RDTSCP, RDPID, FSRM, GFNI, F16C, PKU, OSPKE, CET_IBT, CET_SS].
Please rebuild the executable with an appropriate setting of the -march option.⏎

Steps to Reproduce

Build any binary with -march=native flag, try to run it.

Additional Context

If I remove -march=native I can run the binary.

Build Log Output and Error Messages

No response

@gavr123456789
Copy link
Author

I assume this is very similar to #6234

@oubidar-Abderrahim oubidar-Abderrahim self-assigned this Nov 8, 2024
@oubidar-Abderrahim
Copy link
Member

Could you please share a reproducer? Thank you

@mukel
Copy link
Member

mukel commented Nov 14, 2024

Fixed in #10050.
This only happens on Intel CPUs with performance and economy cores; should be backported.

@mukel mukel closed this as completed Nov 14, 2024
@gavr123456789
Copy link
Author

Thanks! Then I completely forgot what to add to the reproducer, but in fact this is any hello world project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants