Skip to content

--config=mkl leads to libmklml_intel.so: cannot open shared object file: No such file or directory #13711

Closed
@llealgt

Description

@llealgt

I compiled passing --config=mkl to bazel, it compiles fine and i get the .whl file, i install it with pip correctly, but when i launch a python session and type : import tensorflow as tf i get:
ImportError: libmklml_intel.so: cannot open shared object file: No such file or directory

Any ideas?

Activity

gunan

gunan commented on Oct 15, 2017

@gunan
Contributor

I apologize but I am having a hard time understanding what the problem is, where the problem is, and what version it affects. Please resubmit and pay attention to the issue template (https://github.com/tensorflow/tensorflow/issues/new) . Please provide all the information it asks. Thank you.

RenfengLiu

RenfengLiu commented on Oct 27, 2017

@RenfengLiu

I had the same problem, compiled successfully with --config=mkl on Ubuntu 16.04, and installed the whl with pip. But in python code, when you run import tensorflow as tf, I got following error message

ImportError: Traceback (most recent call last):
  File "/home/robin/anaconda/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/robin/anaconda/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/robin/anaconda/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: libmklml_intel.so: cannot open shared object file: No such file or directory


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
rylz

rylz commented on Nov 1, 2017

@rylz

I had the same problem and after many attempts to install the base intel-mkl distribution and finding that it did not include a library called libmklml_intel.so, I found the following Intel repo that builds this library: https://github.com/01org/mkl-dnn

I followed their installation instructions and tensorflow started working. Note that it installs to /usr/local/lib by default, so you may need to add that to your LD_LIBRARY_PATH depending on your current configuration.

added a commit that references this issue on Nov 20, 2017
yingted

yingted commented on Nov 20, 2017

@yingted
Contributor

I have the same problem. It looks like this error is caused by libmklml_intel.so not being included
I've created a PR: #14709
It'll take me at least a day to review the CLA.

Related commit: fbbe5cd
Related issue: #12975

Immexxx

Immexxx commented on Dec 27, 2017

@Immexxx
Contributor

Verified Solution: If others hit this page, change the code as per @yingted git commit (instead of trying to install the base Intel-MKL), rebuild using bazel (which finished very quickly) and you should see that the new .whl is about 30M more that the previous one

Using the new .whl to install (with the -I option if required) and the import should work correctly

0xDaksh

0xDaksh commented on Jan 2, 2018

@0xDaksh

Fix for this is:

# If you don't have cmake
sudo apt install cmake

git clone https://github.com/01org/mkl-dnn.git
cd mkl-dnn/scripts && ./prepare_mkl.sh && cd ..
mkdir -p build && cd build && cmake .. && make
sudo make install

# if using bash then
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >> ~/.bashrc

If you're using zsh instead of bash, omit the last line with:

echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >> ~/.zshrc
syedmohsinbukhari

syedmohsinbukhari commented on Jan 21, 2018

@syedmohsinbukhari

@DakshMiglani Thanks. Do I have to compile tensorflow again?

YerongLi

YerongLi commented on Apr 10, 2018

@YerongLi

Following MKL instruction here does not gives necessary libmklml_intel.so file in the library.
https://github.com/mind/wheels#mkl.

Anyone knows how to follow MKL README https://github.com/intel/mkl-dnn in order to generate libmklml_intel.so?

4 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mbrio@rylz@RenfengLiu@krips89@syedmohsinbukhari

        Issue actions

          --config=mkl leads to libmklml_intel.so: cannot open shared object file: No such file or directory · Issue #13711 · tensorflow/tensorflow