ITADN

ONNX Runtime version conflict when using sherpa-rs and ort in the same binary

#106Closedrdcm 创建于 2025-06-19
R
rdcmcommented
Hi, We're using multiple ML models in a single service, and for inference we rely on both ort and sherpa-rs. The issue is that these libraries depend on different versions of ONNX Runtime, and we previously worked around this using: ``` ORT_DYLIB_PATH = "target/debug/libonnxruntime.so.1.21.0" ort = { version = "=2.0.0-rc.9", features = [ "ndarray", "cuda", "load-dynamic", ]} sherpa-rs = { version = "0.6.6", default-features = false, features = [ "static", "sys" ]} ``` This setup worked fine on CPU, where sherpa-rs could be statically linked, avoiding any runtime conflict. However, once we enabled CUDA support: ``` sherpa-rs = { version = "0.6.6", default-features = false, features = [ # "static" - not working with "cuda" feature "cuda", "sys" ]} ``` …the workaround broke, since both libraries now attempt to load libonnxruntime.so dynamically, leading to symbol/version conflicts at runtime. Would it be possible to support an ONNX Runtime version in sherpa-rs that's compatible with what ort expects? Or alternatively, is there a supported way to avoid the conflict in this use case? Thanks in advance!
关闭于 2025-06-26 5 条评论