On Fri, 17 Jun 2011 14:41:50 -0700 (PDT), Angus Hendrick <angus.hendrick(a)gmail.com>
I get the following error on my Ubuntu 10.10 box for
example from the wiki:
SparseSolve.py:28: RuntimeWarning: divide by zero encountered in true_divide
inv_mat_diag = 1/csr_mat.diagonal()
Traceback (most recent call last):
File "SparseSolve.py", line 85, in <module>
File "SparseSolve.py", line 32, in main_cg
spmv = PacketedSpMV(csr_mat, options.is_symmetric, csr_mat.dtype)
line 179, in __init__
from pkt_build import build_pkt_data_structure
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.