[PyOpenCL] Memory leaks after each kernel execution
yl3gdy at archlinux.us
Sun Mar 25 10:11:31 PDT 2012
I found a frustrating problem in pyopencl - after each kernel execution
host memory consumption increases by approx 1.5 MB. Taking into account
program workflow (modelling some amount of iterations on card, finishing
kernel, reading data via enqueue_copy, writing it to file, then starting
kernel again), I run out of my 4 GB of RAM after some thousands of such
In a previous project which was written on C++ I solved this problem this
way. An event object was dynamically created and passed to
enqueueNDRangeKernel(). After reading data from GPU event object was
deleted. Obviously it's impossible to use this method in Python.
Also it's worth to notice that the memory leak occures when using both CPU
or GPU. I'm using Intel CPU and nVidia GPU.
What can be done to fix the problem?
More information about the PyOpenCL