open-mmlab / mmdeploy

OpenMMLab Model Deployment Framework
https://mmdeploy.readthedocs.io/en/latest/
Apache License 2.0
2.79k stars 638 forks source link

[Bug] Failed to load library libonnxruntime_providers_shared.so with error: libonnxruntime_providers_shared.so: cannot open shared object file: No such file or directory #2141

Closed mozhijing closed 1 year ago

mozhijing commented 1 year ago

Checklist

Describe the bug

docker openmmlab/mmdeploy:ubuntu20.04-cuda11.3-mmdeploy1.1.0 log: [2023-06-01 08:56:33.505] [mmdeploy] [info] [model.cpp:35] [DirectoryModel] Load model: "/data/rtmpose-ort/rtmpose-m/" [2023-06-01 08:56:33.505] [mmdeploy] [info] [model.cpp:35] [DirectoryModel] Load model: "/data/rtmpose-ort/rtmdet-nano/" 2023-06-01 08:56:33.513433837 [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 [2023-06-01 08:56:33.513] [mmdeploy] [error] [ort_net.cpp:205] unhandled exception when creating ORTNet: OrtSessionOptionsAppendExecutionProvider_Cuda: Failed to load shared library [2023-06-01 08:56:33.513] [mmdeploy] [error] [net_module.cpp:54] Failed to create Net backend: onnxruntime, config: { "context": { "device": "", "model": "", "stream": "" }, "input": [ "prep_output" ], "input_map": { "img": "input" }, "is_batched": true, "module": "Net", "name": "rtmdet", "output": [ "infer_output" ], "output_map": {}, "type": "Task" } [2023-06-01 08:56:33.513] [mmdeploy] [error] [task.cpp:99] error parsing config: { "context": { "device": "", "model": "", "stream": "" }, "input": [ "prep_output" ], "input_map": { "img": "input" }, "is_batched": true, "module": "Net", "name": "rtmdet", "output": [ "infer_output" ], "output_map": {}, "type": "Task" } [2023-06-01 08:56:33.513] [mmdeploy] [info] [inference.cpp:54] ["img"] <- ["data"] [2023-06-01 08:56:33.513] [mmdeploy] [info] [inference.cpp:65] ["post_output"] -> ["dets"] 2023-06-01 08:56:33.533754882 [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 [2023-06-01 08:56:33.535] [mmdeploy] [error] [ort_net.cpp:205] unhandled exception when creating ORTNet: OrtSessionOptionsAppendExecutionProvider_Cuda: Failed to load shared library [2023-06-01 08:56:33.535] [mmdeploy] [error] [net_module.cpp:54] Failed to create Net backend: onnxruntime, config: { "context": { "device": "", "model": "", "stream": "" }, "input": [ "prep_output" ], "input_map": { "img": "input" }, "is_batched": false, "module": "Net", "name": "topdownposeestimator", "output": [ "infer_output" ], "output_map": {}, "type": "Task" } [2023-06-01 08:56:33.535] [mmdeploy] [error] [task.cpp:99] error parsing config: { "context": { "device": "", "model": "", "stream": "" }, "input": [ "prep_output" ], "input_map": { "img": "input" }, "is_batched": false, "module": "Net", "name": "topdownposeestimator", "output": [ "infer_output" ], "output_map": {}, "type": "Task" } [2023-06-01 08:56:33.535] [mmdeploy] [info] [inference.cpp:54] ["img"] <- ["rois"] [2023-06-01 08:56:33.535] [mmdeploy] [info] [inference.cpp:65] ["post_output"] -> ["keypoints"] Segmentation fault (core dumped)

Reproduction

python3 pose_tracker.py cuda /data/rtmpose-ort/rtmdet-nano/ /data/rtmpose-ort/rtmpose-m/ /data/two-girls.mp4 --output_dir /data/output

Environment

06/01 09:03:32 - mmengine - INFO - 

06/01 09:03:32 - mmengine - INFO - **********Environmental information**********
06/01 09:03:32 - mmengine - INFO - sys.platform: linux
06/01 09:03:32 - mmengine - INFO - Python: 3.8.10 (default, Mar 13 2023, 10:26:41) [GCC 9.4.0]
06/01 09:03:32 - mmengine - INFO - CUDA available: True
06/01 09:03:32 - mmengine - INFO - numpy_random_seed: 2147483648
06/01 09:03:32 - mmengine - INFO - GPU 0: NVIDIA GeForce RTX 2060
06/01 09:03:32 - mmengine - INFO - CUDA_HOME: /usr/local/cuda
06/01 09:03:32 - mmengine - INFO - NVCC: Cuda compilation tools, release 11.3, V11.3.109
06/01 09:03:32 - mmengine - INFO - GCC: x86_64-linux-gnu-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
06/01 09:03:32 - mmengine - INFO - PyTorch: 1.10.0+cu113
06/01 09:03:32 - mmengine - INFO - PyTorch compiling details: PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - LAPACK is enabled (usually provided by MKL)
  - NNPACK is enabled
  - CPU capability usage: AVX512
  - CUDA Runtime 11.3
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86
  - CuDNN 8.2
  - Magma 2.5.2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.0, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.10.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, 

06/01 09:03:32 - mmengine - INFO - TorchVision: 0.11.0+cu113
06/01 09:03:32 - mmengine - INFO - OpenCV: 4.5.4
06/01 09:03:32 - mmengine - INFO - MMEngine: 0.7.3
06/01 09:03:32 - mmengine - INFO - MMCV: 2.0.0
06/01 09:03:32 - mmengine - INFO - MMCV Compiler: GCC 9.3
06/01 09:03:32 - mmengine - INFO - MMCV CUDA Compiler: 11.3
06/01 09:03:32 - mmengine - INFO - MMDeploy: 1.1.0+faf05fe
06/01 09:03:32 - mmengine - INFO - 

06/01 09:03:32 - mmengine - INFO - **********Backend information**********
06/01 09:03:32 - mmengine - INFO - tensorrt:    8.2.3.0
06/01 09:03:32 - mmengine - INFO - tensorrt custom ops: Available
06/01 09:03:32 - mmengine - INFO - ONNXRuntime: None
06/01 09:03:32 - mmengine - INFO - ONNXRuntime-gpu: 1.14.1
06/01 09:03:32 - mmengine - INFO - ONNXRuntime custom ops:  Available
06/01 09:03:32 - mmengine - INFO - pplnn:   0.8.1
06/01 09:03:32 - mmengine - INFO - ncnn:    1.0.20230224
06/01 09:03:32 - mmengine - INFO - ncnn custom ops: Available
06/01 09:03:32 - mmengine - INFO - snpe:    None
06/01 09:03:32 - mmengine - INFO - openvino:    2022.3.0
06/01 09:03:32 - mmengine - INFO - torchscript: 1.10.0+cu113
06/01 09:03:32 - mmengine - INFO - torchscript custom ops:  Available
06/01 09:03:32 - mmengine - INFO - rknn-toolkit:    None
06/01 09:03:32 - mmengine - INFO - rknn-toolkit2:   None
06/01 09:03:32 - mmengine - INFO - ascend:  None
06/01 09:03:32 - mmengine - INFO - coreml:  None
06/01 09:03:32 - mmengine - INFO - tvm: None
06/01 09:03:32 - mmengine - INFO - vacc:    None
06/01 09:03:32 - mmengine - INFO - 

06/01 09:03:32 - mmengine - INFO - **********Codebase information**********
06/01 09:03:32 - mmengine - INFO - mmdet:   None
06/01 09:03:32 - mmengine - INFO - mmseg:   None
06/01 09:03:32 - mmengine - INFO - mmpretrain:  None
06/01 09:03:32 - mmengine - INFO - mmocr:   None
06/01 09:03:32 - mmengine - INFO - mmagic:  None
06/01 09:03:32 - mmengine - INFO - mmdet3d: None
06/01 09:03:32 - mmengine - INFO - mmpose:  None
06/01 09:03:32 - mmengine - INFO - mmrotate:    None
06/01 09:03:32 - mmengine - INFO - mmaction:    None
06/01 09:03:32 - mmengine - INFO - mmrazor: None

Error traceback

No response

RunningLeon commented 1 year ago

@mozhijing hi, pls. dowload ort lib with cuda version. You could refer to this

mozhijing commented 1 year ago

@RunningLeon Thank you for your reply.I can't run on gpu, cpu is ok.Segmentation fault (core dumped) while running run on gpu: python3 pose_tracker.py cuda /data/rtmpose-ort/rtmdet-nano/ /data/rtmpose-ort/rtmpose-m/ /data/two-girls.mp4 --output /data/2/ [2023-06-02 03:05:28.905] [mmdeploy] [info] [model.cpp:35] [DirectoryModel] Load model: "/data/rtmpose-ort/rtmpose-m/" [2023-06-02 03:05:28.905] [mmdeploy] [info] [model.cpp:35] [DirectoryModel] Load model: "/data/rtmpose-ort/rtmdet-nano/" Segmentation fault (core dumped) run on cpu: python3 pose_tracker.py cpu /data/rtmpose-ort/rtmdet-nano/ /data/rtmpose-ort/rtmpose-m/ /data/two-girls.mp4 --output /data/2/ [2023-06-02 03:05:57.473] [mmdeploy] [info] [model.cpp:35] [DirectoryModel] Load model: "/data/rtmpose-ort/rtmpose-m/" [2023-06-02 03:05:57.473] [mmdeploy] [info] [model.cpp:35] [DirectoryModel] Load model: "/data/rtmpose-ort/rtmdet-nano/" [2023-06-02 03:05:57.533] [mmdeploy] [info] [inference.cpp:54] ["img"] <- ["data"] [2023-06-02 03:05:57.533] [mmdeploy] [info] [inference.cpp:65] ["post_output"] -> ["dets"] [2023-06-02 03:05:57.764] [mmdeploy] [info] [inference.cpp:54] ["img"] <- ["rois"] [2023-06-02 03:05:57.764] [mmdeploy] [info] [inference.cpp:65] ["post_output"] -> ["keypoints"]

RunningLeon commented 1 year ago

@irexyc hi, does postracker support ort+gpu?

irexyc commented 1 year ago

@mozhijing

Hi, how did you install mmdeploy_runtime ?

mozhijing commented 1 year ago

@irexyc Thank you for your reply.The onnxruntime-gpu version is inconsistent.There's no problem now