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

onnxruntime examples crash on macOS #917

Closed
sbrunk opened this issue Jul 25, 2020 · 4 comments
Closed

onnxruntime examples crash on macOS #917

sbrunk opened this issue Jul 25, 2020 · 4 comments
Labels

Comments

@sbrunk
Copy link
Contributor

sbrunk commented Jul 25, 2020

I'm trying to run the onnxruntime examples on macOS (catalina) but both CXXApiSample and CApiSample are crashing with the same error.

How to reproduce:

  1. Remove cuda dependencies in pom.xml
cd onnxruntime/samples
mvn compile exec:java -Dexec.mainClass="CXXApiSample"
WARNING: Since openmp is enabled in this build, this API cannot be used to configure intra op num threads. Please use the openmp environment variables to control the number of threads.
2020-07-25 20:58:54.202334 [E:onnxruntime:test, provider_bridge_ort.cc:564 CreateExecutionProviderFactory_Dnnl] Failed to load provider shared library
Using Onnxruntime C++ API
Number of inputs = 1
Input 0 : name=data_0
Input 0 : type=1
Input 0 : num_dims=4
Input 0 : dim 0=1
Input 0 : dim 1=3
Input 0 : dim 2=224
Input 0 : dim 3=224
[thread 41219 also had an error][thread 40707 also had an error]
...
# JRE version: Java(TM) SE Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.202-b08 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# [thread 41475 also had an error]
[thread 23299 also had an error]
[thread 22275 also had an error]
C  [libonnxruntime.1.4.0.dylib+0x5cabc1]  .LComputeBlockBy4Loop830+0x168
#
...

Any idea what might be causing this?

/cc @EmergentOrder

@saudet
Copy link
Member

saudet commented Jul 26, 2020

Indeed, it looks like support for OpenMP is broken on Mac: microsoft/onnxruntime#3657.
I've disabled OpenMP for Mac in the latest commit, and it seems to be working fine for me.
Thanks for reporting!

@sbrunk
Copy link
Contributor Author

sbrunk commented Jul 26, 2020

Thanks a lot @saudet! I can confirm that it works fine now with OpenMP disabled.

@saudet
Copy link
Member

saudet commented Jan 3, 2021

I've reenabled OpenMP on Mac since it seems to work well now. Please give it a try with 1.6.0-1.5.5-SNAPSHOT and let me know if you encounter any issues: http://bytedeco.org/builds/ Thanks!

@saudet
Copy link
Member

saudet commented Mar 10, 2021

Builds for ONNX Runtime 1.7.0 with OpenMP enabled and that work on Mac have been released with version 1.5.5. Enjoy!

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

No branches or pull requests

2 participants