View Full Version : A 64ko buffer size limit ?

06-10-2013, 07:28 AM

I am writing a small application in WebCL (NOT WebGL !), where I must render a set of primitives in a 3D scene.

Currently, I can use only 1170 primitives consisting of 14 floats each, which means the 1171th will give me a -52 error on the NDRangeKernel call (Bad args if I'm not mistaken ?). This means I can use only 16380 * 32 bits float, and the closest power of two gives us a 64 kilobytes limit when writing in a buffer.

Is there anyone with the slightest idea where this limit come from ? I know of the 128 mb limit usually enforced (my GPU is a GeForce 560 with 1Gb of memory), but I'm far under it. I also use a javascript front end with Float32Array to serialize my data, if that's of any relevance.


06-11-2013, 04:53 AM
Okay, so after some research, I came up with these precision :

I am using the nokia implementation and Firefox 21. This implementation seems not to take into account the hint about memory management (CL_MEM_COPY_HOST_PTR flag for example when creating a buffer). It thus seems that I am forced to use a constant cache limited to 64 kilobytes.

Does anyone have any alternative (working for this implementation) ?

Edit : My bad, I was simply using a "constant" parameter which, as intended, limited the size of the buffer to the max constant size limit. *facepalm*.