FS#75571 - [tensorflow] libiomp5.so not provided
Attached to Project:
Community Packages
Opened by Juan (jap48) - Wednesday, 10 August 2022, 04:32 GMT
Last edited by Konstantin Gizdov (kgizdov) - Tuesday, 06 September 2022, 11:30 GMT
Opened by Juan (jap48) - Wednesday, 10 August 2022, 04:32 GMT
Last edited by Konstantin Gizdov (kgizdov) - Tuesday, 06 September 2022, 11:30 GMT
|
Details
Description:
The tensorflow C API library (libtensorflow.so) cannot be loaded because the dependency libiomp5.so cannot be found. This is also the case for the -opt and -cuda variants; besides, the same issue occurs with the C++ library (libtensorflow_cc.so). This issue does not apply to the python packages (like python-tensorflow), because a version of libiomp5.so is included, currently at: /usr/lib/python3.10/site-packages/_solib_k8/_U_S_Sthird_Uparty_Smkl_Cmkl_Ulibs_Ulinux___Uexternal_Sllvm_Uopenmp/libiomp5.so ---- Possible solutions: 1 - Include libiomp5.so (and whatever deps it needs?) as part of the TF packages (similar to what is done on the python TF ones). It could be installed into /usr/lib or somewhere else, if that's too inconvenient. Note that one version of libiomp5.so can be found somewhere inside the bazel build tree, so that one could be installed. 2 - Add a dependency of TF on intel-oneapi-openmp (which provides libiomp5.so) and intel-oneapi-openmp (which provides a source-able vars.sh to allow loading the .so library) ---- Steps to reproduce: [In python REPL] >>> from ctypes import CDLL >>> lib = CDLL('/usr/lib/libtensorflow.so') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__ self._handle = _dlopen(self._name, mode) OSError: libiomp5.so: cannot open shared object file: No such file or directory |
This task depends upon
Closed by Konstantin Gizdov (kgizdov)
Tuesday, 06 September 2022, 11:30 GMT
Reason for closing: Fixed
Additional comments about closing: tensorflow 2.9.2-2
Tuesday, 06 September 2022, 11:30 GMT
Reason for closing: Fixed
Additional comments about closing: tensorflow 2.9.2-2
Maybe if we're lucky this will be automagically solved in TF 2.10.
In the meantime I'll be using my hackish workaround.
My new workaround is: /usr/lib/libomp.so -> /opt/intel/oneapi/lib/intel64/libiomp5.so
So adding a dependency to "openmp" should do the trick...