You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've checked that it is there in libopenvino_protobuf_shutdown.a, and the issue seems to be that __attribute__((destructor)) does nothing, library_unload is not actually registered as destructor. Adding -Wl,--whole-archive to libopenvino_protobuf_shutdown.a linkage does not help - library_unload is present in final .so after this but is not called anywhere.
I've fixed this for myself by replacing this function with
LINK_LIBRARY:WHOLE_ARCHIVE is pretty fresh, don't know what cmake version you target. It it is too new, it is possible to create a proxy library instead which has explicit -Wl,--whole-archive in its link options.
Note that whole-archive does not help by itself, I still needed to replace destructor function with global object.
My toolchain is LLVM 18, GCC 14 (stdlib provider), cmake 3.29, ninja 1.11 on Ubuntu 20.04
OpenVINO Version
2024.0.0
Operating System
Ubuntu 20.04 (LTS)
Device used for inference
CPU
Framework
None
Model used
No response
Issue description
ONNX frontend uses protobuf library which allocates some memory on startup and expects user to call
google::protobuf::ShutdownProtobufLibrary()
on exit. OpenVINO does it here https://github.com/openvinotoolkit/openvino/blob/releases/2024/0/src/frontends/common/shutdown_protobuf/shutdown_protobuf.cpp#L27-L30 but, at least in my builds, this function does not get called, it is not even present in final libopenvino_onnx_frontend.so.2024.0.0.I've checked that it is there in libopenvino_protobuf_shutdown.a, and the issue seems to be that
__attribute__((destructor))
does nothing,library_unload
is not actually registered as destructor. Adding-Wl,--whole-archive
to libopenvino_protobuf_shutdown.a linkage does not help -library_unload
is present in final .so after this but is not called anywhere.I've fixed this for myself by replacing this function with
Step-by-step reproduction
No response
Relevant log output
No response
Issue submission checklist
The text was updated successfully, but these errors were encountered: