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 of libonnxruntime.dylib (version 1.17) into target/debug.
-
ort apparently detects that libonnxruntime.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 get libonnxruntime.dylib from, and why doesn’t it appear in target/debug even when I’m only using ort?
My current hypothesis is that ort 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 using ORT_DYLIB_PATH.
Thanks
Hi,
Right now I'm working on porting a Python service that uses
silero-vadandsherpa-onnxto Rust. For model inference in the Rust version of the application, I’m using:Example of how the libraries are included:
At the moment, I’ve run into an issue that could be described as “shared library hell,” as mentioned in the documentation:
sherpa-rscopies its own version oflibonnxruntime.dylib(version 1.17) into target/debug.ortapparently detects thatlibonnxruntime.dylibis already loaded and doesn’t try to load its own.At runtime, when I call the
ortAPI, 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
ortgetlibonnxruntime.dylibfrom, and why doesn’t it appear intarget/debugeven when I’m only usingort?My current hypothesis is that
ortlooks 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
ortin my case?So far, it seems like I need to manually download a matching ONNX Runtime distribution and specify its path using
ORT_DYLIB_PATH.Thanks