[PyCUDA] SparseSolve.py example

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[PyCUDA] SparseSolve.py example

elafrit
Hello - I'm trying to run the SparseSolve.py example. I installed PyMetis  package after fixing the configuration like here :

./configure --python-exe=python2.6 --boost-inc-dir=/usr/include/boost --boost-lib-dir=/usr/lib/ --boost-python-libname=boost_python-mt-py26

But when running the SparseSolve.py example I encountred this error :

ImportError: /usr/local/lib/python2.6/dist-packages/PyMetis-0.91-py2.6-linux-x86_64.egg/pymetis/_internal.so: undefined symbol: regerrorA

What does this error means? thanks for any suggestions.
Reply | Threaded
Open this post in threaded view
|

Re: SparseSolve.py example

Andreas Kloeckner
Hi Marie,

I think I've seen this error before. I've quoted the relevant bit from
my reply to Dave Reynolds below.

On Fri, 28 Jan 2011 05:03:43 -0800 (PST), elafrit <[hidden email]> wrote:

>
> Hello - I'm trying to run the SparseSolve.py example. I installed PyMetis
> package after fixing the configuration like here :
>
> ./configure --python-exe=python2.6 --boost-inc-dir=/usr/include/boost
> --boost-lib-dir=/usr/lib/ --boost-python-libname=boost_python-mt-py26
>
> But when running the SparseSolve.py example I encountred this error :
>
> ImportError:
> /usr/local/lib/python2.6/dist-packages/PyMetis-0.91-py2.6-linux-x86_64.egg/pymetis/_internal.so:
> undefined symbol: regerrorA
>
> What does this error means? thanks for any suggestions.
-----------------------------------------------------------------------------
On Wed, 28 Jul 2010 14:08:22 +1000, Dave Reynolds <[hidden email]> wrote:
> I am running Ubuntu 9.10, nearly pristine install besides all this
> PyCuda/boost stuff. Heres what I got back from the command line:
>
> $ nm -D /lib/libc.so.6| grep regerror
> 000b74c0 W regerror
>
> I don't know what C library I'm using, whatever comes with vanilla Ubuntu I
> guess? I haven't done anything strange if that helps.

Here's a guess at what's going on: You're including one level too many
of the boost include files in your compile configuration. Then, when
some part (include file) of metis asks for regex.h, they get Boost's
boost/regex.h instead of the system-wide regex.h, which does this:

#define regerror regerrorA

See [1] for more information.

[1] http://www.boost.org/doc/libs/1_43_0/libs/regex/doc/html/boost_regex/ref/posix.html
-----------------------------------------------------------------------------

Hope this helps,
Andreas

_______________________________________________
PyCUDA mailing list
[hidden email]
http://lists.tiker.net/listinfo/pycuda

attachment0 (195 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SparseSolve.py example

elafrit
Hi Andreas,

Thank you, the problem was as you said. When configuring I was including too many of the boost include files...

But now, a new problem appears when running the SparseSolve.py :

TypeError: No registered converter was able to produce a C++ rvalue of type int from this Python object of type numpy.int32
Reply | Threaded
Open this post in threaded view
|

Re: SparseSolve.py example

Andreas Kloeckner
Hi,

On Mon, 31 Jan 2011 01:31:28 -0800 (PST), elafrit <[hidden email]> wrote:
> TypeError: No registered converter was able to produce a C++ rvalue of type
> int from this Python object of type numpy.int32

Can you please send the full traceback? Otherwise it's hard to see where
this is happening. Thanks!

Andreas

_______________________________________________
PyCUDA mailing list
[hidden email]
http://lists.tiker.net/listinfo/pycuda

attachment0 (195 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SparseSolve.py example

elafrit
Hi,

The traceback was :

starting...
building...
Traceback (most recent call last):
  File "SparseSolve.py", line 85, in <module>
    main_cg()
  File "SparseSolve.py", line 32, in main_cg
    spmv = PacketedSpMV(csr_mat, options.is_symmetric, csr_mat.dtype)
  File "/usr/local/lib/python2.6/dist-packages/pycuda-2011.1-py2.6-linux-x86_64.egg/pycuda/sparse/packeted.py", line 124, in __init__
    xadj=adj_mat.indptr, adjncy=adj_mat.indices)
  File "/usr/local/lib/python2.6/dist-packages/PyMetis-0.91-py2.6-linux-x86_64.egg/pymetis/__init__.py", line 49, in part_graph
    return part_graph(nparts, xadj, adjncy, vweights, eweights, recursive)
TypeError: No registered converter was able to produce a C++ rvalue of type int from this Python object of type numpy.int32


Thanks
Reply | Threaded
Open this post in threaded view
|

Re: SparseSolve.py example

Andreas Kloeckner
Hi there,

On Tue, 1 Feb 2011 04:37:32 -0800 (PST), elafrit <[hidden email]> wrote:

> starting...
> building...
> Traceback (most recent call last):
>   File "SparseSolve.py", line 85, in <module>
>     main_cg()
>   File "SparseSolve.py", line 32, in main_cg
>     spmv = PacketedSpMV(csr_mat, options.is_symmetric, csr_mat.dtype)
>   File
> "/usr/local/lib/python2.6/dist-packages/pycuda-2011.1-py2.6-linux-x86_64.egg/pycuda/sparse/packeted.py",
> line 124, in __init__
>     xadj=adj_mat.indptr, adjncy=adj_mat.indices)
>   File
> "/usr/local/lib/python2.6/dist-packages/PyMetis-0.91-py2.6-linux-x86_64.egg/pymetis/__init__.py",
> line 49, in part_graph
>     return part_graph(nparts, xadj, adjncy, vweights, eweights, recursive)
> TypeError: No registered converter was able to produce a C++ rvalue of type
> int from this Python object of type numpy.int32
I think I've committed a simple fix for this to git. Can you try current
git and report back?

Thanks,
Andreas


_______________________________________________
PyCUDA mailing list
[hidden email]
http://lists.tiker.net/listinfo/pycuda

attachment0 (195 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SparseSolve.py example

elafrit
Hi,

I tried the current git but there is always the same error :

>python SparseSolve.py 5pt_10x10.mtx
starting...
building...
Traceback (most recent call last):
  File "SparseSolve.py", line 85, in <module>
    main_cg()
  File "SparseSolve.py", line 32, in main_cg
    spmv = PacketedSpMV(csr_mat, options.is_symmetric, csr_mat.dtype)
  File "/usr/local/lib/python2.6/dist-packages/pycuda-2011.1-py2.6-linux-x86_64.egg/pycuda/sparse/packeted.py", line 124, in __init__
    xadj=adj_mat.indptr, adjncy=adj_mat.indices)
  File "/usr/local/lib/python2.6/dist-packages/PyMetis-0.91-py2.6-linux-x86_64.egg/pymetis/__init__.py", line 49, in part_graph
    return part_graph(nparts, xadj, adjncy, vweights, eweights, recursive)
TypeError: No registered converter was able to produce a C++ rvalue of type int from this Python object of type numpy.int32

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: SparseSolve.py example

elafrit
In reply to this post by Andreas Kloeckner
Hi Andreas,

In fact I'm trying to construct a sparse matrix on GPU using PyCUDA. And to do multiplication of two sparse matrices. Do you have any idea ?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: SparseSolve.py example

Andreas Kloeckner
On Thu, 3 Feb 2011 02:47:16 -0800 (PST), elafrit <[hidden email]> wrote:
>
> Hi Andreas,
>
> In fact I'm trying to construct a sparse matrix on GPU using PyCUDA. And to
> do multiplication of two sparse matrices. Do you have any idea ?

The current code will not help you do either of those two things. If the
sparsity pattern is constant, part 1 should be fairly easy, but part 2
is rather complicated because it produces a data structure of unknown
size.

HTH,
Andreas

_______________________________________________
PyCUDA mailing list
[hidden email]
http://lists.tiker.net/listinfo/pycuda

attachment0 (195 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SparseSolve.py example

Eric Carlson
In reply to this post by Andreas Kloeckner
On 2/1/2011 9:54 AM, Andreas Kloeckner wrote:

> Hi there,
>
> On Tue, 1 Feb 2011 04:37:32 -0800 (PST), elafrit<[hidden email]>  wrote:
>> starting...
>> building...
>> Traceback (most recent call last):
>>    File "SparseSolve.py", line 85, in<module>
>>      main_cg()
>>    File "SparseSolve.py", line 32, in main_cg
>>      spmv = PacketedSpMV(csr_mat, options.is_symmetric, csr_mat.dtype)
>>    File
>> "/usr/local/lib/python2.6/dist-packages/pycuda-2011.1-py2.6-linux-x86_64.egg/pycuda/sparse/packeted.py",
>> line 124, in __init__
>>      xadj=adj_mat.indptr, adjncy=adj_mat.indices)
>>    File
>> "/usr/local/lib/python2.6/dist-packages/PyMetis-0.91-py2.6-linux-x86_64.egg/pymetis/__init__.py",
>> line 49, in part_graph
>>      return part_graph(nparts, xadj, adjncy, vweights, eweights, recursive)
>> TypeError: No registered converter was able to produce a C++ rvalue of type
>> int from this Python object of type numpy.int32
>
> I think I've committed a simple fix for this to git. Can you try current
> git and report back?
>
> Thanks,
> Andreas
>
>
Hello Andreas,
Which of the projects do I need to "git" - PyMetis or PyCuda or ...?

Cheers,
Eric Carlson




_______________________________________________
PyCUDA mailing list
[hidden email]
http://lists.tiker.net/listinfo/pycuda
Reply | Threaded
Open this post in threaded view
|

Re: SparseSolve.py example

Andreas Kloeckner
Hi Eric,

On Sat, 26 Feb 2011 07:11:32 -0600, Eric Carlson <[hidden email]> wrote:
> > I think I've committed a simple fix for this to git. Can you try current
> > git and report back?
> >
> > Thanks,
> > Andreas
> >
> >
> Hello Andreas,
> Which of the projects do I need to "git" - PyMetis or PyCuda or ...?

PyCUDA commit 0cbe5da4845db2817087ce75f2a24cd7e279f114 contains the fix.

Andreas

_______________________________________________
PyCUDA mailing list
[hidden email]
http://lists.tiker.net/listinfo/pycuda

attachment0 (195 bytes) Download Attachment