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

Pardiso Crash in MKL 2017

schulzey
New Contributor I
2,927 Views

After upgrading to MKL 2017 (as part of the 2017 Intel Fortran compiler for Windows) I get a Pardiso crash when calling it to solve a simple matrix. The crash doesn't happen in MKL 11.3.4 or in any other earlier versions.

I have created a test example that demonstrates the crash (see attachment). The data that gets passed to Pardiso (which is normally generated by my application) is read from a file in my test example which is also attached. The test example runs Ok in MKL 11.3.4 and earlier versions but crashes in MKL 2017.

I have been using Pardiso successfully for many years and don't think I am doing anything wrong.

Peter

0 Kudos
37 Replies
Alexander_K_Intel2
980 Views

Hi,

Could you set "Use Intel Math Kernel Library" from VS4.png to "No" and rerun test on non-default libraries?

Thanks,

Alex

0 Kudos
schulzey
New Contributor I
980 Views

With "Use Intel Math Kernel Library" set to "No" I get "unresolved external" errors for the Pardiso calls at link time. If I set it to "Sequential" then it compiles, links and runs Ok with all versions of MKL, but that is no good for me because it runs too slow. I need to be able to use "Parallel".

Regards,
Peter
 

0 Kudos
Alexander_K_Intel2
980 Views

Peter,

I've found in this paper ( https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-compiling-and-linking-with-microsoft-visual-cc ), how to link mkl manually. When "Use Intel MKL" flag set to "yes" you link with default library. Add additional path with mkl libraries could shuffle different version of mkl and cause mentioned error. Could you set flag to "no" using article below link to mkl manually to prevent suck kind of issue?

Thanks,

Alex

0 Kudos
schulzey
New Contributor I
980 Views

I don't understand why you want me to use a non-default version of MKL. This is not the problem. The problem is that if I use the default MKL 2017 then my test program crashes. It is a problem in MKL 2017.

0 Kudos
Zhen_Z_Intel
Employee
980 Views

Hi Peter,

I've tested your project with MKL 2017, ifort 17.0 in VS 2015, there's no any crash. And I could get result txt file. I pasted below. I could not reproduce your problem. Have you ever integrated in other version of visual studio & tested it? Please have a check with attached files to see if there's some place different to your settings. Thank you.

Best regards,
Fiona

0 Kudos
schulzey
New Contributor I
980 Views

Hi Fiona,

​All of my settings matched yours except for a couple in the command line and so I have added /warn:noalignments, /align:rec1byte and /fp:strict, but it still crashes. See the attached images for my latest settings.

1.  I can't see how to set /Qm64 in Visual Studio to match yours. Where do I go in VS to set this?

​2.  The only other difference I can see is that in your command line there is a mention of amd64 which I don't have. Could this have an affect on the problem?

3.  I am also curious as to why some of your compiler settings appear under "Additional Option" whereas all of mine are in the top section under "All options". Would this affect anything?

The bottom line is that the problem only occurs in MKL 11.3.4 and MKL 2017. All older versions work for me and so something has changed.

Regards,
Peter
 

0 Kudos
Ying_H_Intel
Employee
980 Views

Hi Peter,

I can't reproduce the crash too with the project you attached in #12.  But I guess the problem in VS path and the mix of multiply version of MKL/ifort.

Could you please try

1) switch the static link and let us know if it works

Runtime library =>  Multithreaded

the option is just above the option  "Use Intel Math Kernel Library" set to "Parallel".

2) with your crashed the project, please open the option  and attach the result to us.

Linker =>  Generel => Show progress =  > Display Some Progress Messages (/VERBOSE:LIB)

Best Regards,

Ying

0 Kudos
schulzey
New Contributor I
980 Views

Hi Ying,

​I changed the Runtime Library setting from Multithread DLL (the default) to Multithreaded, but my test program still crashes when I run it.

See the attached BuildLog.

By the way, Gennady was able to replicate the problem (see post #16).

​Regards,
Peter
 

0 Kudos
Ying_H_Intel
Employee
980 Views

Hi Peter,

Thank for the test. I will check it with Gennady.

The static link excluded the wrong MKL library. Only one concern is about OpenMP library libiomp5md.dll. (we run another issue about Visual Fortran https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/702230, the root cause was located to libiomp5md.dll)

Could you please upload the *.exe (crashed) --> change the name to PNG.  or show the  Dependency walker result as the figure in https://software.intel.com/en-us/articles/some-more-additional-tips-how-to-call-mkl-from-your-c-code/

Best Regards,

Ying

 

0 Kudos
schulzey
New Contributor I
980 Views

Hi Ying,

I have now noticed that the project compiled with Runtime Library = "Multithreaded" runs sometimes and crashes sometimes. If I run it multiple times it works about 50% of the time. The project compiled with Runtime Library = "Multithread DLL" crashes all of the time. Maybe this is a clue.

I have uploaded both of them. Please rename the uploaded PNG files to ZIP.

Regards,
Peter

 

 

0 Kudos
Ying_H_Intel
Employee
980 Views

Hi Peter, 

Just let you know, i had downloaded the two exe.  be able to run them well on several machines .  The DLL version even worked with any version of MKL (MKL 11.1.3 at one of my machine), and Static version was exactly 2017.0 version. 

As you know, MKL 2017 update 1 released. if with MKL 2017 update1, the DLL code run ok?

Best Regards,

Ying 

Here is Dependency walker result.

The DLL version will depend on Intel Compiler run-time library and libiomp5md.dll, it maybe any version (even 32bit, it can run on my machine). what version on your machine?

I run the C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.0.109\windows\mkl\bin\mklvars.sh intel64, get below. 

DLL.png

for static version, it seems only depends on the libiomp5md.dll 

staticMT.png

0 Kudos
schulzey
New Contributor I
980 Views

Yes, it crashes in MKL 2017 update 1 too.

I have just run the PardisoTest program on eight computers in our office. It works on all the desktops but crashes on all the laptops. If you have been running it on a desktop can you please try it on a laptop?

It looks like the problem might be in one of the MKL DLLs that is only used for mobile processors.

The laptops that the test crashed on are as follows:
ASUS R550C with i7-3537U (2.0GHz) running Windows 10 Pro
Apple MacBookPro10,2 with i5-3210M (2.5GHz) running Windows 10 Home
ASUS R505C with i7-3537U (2.0GHz) running Windows 10 Home

I need to get this fixed because MKL 2017 is unusable for me. My test problem is just one example of the crash. I have many other sets of data that crash it too in the same way. They all crash consistently with MKL 2017 and 11.3.4 but not with earlier versions. Something is wrong.

0 Kudos
Gennady_F_Intel
Moderator
980 Views

Please have a look at the your file ( PardisoTestSub.for ) which was slightly modified by MKL Pardiso developers with the follow comments: "Customer forgot to add include of mkl_pardiso and set 2 dimensional arrays that have not support in interface of pardiso fi. Fixed file in attach, after modification test passed correctly"

 

0 Kudos
schulzey
New Contributor I
980 Views

Thanks Gennady,

I have replaced my PardisoTestSub.for with the one you provided in your last post and it works !!!

But then I noticed that you have set phase=11 (analyse). If I set it back to phase=13 (analyse, factorize and solve) it crashes again. I then separated it into three separate Pardiso calls with phase=11 (analyse), phase=22 (factorize) and phase=33 (solve), and found that it crashes on the phase=22 call. Can you replicate this?

Note that the problem only occurs if I compile it in Visual Studio (seems to work if I compile using a command line). It also only seems to occur if I run the test program on laptops.

​I have attached my complete Visual Studio project which includes your PardisoTestSub.for but with phase changed to 13 (that's the only change).

Regards,
Peter
 

0 Kudos
Gennady_F_Intel
Moderator
980 Views

I don't see problem on my side. I use the same VS2013 solution, 64 bit, Release or Debug modes, serial and parallel linking : explicitly or via setting use MKL Parallel (/Qmkl:parallel) or Sequential (/Qmkl:sequential)

I only printed the vector solution 

phase ==13,

           1   x()=  0.000000000000000E+000
           2   x()= -1.130282459811014E-003
           3   x()=  3.526077288086773E-003
           4   x()= -3.592627831828858E-005
           5   x()=  0.000000000000000E+000
           6   x()=  0.000000000000000E+000
           7   x()=  0.000000000000000E+000
           8   x()= -5.602969108473849E-004
           9   x()=  2.777262958946297E-003

          .....................................................

          63   x()=  5.602968956403434E-004
          64   x()=  0.000000000000000E+000
          65   x()=  1.130282444603406E-003

         Intel(R) Math Kernel Library Version 2017.0.1 Product Build 20161005 for Intel(R) 64 architecture applications                                                                                                                                                  

 

0 Kudos
schulzey
New Contributor I
980 Views

Have you tried running the test program on a laptop or two?

Could the fact that you are using vs2013 and not vs2015 be the issue?

This is very frustrating

0 Kudos
schulzey
New Contributor I
980 Views

Hi Gennady,

I just noticed in your latest post that you are running 2017.0.1 whereas I have been running 2017.0.0. I have just tried it in 2017.0.1 and it appears to be working!!

​It still crashes if I go back to 2017.0.0 and so it must be something that was fixed, although I can't see anything relevant in the release notes.

​Thanks for your help and apologies if I led you astray.

Regards,
Peter

0 Kudos
Reply