[PyCUDA] Problems with Context stack & autoinit

Andreas Klöckner lists at informa.tiker.net
Thu Mar 25 20:04:22 PDT 2010


On Donnerstag 25 März 2010, Bryan Catanzaro wrote:
> Hi All -
> I've been getting problems with the following error:
> 
> terminate called after throwing an instance of 'cuda::error'
>   what():  cuCtxPushCurrent failed: invalid value
> 
> After poking around, I discovered that context.pop(), registered using
>  atexit in pycuda.autoinit, is being called *before* all the destructors
>  for various things created during my program.  

This is by design. Since destructors may be called on out-of-context
objects, they need to make sure that 'their' context is active anyway.
In your case the context looks to have been *destroyed*, not merely
switched. Can you run your code with CUDA tracing and send the log?
(CUDA_TRACE=3D1 in siteconf.py)

Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.tiker.net/pipermail/pycuda/attachments/20100325/e3cc0613/attachment-0001.pgp>


More information about the PyCUDA mailing list