Too small buffer allocation = CL_OUT_OF_HOST_MEMORY

Hi.

I’m using shared CL/GL buffers. The buffers get dimensions of my Qt GL widget onto which I’m rendering.
When I resize my widget, I resize my 1D buffers to exactly match the size of the widget (and 2D textures). Everything would be OK but when I resize the window to a very small one (say 40x40px) and delete (release) and (re-)allocate my buffers GL buffers (and textures) allocate OK but clCreateFromGLBuffer() returns CL_OUT_OF_HOST_MEMORY.

Now, you definitelly think this is some memory leak or synchronisation failure. That’s what I thought. So the first thing I do after creating the shared GL/CL contexts is to create such a small CL buffer (from a GL buffer which is OK). Now I get CL_OUT_OF_HOST_MEMORY. But if the buffer is bigger, like 200x200px, everything works very fine. (Each pixel is 4x 32-bit floats). I have a single thread and check for GL and CL errors after EVERY SINGLE GL/CL call. This is the only error and then C++ allocations in Qt functions fail, so there might be some heap corruption from the driver perhaps.

Recap: Creating a “bigger” buffer works good. Creating a “smaller” buffer = crash. Everything but allocating small buffers (sometimes with un-even dimensions) works well.

Win Server 2008 R2 x64, GeForce GTS250, drivers 8.17.12.6061

Driver bug?

Edit: I determined that the minimum GL buffer size for successful CL buffer creation with this set-up is 128 kB (131072 B). WTF? :(

Hi.

I’m using shared CL/GL buffers. The buffers get dimensions of my Qt GL widget onto which I’m rendering.
When I resize my widget, I resize my 1D buffers to exactly match the size of the widget (and 2D textures). Everything would be OK but when I resize the window to a very small one (say 40x40px) and delete (release) and (re-)allocate my buffers GL buffers (and textures) allocate OK but clCreateFromGLBuffer() returns CL_OUT_OF_HOST_MEMORY.

Now, you definitelly think this is some memory leak or synchronisation failure. That’s what I thought. So the first thing I do after creating the shared GL/CL contexts is to create such a small CL buffer (from a GL buffer which is OK). Now I get CL_OUT_OF_HOST_MEMORY. But if the buffer is bigger, like 200x200px, everything works very fine. (Each pixel is 4x 32-bit floats). I have a single thread and check for GL and CL errors after EVERY SINGLE GL/CL call. This is the only error and then C++ allocations in Qt functions fail, so there might be some heap corruption from the driver perhaps.

Recap: Creating a “bigger” buffer works good. Creating a “smaller” buffer = crash. Everything but allocating small buffers (sometimes with un-even dimensions) works well.

Win Server 2008 R2 x64, GeForce GTS250, drivers 8.17.12.6061

Driver bug?

Edit: I determined that the minimum GL buffer size for successful CL buffer creation with this set-up is 128 kB (131072 B). WTF? :(