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

Do Precompiled M1 binaries work on Apple M2 Pro machines? #3

Closed
chmanoj opened this issue Aug 22, 2023 · 1 comment
Closed

Do Precompiled M1 binaries work on Apple M2 Pro machines? #3

chmanoj opened this issue Aug 22, 2023 · 1 comment

Comments

@chmanoj
Copy link

chmanoj commented Aug 22, 2023

Hi @DevinTDHa

I'm trying to run the introductory Tensorflow example from https://www.tensorflow.org/jvm/install#example_program and use the precompiled binaries from the release 0.4.0-SNAPSHOT. When I run the command mvn compile exec:java, the JRE crashes with SIGILL error (Full log below). I'm running this example on a 2023 Apple M2 Pro with macOS Ventura 13.5.

I wanted to find out if these precompiled M1 binaries work for M2 processors? Or do we need to recompile them on M2 hardware separately?

Thanks!

---- Detailed log ----

[INFO] Compiling 1 source file to tensorflow-test/target/classes
[INFO] 
[INFO] --- exec:3.1.0:java (default-cli) @ hellotensorflow ---
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x000000012bc419f5, pid=14525, tid=0x000000000000a11b
#
# JRE version: Java(TM) SE Runtime Environment (8.0_311-b11) (build 1.8.0_311-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.311-b11 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libtensorflow_framework.2.dylib+0x1f9f5]  tensorflow::monitoring::MetricDef<(tensorflow::monitoring::MetricKind)1, long long, 2>::MetricDef<char [11], char [7]>(absl::lts_20210324::string_view, absl::lts_20210324::string_view, char const (&) [11], char const (&) [7])+0x125
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# tensorflow-test/hs_err_pid14525.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
[1]    14525 abort      mvn compile exec:java
@DevinTDHa
Copy link
Owner

Hi @chmanoj,

I have seen this error before, usually it has something to do with the other apple silicon derivatives (in your case M2 Pro). I'm afraid it's not compatible with this binary.

I don't have a machine to test it, you might be able to compile your own binaries.

You can try this branch but I can't guarantee that it works:

https://github.com/DevinTDHa/tensorflow-java/tree/apple-silicon-0.4.2-shaded

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

No branches or pull requests

2 participants