Open honggyukim opened 6 months ago
Hmm.. this would be hard to debug. Can you find some more hints?
I don't have more clues yet, but just posted it how to reproduce the issue. Isn't it possible to reproduce it in your environment?
I did some search...
reason:
onnxruntime
you can just import onnxruntime to reproduce it.libonnxruntime_providers_shared.so
for some reason in uftrace
sideimport
but its not big deal, pyinstaller also have this problem, and I wonder its onnxruntime side problemHi @yihong0618, thanks for your investigation. I can simply reproduce with a much simpler example as follows.
$ cat onnx-test.py
#!/usr/bin/env python3
import onnxruntime
$ uftrace record ./onnx-test.py
2024-03-18 19:26:39.843928466 [W:onnxruntime:Default, onnxruntime_pybind_state.cc:2103 CreateInferencePybindStateModule] Init provider bridge failed.
Hi @yihong0618, thanks for your investigation. I can simply reproduce with a much simpler example as follows.
$ cat onnx-test.py #!/usr/bin/env python3 import onnxruntime $ uftrace record ./onnx-test.py 2024-03-18 19:26:39.843928466 [W:onnxruntime:Default, onnxruntime_pybind_state.cc:2103 CreateInferencePybindStateModule] Init provider bridge failed.
yes but I did not find the root cause in uftrace
side
It's okay. I'm just leaving a note for later investigation. I will have a look when I have more time for this.
Thanks very much for your help again!
the reason is we can not find libonnxruntime_providers_shared.so for some reason in uftrace side
@yihong0618's investigation looks correct. The warning message is printed at https://github.com/microsoft/onnxruntime/blob/v1.17.1/onnxruntime/python/onnxruntime_pybind_state.cc#L2101-L2104.
It looks the dlopen
at https://github.com/microsoft/onnxruntime/blob/v1.17.1/onnxruntime/core/platform/posix/env.cc#L535-L544 fails.
It's called with the sequence as follows.
InitProvidersSharedLibrary()
-> ProviderSharedLibrary.Ensure()
-> LoadDynamicLibrary()
-> dlopen()
.
the reason is we can not find libonnxruntime_providers_shared.so for some reason in uftrace side
The libonnxruntime_providers_shared.so
is found at /home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi
as follows.
$ LD_DEBUG=all ./import-onnxruntime.py
...
53575: search path=/home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi (RUNPATH from file /home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-310-x86_64-linux-gnu.so)
53575: trying file=/home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi/libonnxruntime_providers_shared.so
$ file /home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi/libonnxruntime_providers_shared.so
/home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi/libonnxruntime_providers_shared.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=1cc5be76d21480162602a755bcaaaf284b0a0c12, stripped
For some reasons, it looks uftrace blocks searching library from /home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi
.
This part says /home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi/libonnxruntime_providers_shared.so
is searched by RUNPATH
.
search path=/home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi
RUNPATH from file /home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-310-x86_64-linux-gnu.so
Maybe we should check whether uftrace bothers searching a library from RUNPATH
.
This part says
/home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi/libonnxruntime_providers_shared.so
is searched byRUNPATH
.search path=/home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi RUNPATH from file /home/honggyu/.local/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-310-x86_64-linux-gnu.so
Maybe we should check whether uftrace bothers searching a library from
RUNPATH
.
I also found this, but hang here....
@honggyukim yes we can run it with no warning like
LD_LIBRARY_PATH=/home/hyi/.local/lib/python3.9/site-packages/onnxruntime/capi uftrace a.py
@honggyukim yes we can run it with no warning like
LD_LIBRARY_PATH=/home/hyi/.local/lib/python3.9/site-packages/onnxruntime/capi uftrace a.py
seems the same problem
uftrace record for chromadb example shows an weird warning. Let's say there is an example as follows.
It shows nothing when running without uftrace.
But recording it shows a warning as follows.
This warning must be removed as if
test-chromadb.py
is executed without uftrace.