CL_OUT_OF_RESOURCES error on clEnqueueReadBuffer Driver crashes and I get an CL_OUT_OF_RESOURCES err

I know there are a couple threads on this topic where programs will give an CL_OUT_OF_RESOURCES error on clEnqueueReadBuffer. I’ve tried everything I can think of and I can’t seem to solve the problem. Cutting down the local work group size just delays the error if anything.

Basically what the program does is reads a 3D volumetric image, and based upon the input parameters, generates 2D images at different angles/depths. I’ve attached the code and the input file can be found here. If it requests a username/password, just use anonymous.

A standard program call would be:

DRR_OPENCL.exe -a 20 -A 10 -r “1000 1000” -I headphantom.mha

Do to double/single floating point accuracy issues, there may be artifacts in the final images (which will be generated as pfms). I’m not concerned about that as much as I am about having a stable program. If you would like to view the actual output images, feel free to use Scarlet 2.0 (windows program) or in linux, you can use imagemagick and the convert function to convert the files into jpgs.

I’m at a wits end and would love any help or ideas. If you have any questions, please post back and I will respond ASAP. (19.8 KB)

Hi achinda,

did you get it to work in the end? If yes, how?


Yes, but it was a long while back. I can’t remember exactly what caused the problem or how I solved it, but I would pay some attention to the pointers and the sizes of the memory you are trying to copy back.