cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

sakuri
Journeyman III

Transition from OpenCL C++ Wrapper to OpenCL: Problem with memory allocation

Hi,

till today I have used C++ bindings for OpenCL and everything was working just fine. Today I have rewritten my code so it is completely in C.

And now I am getting error "CL_MEM_OBJECT_ALLOCATION_FAILURE" when creating buffers. I probably do not have enough memory because when I have commented some calls for buffer creation the error has occured later then before.

But I do not get it because with C++ bindings everything worked just fine and I did not have any memory problems and in the new code I do not create more buffers then before.

The code itself is rather complilcated - for creating the buffer I call other functions which creates and returns the buffer. So maybe passing buffers like this with C causes some problems?

Any idea where could be the problem?

Thanks a lot

0 Likes
2 Replies
himanshu_gautam
Grandmaster

Hi sakuri,

Can you please post your System config: CPU,GPU,SDK,DRIVER,OS?

Can you verify that clInfo shows sufficient Max Memory Allocation in clInfo.

This thread might be of interest:http://forums.amd.com/forum/messageview.cfm?catid=390&threadid=149197&forumid=9

If the problem is not solved please send a small testcase.

0 Likes
tweenk
Journeyman III

Originally posted by: sakuri Hi,

 

 

Any idea where could be the problem?



Maybe you inadvertently broke the buffer size calculation and it calls clCreateBuffer with some extremely high or negative value? Try to run your code in a debugger and see what value it sends to the buffer creation call.

0 Likes