onnxruntime
onnxruntime copied to clipboard
[Jvm] Native crash during createSession: std::bad_cast
Describe the issue
uname -a
Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
Code: https://github.com/snakers4/silero-vad/tree/master/examples/java-example
The code runs well on Windows (runtime ver:1.18.0 - 1.15.0 ), but it will crash on linux
I tested 1.18.0 - 1.17.0, it will be crash:
OrtEnvironment env = OrtEnvironment.getEnvironment();
// Create an ONNX session options object
OrtSession.SessionOptions opts = new OrtSession.SessionOptions();
// Set the InterOp thread count to 1, InterOp threads are used for parallel processing of different computation graph operations
opts.setInterOpNumThreads(1);
// Set the IntraOp thread count to 1, IntraOp threads are used for parallel processing within a single operation
opts.setIntraOpNumThreads(1);
// Add a CPU device, setting to false disables CPU execution optimization
opts.addCPU(true);
// Create an ONNX session using the environment, model path, and options
session = env.createSession(modelPath, opts);
// ^^^^^^^^^ <= crash
Crash log:
terminate called after throwing an instance of 'std::bad_cast'
what(): std::bad_cast
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command '/home/cat/.jdks/corretto-15.0.2/bin/java'' finished with non-zero exit value 134
I tested ver under 1.17.0, eg 1.16.3\1.16.0\1.15.0, the code hangs at env.createSession(modelPath, opts);
To reproduce
Clone code and run
Urgency
No response
Platform
Linux
OS Version
Debian GNU/Linux 12
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
Carsh on 1.18.0 - 1.17.0; Anr below 1.16.3
ONNX Runtime API
Java
Architecture
X64
Execution Provider
Default CPU
Execution Provider Library Version
No response