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

Using debug version of TBB with MKL on Windows

0serg
Beginner
758 Views

When MKL introduced support for TBB threading layer, it had one annoying problem. MKL does not ship in "debug" version and therefore all "release" builds of MKL used "release" version of TBB. The TBB on other hand does ship in "debug" versions. Our application used both MKL and TBB and its debug build used debug version of TBB, so this produced a conflict with MKL. At the time there was no solution other than linking MKL with TBB statically or using non-TBB threading layer for MKL in debug builds. 

Fast forward to freshly released 2022.1 on Windows. When I saw that there are now two versions of the library ("mkl_tbb_thread_dll.lib" and "mkl_tbb_threadd_dll.lib"  I got very excited because it looked like Intel solved this old problem and provided a way to link MKL with debug builds of TBB. I compiled my app in Release and new set of MKL 2022 + TBB 2021 libs worked just fine. I compiled my app in Debug... and it crashed. A quick investigation demonstrated that the crash happens when I first try to call MKL routines. It also issued a debug message:

INTEL MKL ERROR: The specified module could not be found: mkl_sequential.2.dll

I rechecked this twice: app was really using mkl_tbb_threadd.2.dll, but it still needed mkl_sequential.2.dll . Note that this was not the case with "normal"  mkl_tbb_thread.2.dll.  I could not remove TBB completely since rest of my app uses it, but apparently TBB in Debug was not used. 

This looks like a MKL bug to me, but I hasn't found documentation on these new "d" version of mkl_tbb_thread so I might be misusing this library. Could anyone comment?

0 Kudos
5 Replies
ShanmukhS_Intel
Moderator
734 Views

Hi,


Thank you for posting on Intel Communities.


There might be some files which are dependent on mkl_sequential.2.dll and we could see, mkl_sequential.2.dll is present in the latest version of oneMKL under path C:\Program Files (x86)\Intel\oneAPI\mkl\2022.1.0\redist\intel64 in addition to mkl_tbb_thread.2.dll and mkl_tbb_threadd.2.dll. Could you please let us know if it is missing under your environment?


Best Regards,

Shanmukh.SS


0 Kudos
0serg
Beginner
715 Views

Hi,

I'm well aware that mkl_sequential.2.dll is part of MKL redistributables. But that's a separate back-end that gets activated with its own library that I did not select. When I pick TBB back-end for threading by choosing appropriate library, I expect that TBB backend will be used, not a sequential one. This works for Release TBB (it never tries to load either mkl_sequential or mkl_intel), but apparently does not work for Debug TBB. 

It would be also nice to see some explanations on what is the purpose of mkl_tbb_threadd_dll.lib and how to use it properly.

With best regards,
Sergei Ozerov

0 Kudos
ShanmukhS_Intel
Moderator
692 Views

Hi,


Could you please share us the sample reproducer and steps to be followed to reproduce(if any) so that we could look into your issue further and assist you.


Best Regards,

Shanmukh.SS


0 Kudos
ShanmukhS_Intel
Moderator
664 Views

Hi,


A gentle reminder:

Could you please provide us with a sample reproducer, so that we could work on your issue?


Best Regards,

Shanmukh.SS


0 Kudos
ShanmukhS_Intel
Moderator
635 Views

Hi,


We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Best Regards,

Shanmukh.SS


0 Kudos
Reply