Description
Hi,
Right now I'm working on porting a Python service that uses silero-vad
and sherpa-onnx
to Rust. For model inference in the Rust version of the application, I’m using:
Example of how the libraries are included:
sherpa-rs = { version = "0.6.6", features = ["sys", "download-binaries" ] }
ort = { version = "=2.0.0-rc.9", features = ["ndarray", "cuda", "load-dynamic", "download-binaries"] }
At the moment, I’ve run into an issue that could be described as “shared library hell,” as mentioned in the documentation:
-
sherpa-rs
copies its own version oflibonnxruntime.dylib
(version 1.17) into target/debug. -
ort
apparently detects thatlibonnxruntime.dylib
is already loaded and doesn’t try to load its own. -
At runtime, when I call the
ort
API, I get the error:"The requested API version [20] is not available, only API versions [1, 17] are supported in this build"
.
This brings me to a couple of questions:
-
Where does
ort
getlibonnxruntime.dylib
from, and why doesn’t it appear intarget/debug
even when I’m only usingort
?
My current hypothesis is thatort
looks it up from somewhere in the cache:
/Library/Caches/ort.pyke.io/dfbin/x86_64-apple-darwin/{hash}/onnxruntime/lib/libonnxruntime.a
. -
What is the recommended way to configure
ort
in my case?
So far, it seems like I need to manually download a matching ONNX Runtime distribution and specify its path usingORT_DYLIB_PATH
.
Thanks