Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6981 Discussions

Error running NumPy example: MKL FATAL ERROR: Cannot load libmkl_avx.so or libmkl_def.so.

MattDMo
Beginner
2,012 Views

Hi,

I built NumPy and SciPy according to the instructions posted at http://software.intel.com/en-us/articles/numpyscipy-with-intel-mkl. I'm using the free version of Composer XE 2013 for Linux. I have added the appropriate directories to LD_LIBRARY_PATH and updated ldconfig. NumPy and SciPy both seem to build and install just fine, but when I run the example program at the end of the page, it fails at the first matrix multiplication line C = A*B (just before start = time.time() ) with the error MKL FATAL ERROR: Cannot load libmkl_avx.so or libmkl_def.so.

I've tried everything I can think of, but I still can't get rid of the error. I recently applied the MKL patch here http://software.intel.com/en-us/articles/svd-multithreading-bug-in-mkl could this have something to do with it?

Thanks,
Matt

0 Kudos
4 Replies
SergeyKostrov
Valued Contributor II
2,012 Views
>>...it fails at the first matrix multiplication line C = A*B (just before start = time.time() ) with the error >>MKL FATAL ERROR: Cannot load libmkl_avx.so or libmkl_def.so... It is possible that search path to these modules is Not set properly and you need to review LD_LIBRARY_PATH environment variable. By the way, I could easily reproduce that problem on a Windows platform when mkl_avx.dll or mkl_def.dll can not be found. Also, please verify that 32-bit test application uses 32-bit MKL modules, or 64-bit test application uses 64-bit MKL modules.
0 Kudos
MattDMo
Beginner
2,012 Views

Hi Sergey,

I think I solved the problem. My NumPy 'site.cfg' file simply had the line "mkl_libs = mkl_rt", but when I explicitly added mkl_avx and mkl_def and recompiled, it worked fine. I guess there was some issue in libmkl_rt.so. I only have the 64-bit MKL installed, so that's not an issue.

Matt

0 Kudos
SergeyKostrov
Valued Contributor II
2,012 Views
Thanks for the update, Matt. >>...I think I solved the problem... ...I only have the 64-bit MKL installed... This is what I've expected because, as far as I know, the pair of modules mkl_avx.* and mkl_def.* is for 64-bit platforms only. On 32-bit platforms the the pair of modules should be mkl_avx.* and mkl_p4.*.
0 Kudos
Reply