Skip to content
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

Pyplot segfaults and tries to access MKL libraries #165

Closed
Yurlungur opened this issue Sep 16, 2015 · 6 comments
Closed

Pyplot segfaults and tries to access MKL libraries #165

Yurlungur opened this issue Sep 16, 2015 · 6 comments

Comments

@Yurlungur
Copy link

Hello,

I built julia version 0.3.12 against MKL (on Ubuntu 14.04). When I try to use PyPlot I get segmentation faults indicating that mattplotlib (not built against MKL) is attempting to use MKL libraries. For example, the following code

using PyPlot
x = linspace(0,2*pi,100); y = sin(3*x);
plot(x,y)

results in

signal (11): Segmentation fault
mkl_blas_mc3_dgemm_mscale at /opt/intel/composer_xe_2015.3.187/mkl/lib/intel64/libmkl_mc3.so (unknown line)
mkl_blas_mc3_xdgemm at /opt/intel/composer_xe_2015.3.187/mkl/lib/intel64/libmkl_mc3.so (unknown line)
mkl_blas_dgemm_omp_driver_v1 at /opt/intel/composer_xe_2015.3.187/mkl/lib/intel64/libmkl_intel_thread.so (unknown line)
mkl_blas_dgemm_host at /opt/intel/composer_xe_2015.3.187/mkl/lib/intel64/libmkl_intel_thread.so (unknown line)
mkl_blas_dgemm at /opt/intel/composer_xe_2015.3.187/mkl/lib/intel64/libmkl_intel_thread.so (unknown line)
DGEMM at /opt/intel/composer_xe_2015.3.187/mkl/lib/intel64/libmkl_intel_ilp64.so (unknown line)
cblas_dgemm at /opt/intel/composer_xe_2015.3.187/mkl/lib/intel64/libmkl_intel_ilp64.so (unknown line)
unknown function (ip: 133921633)
PyEval_EvalFrameEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)  
PyEval_EvalCodeEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)  
PyEval_EvalFrameEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
PyEval_EvalCodeEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
unknown function (ip: 149735120)
PyObject_Call at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
PyObject_CallFunction at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
unknown function (ip: 148847149)
_PyObject_GenericSetAttrWithDict at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
PyObject_SetAttr at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
PyEval_EvalFrameEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
PyEval_EvalCodeEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
unknown function (ip: 149735333)  
PyObject_Call at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
unknown function (ip: 148654013)
PyObject_Call at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
unknown function (ip: 149149311)
unknown function (ip: 149141135)
PyObject_Call at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
PyEval_EvalFrameEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
PyEval_EvalCodeEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
unknown function (ip: 149735333)
PyObject_Call at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
PyEval_EvalFrameEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
PyEval_EvalCodeEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
unknown function (ip: 149735120)
PyObject_Call at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
pycall at /xfs1/jmiller/.julia/v0.3/PyCall/src/PyCall.jl:81
figure at /xfs1/jmiller/.julia/v0.3/PyPlot/src/PyPlot.jl:417
julia_figure_21601 at  (unknown line)
jl_apply at <invalid>:0
jl_apply at <invalid>:0
jl_Function_call at /xfs1/jmiller/.julia/v0.3/PyCall/src/callback.jl:36
PyObject_Call at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
unknown function (ip: 699438236)
Segmentation fault (core dumped)

Could this perhaps be related to this ticket? JuliaLang/julia#4923

Can anyone confirm that the issue is the problem? And if so, can anyone suggest a workaround? Thanks in advance!

@stevengj
Copy link
Member

Yes, I expect it is exactly the same thing. NumPy is expecting a BLAS library with an incompatible ABI.

The only solution for something like MKL where you can't rename the symbols is probably to try to build NumPy and Julia so that they link the same MKL.

I'm closing as this is not really a PyPlot issue per se.

@Yurlungur
Copy link
Author

Okay, thanks for your help.

@mes9
Copy link

mes9 commented Aug 17, 2016

I'm getting nearly the same issue and I'm not sure how to resolve it. Should I post a new issue or do you have any solution that worked for you? My version info:
Julia Version 0.4.6
Commit 2e358ce* (2016-06-19 17:16 UTC)
Platform Info:
System: Linux (x86_64-redhat-linux)
CPU: Intel(R) Xeon(R) CPU X5660 @ 2.80GHz
WORD_SIZE: 64
BLAS: libmkl_rt
LAPACK: libmkl_rt
LIBM: libimf
LLVM: libLLVM-3.3

@stevengj
Copy link
Member

stevengj commented Aug 17, 2016

@mes9, you may need to use a different version of NumPy that is not linked against MKL.

The easiest solution, if the problem is the Python libraries, is to use Conda: do ENV["PYTHON"]=""; Pkg.build("PyCall") to reconfigure PyCall to use its own miniconda installation via Conda (you only need to do this once). Then run using PyPlot as usual.

@stevengj
Copy link
Member

stevengj commented Aug 17, 2016

Or, if your problem is like the original poster's and originates from a custom Julia build, you should instead use a version of Julia that is not linked to MKL. (This only applies if you are using a custom Julia build ... just switch to the standard Julia binaries.)

@mes9
Copy link

mes9 commented Aug 18, 2016

The problem was the custom build! I removed julia and reinstalled and everything works now
Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants