I am currently trying to implement some algorithms for different image operatios. OS: Ubuntu 10.10, Catalyst Version: 10.11
Everything seems to work fine, if the images are small enough. If I use HD-Images (1920*1080), I get an out of resources error when enqueueing the kernel. I thought maybe the memory of my graphicscard was'nt big enough, so I summed up all the buffersizes and the result was 300 mb.My HD 4770 has 512 mb of memory, so this should not be a problem, should it?
As the number of global threads used is imagewidth*imageheight, I thought this number might be too huge, so I set it to a constant number (128) for test reasons, but I still get the error. This leads me to the conclusion, that the memory-size is the problem.
Is there any way to find out, what is using the >212 mb of memory?
Is there any way to keep whatever is using the memory from using it?
Thank you in advance,
Using CLInfo from the opencl-samples, I just found out, that the "Global Memory Size" of my card is just 268435456 which is 256 MB. This seems very strange as even catalyst control center says that the memorysize of my 4770 was 512 MB. Is this a driver issue, or is it usual, that opencl can only use half of the available space.
The problem is, that the current AMD implementation allows you to use only one half of the memory at most. I don't remember wheather for buffer, commandQueue or so, but you can find it out.
I think I have seen that you can change this behaviour somehow. Try to look at.
Originally posted by: nou beware that you can create buffer with maximum size 128MB.
Are you sure of that? Because I have now tried:
ptrs = cl::Buffer(s.context_, CL_MEM_READ_ONLY, 220 * 1<<20);
and succeeded (didn't catch an exception). The exception raised when I tried 230 (I have also others buffers so the sum of memory is actually > 256 MB), which corresponds with the limit of 1/2 of graphic memory for an application.
Originally posted by: nou there is limit look at CL_DEVICE_MAX_MEM_ALLOCATION_SIZE
Yeah, you are right. Thanks for information.
But I meant you was thinking of some technical limitation. Instead it is standard-defined minimal value (but not the actual limit enforced by AMD cards).
Anyway, thank you for a new information
EDIT: The interesting thing is that my card reports maximal allocation size 128 MB but allows me allocate more without complaining
Sorry for writing back so late.
After reading pulec's hint, I discovered a thread about exactly my problem:
There are many more flags like the one for max memory.
Thanks to all!
Merry christmas and have a nice holiday,