-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support for Apple M1 (darwin-aarch64
)
#2666
Comments
The first step for this is to build a JVMCI JDK on darwin-arm64. @dougxc told me the plan is to do this as soon as support is added for the darwin-arm64 platform in the JDK: |
Note that macOS 11 isn't part of the issue any more Graal works fine on that. |
Internal issue: GR-27422 |
FWIW openjdk/jdk#2200 got merged, but that's for JDK 17, planned to be released on 2021/09/14 (https://openjdk.java.net/projects/jdk/17/). |
is it possible to build an image from graalvm arm64 for MacBook m1 in order to build native images. Note that I tried to do this to build a native image for Quarkus framework but it didn't work. I used this graalvm https://github.com/graalvm/container/tree/master/community in order to build my image, but eventually after running sam cli to test the lambda function I got this error msg="Init failed" InvokeID= error="fork/exec /var/task/bootstrap: no such file or directory" |
I don't think that's possible. You can run native images built for macOS/AMD64 on Apple Silicon via Rosetta 2. |
@fniephaus I tried but the build got stuck, and I got a warning that I am using amd64 and not arm64. All the information is here |
Are you sure you used an amd64 GraalVM for macOS to generate the native image? Can you try building it on an Intel-based Mac? Then, copy over the native image and give it a go. If that doesn't work, you may be out of luck as an early adopter of an M1 Mac. I don't think native image support for Apple Silicon has a high priority for the GraalVM team at this point and will probably take weeks if not months to implement. |
@fniephaus I think my case is a little different because eventually, I want to build an image that works on Linux(arm64/aarch64) since I want to deploy it on AWS Lambda. Note that I have docker desktop already downloaded, so I want to use this image to build my quarkus application Lambda function. I hope I expressed myself clearly. |
Ah ok, so essentially, you want to build native image for Linux/aarch64 on your M1-powered Mac. You should just be able to do this with a Linux/aarch64 Docker container on your M1. Then just copy over the native image. |
Is there any concrete plan to support Apple ARM's chip in GraalVM in near future since the support landed in OpenJDK (https://bugs.openjdk.java.net/browse/JDK-8253795)? |
Please see this comment above: #2666 (comment) |
To restate it a bit differently, I think we need to wait the OpenJDK 17 release (2021/09/14, #2666 (comment)) to build a JDK with darwin-aarch64 support. Unless darwin-aarch64 support gets backported earlier than that on JDK 8 or 11 (I have no idea). |
I tried to build GraalVM on M1, after hard-coded some architecture checks in mx, the first main issue is the absence of some dependency libraries on darwin arm64, and this can't be resolved easily by externals. Is there any plan that Graal team will add those dependencies (before the full support)? e.g. the first error:
|
Hi! I noticed that native-image-llvm-backend is not yet available for darwin aarch64. Could you please put a reference to a corresponding issue to follow? |
#5491 /cc @loicottet |
Using
Would this be an expected part of the currently experimental status for M1? Should I open a separate ticket? Am I holding it wrong? :) |
@jackrusher my understanding is that the Foreign Linker API is generally not supported by GraalVM yet. So yes, please open a separate ticket 🙂 |
I see on the docs that WebAssembly support on macOS ARM64 is listed as "Experimental", the same as the native image, JS, etc. But this issue says that it's only "planned", and I don't see anywhere to get it. Are the docs wrong? |
@bakkot yes, it seems the docs are wrong. Thanks for pointing that out! |
Any update on Currently I get this when trying to install
and this when searching in catalog
|
Not sure if this is the right spot to ask, but - is there any reason why the It seems to be there in |
I asked the same question on slack. According to Alina Yurenko on Slack: |
I am testing some performance optimizations in JRuby and found that the latest 23.x development build (on MacOS on M1) is extremely slow to invoke a method from Ruby via Java reflection. It runs 6-7x slower than Hotspot for the following benchmark: Runtime = java.lang.Runtime
loop {
t = Time.new
i = 0
while i < 100_000_000
i += 1
Runtime.runtime
end
puts Time.now - t
} Running as follows, comparing Hotspot and GraalVM CE:
You can see here 6x-7x slower performance on GraalVM CE. Is this expected given the current status of Apple M support? |
@headius thanks for your report, I don't think that's expected. I can repro the slowdown on darwin-aarch64. I tried on linux-aarch64 too, there the slow down is "only" ~2x. On darwin-amd64 (via Rosetta 2) there is no measurable slowdown. No idea why there is a slowdown on AArch64, and even less of an idea why the slowdown is so much more on darwin-aarch64. I've opened another issue to track it: #6600 |
Thank you! |
This is generally "fixed" 🙂 Please open new issues if you encounter any problems on this platform from now on. Thank you! |
Update from 2023/02/01:
Support for Apple Silicon has landed in the 22.1 release of GraalVM. We gradually ship more GraalVM components for
darwin-aarch64
machines in new releases.The latest state can be tested with the latest GraalVM dev build. Please help testing and report bugs!
Update from 2022/03/22:
Apple M1 support for @GraalVM Native Image, libgraal, JavaScript, and Espresso has landed! 🎉🚀
M1 support for Ruby has also landed now.
You can now grab a GraalVM dev build for
darwin-aarch64
at: https://github.com/graalvm/graalvm-ce-dev-builds/releases/latestPlease help testing and report bugs!
Original Issue
Describe the solution you'd like.
Apple is transitioning to their own chips. GraalVM is already available for Linux+aarch64, we'll need macOS+aarch64/arm64 at some point too.
Describe who do you think will benefit the most.
Any future macOS user.
Describe alternatives you've considered.
I can confirm that GraalVM CE 20.1.0 for macOS+amd64 runs with Rosetta 2 on a Developer Transition Kit (DTK).
Additional context.
Apple documentation on Apple Silicon. You can apply for a DTK here.
Express whether you'd like to help contributing this feature
I'm happy to help test GraalVM on a DTK. I've tried (but failed) to compile a LabsJDK for macOS+arm64 as a starting point.
The text was updated successfully, but these errors were encountered: