davisking / dlib

A toolkit for making real world machine learning and data analysis applications in C++
http://dlib.net
Boost Software License 1.0
13.52k stars 3.37k forks source link

centos intel MKL FATAL ERROR: Cannot load libmkl_avx.so or libmkl_def.so. #1942

Closed dantheman3333 closed 4 years ago

dantheman3333 commented 4 years ago

Expected Behavior

import dlib
face_detector = dlib.get_frontal_face_detector()

should be able to load the face detector

Current Behavior

Intel MKL FATAL ERROR: Cannot load libmkl_avx2.so or libmkl_def.so.

Steps to Reproduce

Pip env:

certifi (2019.9.11)
chardet (3.0.4)
cycler (0.10.0)
decorator (4.4.1)
dlib (19.18.0)
editdistance (0.5.3)
idna (2.8)
imageio (2.6.1)
intel-openmp (2020.0.133)
kiwisolver (1.1.0)
matplotlib (3.1.1)
mkl (2019.0)
networkx (2.4)
numpy (1.17.4)
Pillow (6.2.1)
pip (9.0.1)
pyparsing (2.4.5)
python-dateutil (2.8.1)
PyWavelets (1.1.1)
requests (2.22.0)
scikit-image (0.16.2)
scikit-video (1.1.11)
scipy (1.3.2)
setuptools (28.8.0)
six (1.13.0)
sk-video (1.1.10)
torch (1.3.1)
torchvision (0.4.2)
urllib3 (1.25.7)

Tried to add to $LD_LIBRARY_PATH the locations of libmkl_avx2.so and libmkl_def.so which were installed via pip

bash: :/share/apps/centos/7/usr/lib64:/opt/slurm/lib64:/share/apps/centos/7/usr/lib64:/opt/slurm/lib64:/home/<USER>/<project>/env/lib/libmkl_avx2.so:/home/<USER>/<project>/env/lib/libmkl_def.so:/home/<USER>/<project>/env/lib/

/opt/intel/mkl/ does not exist and I do not believe I have permission to download there

dantheman3333 commented 4 years ago

Our cluster admin rebuilt dlib.cpython-36m-x86_64-linux-gnu.so and copied it to the pip env, and now the problem is resolved. Unfortunately do not have any information beyond that.

18445864529 commented 2 years ago

Exactly the same error. Does someone know any detailed solutions?

18445864529 commented 2 years ago

All solutions from google did not work for me (e.g. install nomkl, update mkl or numpy or something). Finally solved by this method https://debugjournal.tumblr.com/post/98401758462/intel-mkl-dynamic-link-library-error