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

Technical question - crash using MKL functions

lsheva
Beginner
755 Views

Hello,

I am trying to run my tester, which tests a dll using MKL libraries.

It works great on release mode, but on debug mode it crashes and screams Access Violation.

This is my call stack, if it can help in any way:

MyTester.exe!_mkl_blas_p4m_dgcopyan() + 0x15b bytesFortran
MyTester.exe!_mkl_blas_p4m_xdgemm() + 0x32a bytesC
MyTester.exe!_mkl_blas_p4m_dgemm() + 0xb89 bytesC
MyTester.exe!_mkl_blas_p4m_dtrsm() + 0x7ff bytesC
MyTester.exe!_mkl_blas_dgemm() + 0x56 bytesC

I would like to know if you have any idea what might cause it.

Maybe something in my configurations isnt set right.

I am using libguide40.lib, MKL 9.0

Thank you in advance,

Liad.

0 Kudos
7 Replies
TimP
Honored Contributor III
755 Views
Among the possibilities are that the data arrays you supply to DGEMM aren't large enough for the array size parameters you have given.
0 Kudos
lsheva
Beginner
755 Views

Hello again,

I debugged the code that I am testing (the sources of the dll), and saw the crash happens only after more than 2500 calls to the same code.

It crashes on a call to the dgetrf(...) function, which, as I asume, calls to dgemm(...) .

I tried to locate memory leaks before the crash, but I couldn't find any.

Is there anything you know about the impementation of the dgetrf(...) that may cause the stack look like it is in my previous message?

Thank you,

Liad.

0 Kudos
Andrey_G_Intel2
Employee
755 Views

Liad,

am I understand correctly what you are trying to build your own dll where MKL used?

With which MKL libraries you are linking your project?

Andrey

0 Kudos
lsheva
Beginner
755 Views

Hi Andrey,

I am trying to test my dll.

The dlluses mkl_c.lib and libguide40.lib, from MKL 9.0.

In the dll, the following files are included:

mkl_lapack.h,

mkl_vml.h, mkl_service.h

I have the dll sources so I can debug it.

I am not trying to build dll, I have a simple cpp file to allow me using the dll functions. (unit test)

It crashes inside one of the source files of the dll, exactly when I am calling the dgetrf(...) ( at the 2812th call ).

On the stack view, I see only a call to dgemm(...) and other MKL functions.

Thanks a lot,

Liad.

0 Kudos
Andrey_G_Intel2
Employee
755 Views

Liad,

in general, it`s prohibited to use statical MKL libraries in your own dll. Try to rebuild your dll with mkl_c_dll.lib library.

Andrey

0 Kudos
lsheva
Beginner
755 Views

Hi,

Ok, Thanks, I'll try it.

Meanwhile, I removed a frequent call to MKLFreeBuffers() , and changed it to one call at the ent of my tester.

For now it works fine, without any memory leaks or exceptions.

If you think there might be a problem with it - please let me know.

Thanks a lot for your help,

Liad.

0 Kudos
Andrey_G_Intel2
Employee
755 Views

In my best knowledge, some problems (memory leaks) in memory manager exists in MKL 9.0 and these problems were fixed in MKL 10.0 update 1.

You can try newes version of MKL.

Andrey

0 Kudos
Reply