Note that there are some explanatory texts on larger screens.

plurals
  1. POCalling cm.cublas_shutdown() in CUDAMat always raises exceptions
    primarykey
    data
    text
    <p>I tried running the example scripts <code>examples/nn_cudamat.py</code> and <code>examples/rbm_cudamat.py.py</code> included with the latest version of CUDAMat which wraps CUDA's cublas library and provides a Python matrix class for gpu computing.</p> <p>Both examples run fine but finish with multiple exceptions like this example:</p> <pre><code>Exception cudamat.CUDAMatException: CUDAMatException('CUBLAS error.',) in &lt;bound method CUDAMatrix.__del__ of &lt;cudamat.CUDAMatrix object at 0xf27290&gt;&gt; ignored </code></pre> <p>There were no failures running the nose tests after installation.</p> <p>I am not sure what exactly is causing the error but it seems to occur anytime <code>cm.cublas_shutdown()</code> is called at the end of a script where a <code>cm.CUDAMatrix</code> object was created.</p> <p>For example:</p> <pre><code>import numpy as np import cudamat as cm cm.cublas_init() cm.cublas_shutdown() </code></pre> <p>exits fine but:</p> <pre><code>import numpy as np import cudamat as cm cm.cublas_init() a = cm.CUDAMatrix(np.random.rand(5, 5)) print a.asarray() cm.cublas_shutdown() </code></pre> <p>runs fine but gives the exception at the end.</p> <p>CUDAMatrix.<strong>del</strong> frees the device memory corresponding the the matrix like this:</p> <pre><code>extern int free_device_memory(cudamat* mat) { if (mat-&gt;owns_data &amp;&amp; mat-&gt;on_device) { cublasStatus stat; stat = cublasFree(mat-&gt;data_device); mat-&gt;on_device = 0; if (stat != CUBLAS_STATUS_SUCCESS || check_cublas_error()) return CUBLAS_ERROR; } return 0; } </code></pre> <p>and cm.cublas_shutdown() does the following:</p> <pre><code>extern int cublas_shutdown() { cublasShutdown(); cudaThreadExit(); return 0; } </code></pre> <p>Someone else has the same problem and made an <a href="http://code.google.com/p/cudamat/issues/detail?id=12" rel="nofollow">issue</a> on the CUDAMat page a while back but there hasn't been any solution.</p> <p>So why is this happening?</p> <p>Some info:<br> Latest version of CUDAMat (docs say 0.3)<br> Python 2.6.6<br> [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2<br> Cuda Toolkit 5.0 </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload