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

Crash in Multi-Process Environment When Using MKL-Linked Dynamic Library with Frequent USB

Se5
Beginner
217 Views

Environment: Windows 10/11 Visual Studio 2017 C++ Intel MKL Library (version 2018.3.210)

Problem Description: We have a dynamic library (esp.dll) that performs Fourier transforms (FFT) and other matrix operations using Intel MKL.

Initially, we observed crashes during FFT computations when frequently hot-plugging USB drives while calling esp.dll.

The error pointed to mkl_avx2_unload_dll.

My colleague suggested explicitly releasing MKL-related DLLs via the following code:

vector libs = { "mkl_core", "libiomp5md", "mkl_def", "mkl_intel_thread", "mkl_avx2.dll", "mkl_vml_avx2.dll" };

for (int index = 0; index < libs.size(); index++)

{

auto libHandle = GetModuleHandle(libs[index].c_str());

if (libHandle)

{ BOOL rev = FreeLibrary(libHandle); libHandle = NULL; }

} This resolved the USB-related crashes.

New Issue: However, after implementing this fix, crashes now occur when two processes simultaneously call esp.dll. The error manifests during FFT operations, similar to the previous case.

0 Kudos
0 Replies
Reply