Checklist
Describe the bug
In the official Docker image openmmlab/mmdeploy:ubuntu20.04-cuda11.3-mmdeploy1.2.0, a bug occurs when using GPU for ONNX model inference, prompting that libonnxruntime_providers_shared.so cannot be found, which causes problems in model loading. This issue has now been resolved. Since issue 2456 (#2456) did not provide a solution in the end, the solution is offered here.
Reproduction
[E:onnxruntime:, provider_bridge_ort.cc:901 Ensure] Failed to load library libonnxruntime_providers_shared.so with error: libonnxruntime_providers_shared.so: cannot open shared object file: No such file or directory
2025-09-06 00:43:29.207808824 [E:onnxruntime:, provider_bridge_ort.cc:901 Ensure] Failed to load library libonnxruntime_providers_shared.so with error: libonnxruntime_providers_shared.so: cannot open shared object file: No such file or directory
2025-09-06 00:43:29.207809112 [E:onnxruntime:, provider_bridge_ort.cc:901 Ensure] Failed to load library libonnxruntime_providers_shared.so with error: libonnxruntime_providers_shared.so: cannot open shared object file: No such file or directory
2025-09-06 00:43:29.207809385 [E:onnxruntime:, provider_bridge_ort.cc:901 Ensure] Failed to load library libonnxruntime_providers_shared.so with error: libonnxruntime_providers_shared.so: cannot open shared object file: No such file or directory
[2025-09-06 00:43:29.220] [mmdeploy] [error] [ort_net.cpp:205] unhandled exception when creating ORTNet: OrtSessionOptionsAppendExecutionProvider_Cuda: Failed to load shared library
[2025-09-06 00:43:29.220] [mmdeploy] [error] [net_module.cpp:54] Failed to create Net backend: onnxruntime, config: {
"context": {
"device": "",
"model": "",
"stream": ""
},
Environment
openmmlab/mmdeploy:ubuntu20.04-cuda11.3-mmdeploy1.2.0
Error traceback