-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault with Julia MKL build (library conflict) #443
Comments
... reference for anyone having a similar problem. I finally found a workaround that might point to where the problem is. If I downgrade just conda's mkl (using Remark 1: I was only seeing the segfault with Julia compiled with MKL for BLAS and FFT (and using PyCall set to my local anaconda3 install). The downgrade of conda's mkl fixes things so it makes me wonder if there is some mkl interaction with the Julia and conda (??) Remark 2: running Remark 3: The only reason I took a stab at downgrading conda's mkl is that I happened to read this... just for reference to those who know more about this stuff. |
Probably Julia and NumPy are linked to incompatible versions of MKL .... there's not much to do about this either than (a) make sure they use the same MKL versions or (b) don't use MKL in one or both of them (e.g. switch one to use OpenBLAS). |
Yeah, although I'm not sure I understand why NumPy is reaching out to the MKL library Julia is linked to, e.g. when I compile Julia with OpenBLAS, NumPy has no problem calling it's own MKL. Anyway, I've got a working solution now and hopefully the MKL incompatibility will work itself out as I NumPy updates it's MKL ... so I'm fine with closing this. Thanks! |
When Julia is compiled with OpenBLAS, all of the BLAS symbols have a special suffix so that they don't conflict with other BLAS libraries (JuliaLang/julia#8734). We can't (easily) do this with MKL because we don't compile MKL ourselves. |
See also #65. |
I'm getting the same sort of segfault problem in mkl as soon as I try to use PyPlot, signal (11): Segmentation fault line 59 is the first call to figure() within PyPlot. As a result I have a broken PyCall. I'm going to try the non MKL version since the MKL version of juliapro-0.6.2.2 is not working for me. |
@stevengj Has it been verified that linking NumPy and Julia to the same MKL libraries works smoothly? Because I just tried exactly this and still get Seg faults. (I built Julia and linked it against my manually installed MKL. I built numpy and linked it against the same MKL installation (specified the path in site.cfg and verified it afterwards in python shell).) |
@crstnbr, doesn't Julia link the ILP64 MKL interface by default, whereas numpy uses the LP64 interface (numpy/numpy#5906)? I think you probably need to compile Julia with |
@crstnbr I had your exact problem - same MKL lib used in numpy as was used to compile julia, but segfault with:
even though the same code worked in Python (i.e. the version of Python that It now seems to be fixed by adding Thanks @stevengj ! |
Oh and the other thing I had to do earlier was add the directory that has libiomp5.so on my LD_LIBRARY_PATH, the path was different to the mkl path, with something like
in my ~/.profile |
Can the ABI incompatibility be detected before segfault? Does Julia have runtime access for the build option I guess we can at least run Julia subprocess at build time and run Numpy operation that is known to segfault for incompatible ABI. But it's not a great option as Numpy can be updated at any moment. Also, numpy in virtualenv #578 cannot be supported this way. |
@JobJob: Thanks for your post! I can confirm that However, I can't find much information on what |
@crstnbr, (The reason for this mess is that the BLAS interface was defined to use |
And Numpy uses the 32-bit integers (LP64), whereas Julia without I saw you linked this issue somewhere numpy/numpy#5906 - oh just above :D, got a bit lost in the nest of related issues I waded through while trying to solve this. |
@stevengj , Regarding your saying:
What about Sparse Matrix? In that case, how do we count the elements? As the number of non zero elements or the size of the Matrix? |
Sparse matrices aren't handled by LAPACK/BLAS but SuiteSparse, so they shouldn't be effected by this. In the case of a regular matrix, it's the size of the matrix that matters. (Please correct me if I'm wrong.) |
Hi guys. I also face this problem. Can anyone tell me how to set USE_BLAS64 = 0? I just have very limited programming knowledge and I am new to julia. Thanks. |
Easy solution should be to use Julia 1.7 (beta) and MKL.jl. |
With a recent upgrade of anaconda I'm getting seg faults with PyCall (and PyPlot). Reading the other recent issues it appears some are having the same problem but my output is a bit different and the workarounds for those don't seem to be helping any. Hope I'm not adding noise to something that is already known.
If I run the code from 6423 I just get a straight seg fault.
calling directly from python works fine.
I've tried to work around it with what appears to work for some people. However I'm still getting seg faults. In particular, I tried the following without success.
Any ideas what is going on here?
Some possibly relevant info:
The text was updated successfully, but these errors were encountered: