pyculib icon indicating copy to clipboard operation
pyculib copied to clipboard

Initialization of pyculib.sparse.Sparse( ) fail

Open ghost opened this issue 7 years ago • 2 comments

Hi, I have pyculib version 1.02 installed within Anaconda 5.3, on linux x86_64. However, the Sparse( ) fails to initialize. Below are the error messages. Thanks for any help you can offer!

In [1]: import pyculib                                                          

In [2]: pyculib.__version__                                                     
Out[2]: '1.0.2+2.g7ae9662'

In [3]: pyculib.sparse.Sparse( )                                                
---------------------------------------------------------------------------
CuSparseError                             Traceback (most recent call last)
~/mylib/anaconda_5.3/lib/python3.6/site-packages/pyculib/sparse/binding.py in __init__(self)
    225         try:
--> 226             self._api.cusparseCreate(byref(self._handle))
    227         except CuSparseError:

~/mylib/anaconda_5.3/lib/python3.6/site-packages/pyculib/utils/libutils.py in wrapped(*args, **kws)
     47             status = fn(*args, **kws)
---> 48             self.check_error(status)
     49             return status

~/mylib/anaconda_5.3/lib/python3.6/site-packages/pyculib/utils/libutils.py in check_error(self, status)
     53         if status != 0:
---> 54             raise self.ErrorType(status)
     55 

CuSparseError: CUSPARSE_STATUS_NOT_INITIALIZED

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
<ipython-input-3-32f27b5fc5e6> in <module>
----> 1 pyculib.sparse.Sparse( )

~/mylib/anaconda_5.3/lib/python3.6/site-packages/numba/cuda/cudadrv/devices.py in _require_cuda_context(*args, **kws)
    210     def _require_cuda_context(*args, **kws):
    211         get_context()
--> 212         return fn(*args, **kws)
    213 
    214     return _require_cuda_context

~/mylib/anaconda_5.3/lib/python3.6/site-packages/pyculib/sparse/api.py in __init__(self, idxbase)
     68             raise ValueError("Invalid index base")
     69 
---> 70         self.api = cuSparse()
     71         self.idxbase = (CUSPARSE_INDEX_BASE_ZERO,
     72                         CUSPARSE_INDEX_BASE_ONE)[idxbase]

~/mylib/anaconda_5.3/lib/python3.6/site-packages/pyculib/sparse/binding.py in __init__(self)
    226             self._api.cusparseCreate(byref(self._handle))
    227         except CuSparseError:
--> 228             raise RuntimeError("Cannot initialize cuSparse. "
    229                                "Could be caused by insufficient GPU memory.")
    230         self._finalizer_track((self._handle, self._api))

RuntimeError: Cannot initialize cuSparse. Could be caused by insufficient GPU memory.

In [4]:                                                                         

ghost avatar Oct 08 '18 01:10 ghost

It also fails for me...

$ conda info
     active environment : None
       user config file : /home/matthieu/.condarc
 populated config files : /home/matthieu/.condarc
          conda version : 4.5.12
    conda-build version : 3.0.27
         python version : 3.6.8.final.0
                    ...
               platform : linux-64
             user-agent : conda/4.5.12 requests/2.18.4 CPython/3.6.8 Linux/4.4.0-141-generic ubuntu/16.04 glibc/2.23
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

I have the same version of pyculib: 1.0.2+2.g7ae9662 Anyone has an idea of what could be happening ?

matthieuheitz avatar Jan 04 '19 19:01 matthieuheitz

I figured it out. On my system, CUDA 8.0 is installed, but when I did conda install pyculib, it installed cudatoolkit 9.2. Like said here, I thought it would find automatically that I use CUDA 8.0, but it didn't... I had to do conda install cudatoolkit==8.0, conda proposed a downgrade, and it worked !

matthieuheitz avatar Jan 04 '19 19:01 matthieuheitz