You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/04/12 13:52:00 UTC

[GitHub] [incubator-mxnet] akarbown commented on issue #18255: MKL_USE_STATIC_LIBS broken

akarbown commented on issue #18255:
URL: https://github.com/apache/incubator-mxnet/issues/18255#issuecomment-817830091


   I have compiled MxNet library (libmxnet.so), that uses MKL via Single Dynamic Library (so libmxnet.so links with libmkl_rt.so) and uses OpenMP separately (so libmxnet.so also links with libgomp.so.1). Since, MxNet depends on GNU OpenMP, I'm forcing MKL to use GNU threading layer (MKL_THREADING_LAYER=GNU), so I can have a single (GNU) OpenMP runtime in the process.
   However, libmkl_rt fails to find GNU OpenMP (strace revealed that it looks for libgomp.so which is not present in filesystem - instead of libgomp.so.1) and then fallbacks for libiomp5.so:
   ```
   [pid 29641] open("/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/libmkl_core.so", O_RDONLY|O_CLOEXEC <unfinished ...>
   [pid 29641] open("/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/libgomp.so", O_RDONLY|O_CLOEXEC <unfinished ...>
   [pid 29641] open("/opt/rh/rh-python36/root/usr/bin/libgomp.so", O_RDONLY|O_CLOEXEC <unfinished ...>
   [pid 29641] open("/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/../../../compiler/lib/intel64/libgomp.so", O_RDONLY|O_CLOEXEC <unfinished ...>
   [pid 29641] open("/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libgomp.so", O_RDONLY|O_CLOEXEC <unfinished ...>
   [pid 29641] open("/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/libiomp5.so", O_RDONLY|O_CLOEXEC <unfinished ...>
   [pid 29641] open("/opt/rh/rh-python36/root/usr/bin/libiomp5.so", O_RDONLY|O_CLOEXEC <unfinished ...>
   [pid 29641] open("/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/../../../compiler/lib/intel64/libiomp5.so", O_RDONLY|O_CLOEXEC <unfinished ...>
   [pid 29641] open("/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/libmkl_gnu_thread.so", O_RDONLY|O_CLOEXEC <unfinished ...>
   [pid 29641] open("/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/libmkl_intel_lp64.so", O_RDONLY|O_CLOEXEC <unfinished ...>
   [pid 29641] open("/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/libmkl_avx2.so", O_RDONLY|O_CLOEXEC <unfinished ...>
   ```
   So I end up having two different OpenMP implementations in a single process and that's causing runtime issues - I'm observing hangs during unit tests.When I create a symlink (libgomp.so -> libgomp.so.1) I can confirm that MKL opens GNU OpenMP and my tests pass.
   I have reported the issue internally and I'm waiting for the solution of that issue. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org