Matlab crushes when trying to run java code that contains function calls to JBLAS
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a Java code that uses JBLAS for matrix computations and in Java side everything runs fine. However for debugging purposes, visualization etc., I pack the java code to jar-file and run It from Matlab. Everything works fine until the program reaches code that uses JBLAS. First I get errors like "Intel MKL ERROR: Parameter 3 was incorrect on entry to DGEMM", but this does not yet crush Matlab. However when the code reaches a function call to JBLAS routine Solve.pinv() the Matlab crushes. In terminal I got message like
"# A fatal error has been detected by the Java Runtime Environment: # Internal Error (safepoint.cpp:687), pid=7302, tid=140358050563840 # fatal error: Deadlock in safepoint code. Should have called back to the VM before blocking. #"
In hs_error_xxx.log file I see traces from JBLAS pinv method to NativeBlas.dgelsd method. I think the problem may be related to dynamic linking of lapack-libraries, but not sure??
1 commentaire
Kirby Fears
le 3 Déc 2015
Focus on the original error: First I get errors like "Intel MKL ERROR: Parameter 3 was incorrect on entry to DGEMM"
Can you identify what Parameter 3 is? You may be passing a Matlab data type into Java which cannot be handled.
Réponse acceptée
Rutuja Shirali
le 7 Déc 2015
Hi Vili,
MATLAB's BLAS and LAPACK libraries differ in one important way from many other BLAS/LAPACK libraries: we use 64-bit integers wherever the functions expect integers whereas most other implementations still use 32-bit integers (even on 64-bit systems). If your library which probably works with 32-bit integers then calls our BLAS/LAPACK implementations which expect to see 64-bit integers, MATLAB may very well crash.
Luckily MATLAB is also able to work with other BLAS/LAPACK implementations though, even ones which work with 32-bit integers. So what you could try to do to work around this issue, is make MATLAB use your system's BLAS and LAPACK implementations. To do so you would need to point the BLAS_VERSION and LAPACK_VERSION environment variables to those other implementations.And then start MATLAB from this same shell. Once inside MATLAB you can use:
version -lapack
And:
version -blas
To verify that MATLAB is indeed using a different implementation (i.e. these should no longer return "Intel® Math Kernel Library Version....").
Note, you always need to change both the LAPACK and BLAS implementation, changing only one of them will cause crashes in MATLAB when performing matrix and vector operations.
I hope this helps resolving the crash. If this was not the issue, please raise a help ticket with the MathWokrs Technical Support Department along with the crash dump to help understand the issue better.
-Rutuja
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!