Javacpp-presets: onnxruntime examples crash on macOS

Created on 25 Jul 2020  路  4Comments  路  Source: bytedeco/javacpp-presets

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
  2. 2.
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

bug

All 4 comments

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

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

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!

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blueberry picture blueberry  路  26Comments

thunterdb picture thunterdb  路  37Comments

blueberry picture blueberry  路  34Comments

archenroot picture archenroot  路  56Comments

Neiko2002 picture Neiko2002  路  32Comments