[Numpy-discussion] Problems when using ACML with numpy
Thomas Unterthiner
thomas_unterthiner at web.de
Sat May 12 11:30:39 EDT 2012
On 05/12/2012 04:00 PM, Matthieu Brucher wrote:
> Does ACML now provide a CBLAS interface?
>
> Matthieu
D'oh!
Very good point, I wasn't aware that numpy needed a CLBAS interface. I
now followed the steps outlined at the end of
http://mail.scipy.org/pipermail/numpy-discussion/2006-February/018379.html
(Basically: I built a libcblas.a for ACML, then tried to build numpy
with that).
However it didn't seem to work. The same 5000x5000 matrix-multiply is
still spinning at 100% CPU usage. I attached to the process after I let
it run for over 3 minutes, and the stacktrace looked like this:
#0 DOUBLE_dot (ip1=<optimized out>, is1=8, ip2=
[...gibberish...], is2=40000, op=0x7f8633086000 "",
n=5000, __NPY_UNUSED_TAGGEDignore=0x23f40f0) at
numpy/core/src/multiarray/arraytypes.c.src:3077
#1 0x00007f864dea1466 in PyArray_MatrixProduct2 (op1=<optimized out>,
op2=<optimized out>, out=<optimized out>)
at numpy/core/src/multiarray/multiarraymodule.c:847
#2 0x00007f864dea18ed in array_matrixproduct
(__NPY_UNUSED_TAGGEDdummy=<optimized out>, args=<optimized out>,
kwds=<optimized out>) at
numpy/core/src/multiarray/multiarraymodule.c:2025
#3 0x000000000042a485 in PyEval_EvalFrameEx ()
#4 0x00000000004317f2 in PyEval_EvalCodeEx ()
#5 0x000000000054bd50 in PyRun_InteractiveOneFlags ()
#6 0x000000000054c045 in PyRun_InteractiveLoopFlags ()
#7 0x000000000054ce9f in Py_Main ()
#8 0x00007f864ec7976d in __libc_start_main () from
/lib/x86_64-linux-gnu/libc.so.6
#9 0x000000000041b931 in _start ()
So either the process needed changed since that message was written in
2006, or I did something wrong (I am absolutely unfamiliar with the
build-system used by numpy) or missed something :(
Thomas
>
> 2012/5/12 Thomas Unterthiner <thomas_unterthiner at web.de
> <mailto:thomas_unterthiner at web.de>>
>
>
> On 05/12/2012 03:27 PM, numpy-discussion-request at scipy.org
> <mailto:numpy-discussion-request at scipy.org> wrote:
> > 12.05.2012 00:54, Thomas Unterthiner kirjoitti:
> > [clip]
> >> > The process will have 100% CPU usage and will not show any
> activity
> >> > under strace. A gdb backtrace looks as follows:
> >> >
> >> > (gdb) bt
> >> > #0 0x00007fdcc000e524 in ?? ()
> >> > from
> /usr/lib/python2.7/dist-packages/numpy/core/multiarray.so
> > [clip]
> >
> > The backtrace looks like it does not use ACML. Does
> >
> > from numpy.core._dotblas import dot
> >
> > work?
> >
>
> Thanks for having a look at this. The following was tried with the
> numpy that comes from the Ubuntu repo and symlinked ACML:
>
>
> $ python
> Python 2.7.3 (default, Apr 20 2012, 22:39:59)
> [GCC 4.6.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from numpy.core._dotblas import dot
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: /usr/lib/python2.7/dist-packages/numpy/core/_dotblas.so:
> undefined symbol: cblas_cdotc_sub
> >>>
>
>
> Following up:
>
> $ ldd /usr/lib/python2.7/dist-packages/numpy/core/_dotblas.so
> linux-vdso.so.1 => (0x00007fff3de00000)
> libblas.so.3gf => /usr/lib/libblas.so.3gf (0x00007f10965f8000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1096238000)
> librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1
> (0x00007f1096030000)
> libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3
> (0x00007f1095d18000)
> libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1095a18000)
> /lib64/ld-linux-x86-64.so.2 (0x00007f1098a88000)
> libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> (0x00007f10957f8000)
> libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0
> (0x00007f10955c0000)
> $ ls -lh /usr/lib/libblas.so.3gf
> lrwxrwxrwx 1 root root 32 May 11 22:27 /usr/lib/libblas.so.3gf ->
> /etc/alternatives/libblas.so.3gf
> $ ls -lh /etc/alternatives/libblas.so.3gf
> lrwxrwxrwx 1 root root 45 May 11 22:36
> /etc/alternatives/libblas.so.3gf
> -> /opt/acml5.1.0/gfortran64_fma4/lib/libacml.so
>
>
>
> Cheers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120512/94b6a367/attachment.html>
More information about the NumPy-Discussion
mailing list