Recurring Problem with Cython & SparseSolve.py

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

Recurring Problem with Cython & SparseSolve.py

Angus Hendrick
I get the following error on my Ubuntu 10.10 box for the SparseSolve.py example from the wiki:

angus@bleeder:~/src/python/pycuda-0.94.2/examples/wiki-examples$ python SparseSolve.py e05r0000.mtx
starting...
SparseSolve.py:28: RuntimeWarning: divide by zero encountered in true_divide
  inv_mat_diag = 1/csr_mat.diagonal()
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-0.94.2-py2.6-linux-x86_64.egg/pycuda/sparse/packeted.py", line 179, in __init__
    from pkt_build import build_pkt_data_structure
  File "/usr/local/lib/python2.6/dist-packages/pycuda-0.94.2-py2.6-linux-x86_64.egg/pycuda/sparse/pkt_build.py", line 75, in <module>
    from pkt_build_cython import build_pkt_data_structure
ImportError: No module named pkt_build_cython

I found this error in the archives a couple months back and the recommendation was to install Cython.  However, I have Cython installed and I still get the error.  I'm running the 4.0.17 version of the CUDA toolkit.  Several other PyCUDA examples work fine, as do the cuda examples that come with the SDK.

On a related note, I'm assuming the sparse-solver only works with symmetric positive-definite matrices (as it's labeled a cg solver).  Do you know of any PyCUDA development that will solve general sparse matrices?  
Reply | Threaded
Open this post in threaded view
|

Re: Recurring Problem with Cython & SparseSolve.py

Andreas Kloeckner
Hi Angus,

On Fri, 17 Jun 2011 14:41:50 -0700 (PDT), Angus Hendrick <[hidden email]> wrote:

> I get the following error on my Ubuntu 10.10 box for the SparseSolve.py
> example from the wiki:
>
> angus@bleeder:~/src/python/pycuda-0.94.2/examples/wiki-examples$ python
> SparseSolve.py e05r0000.mtx
> starting...
> SparseSolve.py:28: RuntimeWarning: divide by zero encountered in true_divide
>   inv_mat_diag = 1/csr_mat.diagonal()
> 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-0.94.2-py2.6-linux-x86_64.egg/pycuda/sparse/packeted.py",
> line 179, in __init__
>     from pkt_build import build_pkt_data_structure
>   File
> "/usr/local/lib/python2.6/dist-packages/pycuda-0.94.2-py2.6-linux-x86_64.egg/pycuda/sparse/pkt_build.py",
> line 75, in <module>
>     from pkt_build_cython import build_pkt_data_structure
> ImportError: No module named pkt_build_cython
>
> I found this error in the archives a couple months back and the
> recommendation was to install Cython.  However, I have Cython installed and
> I still get the error.  I'm running the 4.0.17 version of the CUDA toolkit.
> Several other PyCUDA examples work fine, as do the cuda examples that come
> with the SDK.
Sorry for the long delay in replying. I can't reproduce your issue, even
with recent versions of cython. The issue is that pyximport (a module
that lets you directly import .pyx cython modules) installs successfully
on your machine, but then fails to find such a module. I've made a
change to the line that fails for you in git. That change doesn't make a
difference for me, but it might for you. Please let me know if you've
had more success with that.

> On a related note, I'm assuming the sparse-solver only works with symmetric
> positive-definite matrices (as it's labeled a cg solver).  Do you know of
> any PyCUDA development that will solve general sparse matrices?  

Right--for now there's a CG solver there. But there's (almost) nothing
GPU-specific about that solver, so porting others (such as BiCGstab or
GMRES) should be straightforward--many such codes can be stolen and then
adapted from scipy.

HTH,
Andreas


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

attachment0 (195 bytes) Download Attachment