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

VML crashes in DLL projects

w32
Beginner
522 Views
My custom DLL contains comuptation with VML functions call. MKL 9.0 is linked to DLL throw mkl_c.lib and libguide.lib.
But when app calls my DLL computation code, process is crached in any vml functions. Debuger shows exception (access violation) in TLS read code.

Example (vml code for cpu specific GetMode function):

mov ecx,dword ptr ds:[2CC31BCh] (this is __tls_index)
mov edx,dword ptr fs:[2Ch]
mov ebx,dword ptr [edx+ecx*4] (exception (ecx == 0 and edx == 0))


Can you help me?
0 Kudos
6 Replies
Andrey_N_Intel
Employee
522 Views

Thank you for your question. Could youlink your DLL to mkl_c_dll.lib? This should help. Please, let us know how it works for you.

0 Kudos
w32
Beginner
522 Views
Thanks, mkl_c_dll.lib resolves problem.

But now my DLL use dynamic MKL dlls and total size of application is very large (~40Mb). How can i decrease size?
0 Kudos
Andrey_N_Intel
Employee
522 Views
If your application contains calls to VML functions only you might want to link your DLL tomkl_vml_*.dll, msvcr71.dll,and libguide40.dll. Please, let's know how it works for you. Thanks.
0 Kudos
w32
Beginner
522 Views
No. My DLL uses some LAPACK funtions.
0 Kudos
Andrey_N_Intel
Employee
522 Views
You could link your application also to mkl_lapack32.dll or mkl_lapack64.dll (depending on the data type you use) in addition to the VML related dlls.
0 Kudos
w32
Beginner
522 Views
Thank you.
0 Kudos
Reply