Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Kemp__Victor
Beginner
122 Views

Dynamically link without using CPU-specific DLLs

Hello.

How can I compile a program to link MKL dynamically and so that it only uses the basic DLLs (mkl_intel_thread.dll, mkl_core.dll, libiomp5md.dll) and won't try to load different ones like mkl_avx.dll, mkl_avx2.dll, etc. on different processors?

Or is there an environment variable or something to do that?

 

0 Kudos
7 Replies
Gennady_F_Intel
Moderator
122 Views

you don't need to link explicitly about this dll - it happens automatically.  You also may try to build your owner custom dll which will contain all optimizations for all cpu types. You may refer to the MKL User Guide - see Building Custom Dynamic-link Libraries.

Kemp__Victor
Beginner
122 Views

Thanks Gennady though what I want is the opposite. To make it not use those extra DLLs.

Kemp__Victor
Beginner
122 Views

I've worked it out now. If mkl_def.dll is present at runtime and mkl_avx2.dll/etc are missing, then uses that default dll and doesn't demand the CPU-specific ones.

Gennady_F_Intel
Moderator
122 Views

we didn't test such mode and in the case, if you will experience some runtime or performance problems, then back to the recommended building mode with mkl.

Kemp__Victor
Beginner
122 Views

Oh, but surely that's what will be used on an older CPU, isn't it? I find that results with mkl_avx2.dll appear to be wrong in one case but are much better with mkl_def.dll.

Another problem is the large size of all those files which makes distribution a bit less convenient.

 

Gennady_F_Intel
Moderator
122 Views

if the results are wrong, make sense to give us the example that shows this problem. You may also try to submit the ticket against MKL into the intel online service center (https://supporttickets.intel.com/).

Kemp__Victor
Beginner
122 Views

Unfortunately, it's not my software so it would be quite a lot of work to make an example the clearly shows the problem. I'm not even sure it's really a bug. The results with mkl_avx2.dll have about 10x the magnitude of random noise in the solution as it does with only mkl_def.dll. Both have this noise though so it might be an ill-conditioned problem I'm trying to solve or in some other way pushing it beyond what it's meant to do.

I'm confused about why using only mkl_def.dll is risky though. Is that not what it falls back on when the other features like AVX and SIMD aren't available? Surely it's safe on an older processor without those extra features?

Reply