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

OMP: Error #15: Initializing libguide.so, but found libguide.so already initialized

phillies
Beginner
1,294 Views
Hi,

I use MKL 10.1.1.019 compiled with ICC 11.0 under ubuntu linux 8.10 amd64 for numerical backend to numpy (python numerical library). It works in general but sometimes ipython crashes with the following error message:

OMP: Error #15: Initializing libguide.so, but found libguide.so already initialized.
OMP: Hint: This may cause performance degradation and correctness issues. Set environment variable KMP_DUPLICATE_LIB_OK=TRUE to ignore this problem and force the program to continue anyway. Please note that the use of KMP_DUPLICATE_LIB_OK is unsupported and using it may cause undefined behavior. For more information, please contact Intel Premier Support.
Aborted

Usually when I used the library for computing, then doing some other stuff for a few minutes and then accessing the numerical functions again.

I found this article which describes a similar problem: http://software.intel.com/en-us/articles/opm-abort-initializing-libguide40dll/
There are several libguide.so on my system:

/opt/intel/Compiler/11.0/081/lib/intel64/libguide.so
/opt/intel/mkl/10.1.1.019/lib/32/libguide.so
/opt/intel/mkl/10.1.1.019/lib/64/libguide.so
/opt/intel/mkl/10.1.1.019/lib/em64t/libguide.so

The last one is the one used when compiling numpy, the middle ones shouldn't be a problem since they are for a different architecture but the first one is for the same architecture as the last one but differs. I would remove one of them but since they differ which one should I remove? (Nontheless they shouldn't differ I think)

I try the KMP_DUPLICATE_LIB_OK workaround now until someone has a better solution.

Cheers

Phil
0 Kudos
11 Replies
ArturGuzik
Valued Contributor I
1,294 Views
Quoting - phillies
Hi,

I use MKL 10.1.1.019 compiled with ICC 11.0 under ubuntu linux 8.10 amd64 for numerical backend to numpy (python numerical library). It works in general but sometimes ipython crashes with the following error message:

OMP: Error #15: Initializing libguide.so, but found libguide.so already initialized.
OMP: Hint: This may cause performance degradation and correctness issues. Set environment variable KMP_DUPLICATE_LIB_OK=TRUE to ignore this problem and force the program to continue anyway. Please note that the use of KMP_DUPLICATE_LIB_OK is unsupported and using it may cause undefined behavior. For more information, please contact Intel Premier Support.
Aborted

Usually when I used the library for computing, then doing some other stuff for a few minutes and then accessing the numerical functions again.

I found this article which describes a similar problem: http://software.intel.com/en-us/articles/opm-abort-initializing-libguide40dll/
There are several libguide.so on my system:

/opt/intel/Compiler/11.0/081/lib/intel64/libguide.so
/opt/intel/mkl/10.1.1.019/lib/32/libguide.so
/opt/intel/mkl/10.1.1.019/lib/64/libguide.so
/opt/intel/mkl/10.1.1.019/lib/em64t/libguide.so

The last one is the one used when compiling numpy, the middle ones shouldn't be a problem since they are for a different architecture but the first one is for the same architecture as the last one but differs. I would remove one of them but since they differ which one should I remove? (Nontheless they shouldn't differ I think)

I try the KMP_DUPLICATE_LIB_OK workaround now until someone has a better solution.

Cheers

Phil

Hi,

first check would be to make sure your LD_LIBRARY_PATH points to only one version of MKL (seems likely in your case) and that you app finds only one version of libguide. What's your linking command? Usually static/dynamic link is a problem.

A.
0 Kudos
Gennady_F_Intel
Moderator
1,294 Views

Phil,
Please look at the KB article called "OMP Abort: Initializing libguide40.dll but found libiomp5md.dll already initialized" following the link:
"__http://software.intel.com/en-us/articles/opm-abort-initializing-libguide40dll/"
I think it will useful for clarifying the problem you met.
--Gennagy

0 Kudos
phillies
Beginner
1,294 Views

Phil,
Please look at the KB article called "OMP Abort: Initializing libguide40.dll but found libiomp5md.dll already initialized" following the link:
"__http://software.intel.com/en-us/articles/opm-abort-initializing-libguide40dll/"
I think it will useful for clarifying the problem you met.
--Gennagy

Thanks, but I cited this article in my post and said that I use the workaround solution given there. Also it is about new vs old lib while I have twice the - at least in name - identical libs. So no, did not clarify my problem.

I don't use LD_LIBRARY_PATH but I checked my ld.so.conf, both paths were added there. I now linked only the MKL path.

But my question remains: Why is there a difference in both libs and which shall I link?
0 Kudos
phillies
Beginner
1,294 Views
Quoting - ArturGuzik

Hi,

first check would be to make sure your LD_LIBRARY_PATH points to only one version of MKL (seems likely in your case) and that you app finds only one version of libguide. What's your linking command? Usually static/dynamic link is a problem.

A.

Compiler/linker command is
icc -fPIC -lmkl_mc -lmkl_def -shared ...
so its dynamically linked against the mkl version of libguide.so (at least numpys build script says that it's going to use it from the mkl folder)
I removed the path include of icc's lib folder and rebuilt numpy. let's see if this adds up.
0 Kudos
ArturGuzik
Valued Contributor I
1,294 Views
Quoting - phillies

Compiler/linker command is
icc -fPIC -lmkl_mc -lmkl_def -shared ...
so its dynamically linked against the mkl version of libguide.so (at least numpys build script says that it's going to use it from the mkl folder)
I removed the path include of icc's lib folder and rebuilt numpy. let's see if this adds up.
Phil,

don't delete (remove) any of these (on my Win64 I have maybe 10 of them (IVF, ICC, MKL etc.)). Your problem is related to paths/what-and-how you link, only, I believe (although I might be wrong).
You say that you're on AMD 64 (correct?) but link (at least in this small part you showed) with mkl kernel for processors based on the Intel Core microarchitecture (mkl_mc.lib). Is this intended? and working?

MKL recommends using -liomp5 (and-lpthread -lmkl_intel_thread) instead. Try that and verify that no other portion of your app is statically linked to other threading library.

A.
0 Kudos
phillies
Beginner
1,294 Views
Quoting - ArturGuzik
Phil,

don't delete (remove) any of these (on my Win64 I have maybe 10 of them (IVF, ICC, MKL etc.)). Your problem is related to paths/what-and-how you link, only, I believe (although I might be wrong).
You say that you're on AMD 64 (correct?) but link (at least in this small part you showed) with mkl kernel for processors based on the Intel Core microarchitecture (mkl_mc.lib). Is this intended? and working?

MKL recommends using -liomp5 (and-lpthread -lmkl_intel_thread) instead. Try that and verify that no other portion of your app is statically linked to other threading library.

A.

I just used amd64 as descriptor for any 64 bit CPU. In fact I use an Intel Xeon CPU.

The problem when I remove the path where the 2nd libguide.so resides is that scipy will not compile anymore. It needs a libimf.so from the ICCs library path (where there is also an older libguide.so, dated Jan 31 2009, the mkl is Mar 14 2008. I installed both the same day, so thats not the cause). Also the older one is 100k smaller than the newer one.

I rebuilt numpy using iomp5. No crash within the last hour, but this does not mean anything.

Maybe someone of Intel can tell me why there is a newer and larger libiomp5.so in the icc lib folder than in the mkl folder. I downloaded and installed both the same day.

Cheers

Philipp


0 Kudos
TimP
Honored Contributor III
1,294 Views
These libraries are supposed to be upward compatible, over a limited range of versions (the new one has all the functionality of the older one). Typically, a new one has added features, so a size increase is not surprising. So, you should assure that you use only the latest one. You might even rename the older one so as to avoid accidental use of it, if you are always using the compiler and MKL together. This is why I urge you, when you aren't using the current combined compiler and MKL package, to use the -openmp options to cause the compiler to choose the OpenMP library.
0 Kudos
phillies
Beginner
1,294 Views
Quoting - tim18
These libraries are supposed to be upward compatible, over a limited range of versions (the new one has all the functionality of the older one). Typically, a new one has added features, so a size increase is not surprising. So, you should assure that you use only the latest one. You might even rename the older one so as to avoid accidental use of it, if you are always using the compiler and MKL together. This is why I urge you, when you aren't using the current combined compiler and MKL package, to use the -openmp options to cause the compiler to choose the OpenMP library.
Ok, so the libs of the compiler should be linked instead of the ones from MKL. I fount that in
intel/Compiler/11.0/081/mkl/lib/em64t/
there are also mkl libs. I now recompiled numpy using the libs from the compiler only. Let's see if this works.

Thanks for your patience and help!
0 Kudos
phillies
Beginner
1,294 Views
Same ol' same ol'....

OMP: Warning #2: Cannot open message catalog "libiomp5.cat":
OMP: System error #2: No such file or directory
OMP: Hint: Check NLSPATH environment variable, its value is "(null)".
OMP: Info #3: Default messages will be used.
OMP: Error #15: Initializing libiomp5.so, but found libiomp5.so already initialized.
OMP: Hint: This may cause performance degradation and correctness issues. Set environment variable KMP_DUPLICATE_LIB_OK=TRUE to ignore this problem and force the program to continue anyway. Please note that the use of KMP_DUPLICATE_LIB_OK is unsupported and using it may cause undefined behavior. For more information, please see http://www.intel.com/software/products/support/.
Aborted

This time linked against the iomp5 lib of ICC 11.0 and no other iomp5 lib in the LD path. Since I'm now sick of this I removed all other libiomp5.so files from my system. Maybe this helps.

0 Kudos
phillies
Beginner
1,294 Views
OMP: Warning #2: Cannot open message catalog "libiomp5.cat":
OMP: System error #2: No such file or directory
OMP: Hint: Check NLSPATH environment variable, its value is "(null)".
OMP: Info #3: Default messages will be used.
OMP: Error #15: Initializing libiomp5.so, but found libiomp5.so already initialized.
OMP: Hint: This may cause performance degradation and correctness issues. Set environment variable KMP_DUPLICATE_LIB_OK=TRUE to ignore this problem and force the program to continue anyway. Please note that the use of KMP_DUPLICATE_LIB_OK is unsupported and using it may cause undefined behavior. For more information, please see http://www.intel.com/software/products/support/.
Aborted

Still remains even if there is only one libiomp5.so present. Any other ideas?
0 Kudos
ArturGuzik
Valued Contributor I
1,294 Views
Quoting - phillies
OMP: Warning #2: Cannot open message catalog "libiomp5.cat":
OMP: System error #2: No such file or directory
OMP: Hint: Check NLSPATH environment variable, its value is "(null)".
OMP: Info #3: Default messages will be used.
OMP: Error #15: Initializing libiomp5.so, but found libiomp5.so already initialized.
OMP: Hint: This may cause performance degradation and correctness issues. Set environment variable KMP_DUPLICATE_LIB_OK=TRUE to ignore this problem and force the program to continue anyway. Please note that the use of KMP_DUPLICATE_LIB_OK is unsupported and using it may cause undefined behavior. For more information, please see http://www.intel.com/software/products/support/.
Aborted

Still remains even if there is only one libiomp5.so present. Any other ideas?
So it probably means you're linking somehow/somewhere statically the numpy with libiomp5 once you build it and then MKL tries to load another one at runtime. You probably need to show the linker(s) commands for both, so somebody can come up with more useful advice.

A.
0 Kudos
Reply