Le mercredi 13 mai 2009 01:00:46, Andreas Klöckner a écrit :
> On Dienstag 12 Mai 2009, Vincent Favre-Nicolin wrote:
>
> Check the temperature of your devices. I've seen weird behavior out of the
> cards things if they're insufficiently cooled. What error message do you
> see?
The error message just reported that the context creation failed - but
without any further info from cuda (unknown error or something). I had not
thought about temperature issues - the gtx 295 is well cooled and so is my
computer (I saw 84°C max ~1h after calculations began). In fact, the
calculations last night went fine with the new code using 2 persistent threads
sot it was not the issue - the card crunched full speed for ~10 hours.
Anyway it does not matter any more - the number of threads created before
failure (a few hundreds short of 2**15) must have meant something though.
> There's a backport of multiprocessing for 2.5 and below.
>
> In general, processes are much nicer than threads for PyCUDA. GC makes it a
> bit difficult to predict in which thread a destructor gets called, and CUDA
> gets upset if you try to clean up stuff from the wrong context. PyCUDA is
> aware of this issue and works around it. But if it gets a destructor called
> in the wrong thread/context, there's little it can do--in that case, it'll
> leak the object and spit a warning. If you keep all references to CUDA
> objects inside each context-associated thread and make sure you don't have
> reference cycles (or call gc.collect() if you do), you should be ok,
> though.
Yes, multiprocessing seems much better - also because objects like Queues
are available. I just have to find out a way to keep the context and compiled
kernel in a Process, and still be able to use a Queue. That shouldn't be a
problem.
> > One thing I've not figured entirely correctly is automatically
> > deleting the threads when they are not needed any more.
>
> What's the problem here?
The two threads handling the gpu calculations are created in an object,
which will destroy the threads when that object is deleted. The problem is, it
is not automatically deleted when I leave python - so I have to call
del(gputhreads) manually but it's not a big deal - I did not have too much
time to google this yesterday,
Cheers,
Vincent
--
Vincent Favre-Nicolin http://inac.cea.fr
CEA/Grenoble Institut Nanosciences & Cryogénie
Laboratoire SP2M/Nano-structures et Rayonnement Synchrotron
17, rue des Martyrs
38054 Grenoble Cedex 9 - France
Université Joseph Fourier http://www.ujf-grenoble.fr
tél: (+33) 4 38 78 95 40 fax: (+33) 4 38 78 51 38
_______________________________________________
PyCuda mailing list
[email protected]
http://tiker.net/mailman/listinfo/pycuda_tiker.net