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

[Bug] (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')) #17303

Open
irischang710 opened this issue Aug 24, 2024 · 0 comments
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug

Comments

@irischang710
Copy link

Thanks for participating in the TVM community! We use https://discuss.tvm.ai for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first 😸

Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.

Expected behavior

I followed the User Tutorial Compiling and Optimizing a Model with TVMC https://tvm.apache.org/docs/tutorial/tvmc_command_line_driver.html
and was able to get to Compiling an ONNX Model to the TVM Runtime (though the result didn't look right), but failed at Running the Model from The Compiled Module with TVMC with the following error:
File "/Users/iris/projects/mlc_workspace/tvm/src/runtime/dso_library.cc", line 125
InternalError: Check failed: (lib_handle_ != nullptr) is false: Failed to load dynamic shared library /private/var/folders/y6/fc5zw1js53q0pmq6th2wxt0xrsshqz/T/tmpmy99t2ig/mod.so dlopen(/private/var/folders/y6/fc5zw1js53q0pmq6th2wxt0xrsshqz/T/tmpmy99t2ig/mod.so, 0x0005): tried: '/private/var/folders/y6/fc5zw1js53q0pmq6th2wxt0xrsshqz/T/tmpmy99t2ig/mod.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/y6/fc5zw1js53q0pmq6th2wxt0xrsshqz/T/tmpmy99t2ig/mod.so' (no such file), '/private/var/folders/y6/fc5zw1js53q0pmq6th2wxt0xrsshqz/T/tmpmy99t2ig/mod.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

Actual behavior

It seems that the architecture is incompatible?
(mlc-env) iris@MacBook-Air-3 mlc_workspace % lipo model/mod.so -archs
x86_64

I have libtvm and libtvm_runtime under build/ directory and so my TVM build should be successful? and the architecture looks right:
(mlc-env) iris@MacBook-Air-3 build % lipo libtvm.dylib -archs
arm64
(mlc-env) iris@MacBook-Air-3 build % lipo libtvm_runtime.dylib -archs
arm64

Environment

I built TVM on M2 Mac

Steps to reproduce

python -m tvm.driver.tvmc compile --target "llvm" --target-llvm-mtriple=aarch64-linux-gnu --input-shapes "data:[1,3,224,224]" --output resnet50-v2-7-tvm.tar resnet50-v2-7.onnx
python -m tvm.driver.tvmc run --inputs imagenet_cat.npz --output predictions.npz resnet50-v2-7-tvm.tar

Triage

Please refer to the list of label tags here to find the relevant tags and add them below in a bullet format (example below).

  • needs-triage
@irischang710 irischang710 added needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug labels Aug 24, 2024
@irischang710 irischang710 changed the title [Bug] [Bug] (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')) Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug
Projects
None yet
Development

No branches or pull requests

1 participant