Hi Matthew, On Wed, 31 Aug 2011 22:10:33 -0700, Matthew Graham <m...@cacr.caltech.edu> wrote: > I have some code that runs fine as a standalone routine; however, I want to > incorporate it as part of a web service using CherryPy as the hosting > framework. When I try and call it from a client, I get: > > [31/Aug/2011:21:56:38] HTTP Traceback (most recent call last): > File > "/Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/cherrypy/_cprequest.py", > line 606, in respond > cherrypy.response.body = self.handler() > File > "/Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/cherrypy/_cpdispatch.py", > line 25, in __call__ > return self.callable(*self.args, **self.kwargs) > File "tscs.py", line 124, in POST > response = self._analyze(data, kwargs) > File "tscs.py", line 83, in _analyze > row.append(self.stats[statid]['method'](data[id])) > File "/Users/mjg/Projects/python/kiss/statistics.py", line 268, in gpuls > lsp = Culsp() > File "/Users/mjg/Projects/python/kiss/culsp.py", line 146, in __init__ > mod = compiler.SourceModule(kernel_code) > File > "/Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/pycuda-2011.1-py2.6-macosx-10.5-i386.egg/pycuda/compiler.py", > line 271, in __init__ > arch, code, cache_dir, include_dirs) > File > "/Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/pycuda-2011.1-py2.6-macosx-10.5-i386.egg/pycuda/compiler.py", > line 218, in compile > arch = "sm_%d%d" % Context.get_device().compute_capability() > LogicError: cuCtxGetDevice failed: invalid context > > Any ideas? I'm running CUDA 4.0 and PyCUDA 2011.1.2.
Have you run your code as the web user? (Often www-data, but maybe something different?) Does the same thing happen then? In any case, I suspect that this is some permissions/security issue. It might be helpful trying to replicate all the restrictions that web server-executed code has on it... HTH, Andreas
pgpxVB2CHGoeT.pgp
Description: PGP signature
_______________________________________________ PyCUDA mailing list PyCUDA@tiker.net http://lists.tiker.net/listinfo/pycuda