cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

sy6746
Journeyman III

cl_mem_object_allocation_failure when calling clEnqueueNDRangeKernel

Jump to solution

So I'm writing a program that computes the convex hull of a group of points in 2D space.

I am debugging it so I can get it to work first before moving onto larger amounts of data.

I am testing with 5 points, 4 in a square and 1 inside the square.

I allocate a total of 65 cl_float2s, 10 cl_int2s, and 10 cl_ints.

at 4 bytes each, this all comes in at under a tenth of a Kb.

I have 3 kernels, each called exactly once, and all my code is attached.

I get the error after the first call to clEnqueNDRangeKernel.

Does anyone know what could cause this? CodeXL can't report additional info on it

because it crashes immediately after the call to clEnqueNDRangeKernel and the

loses it's state in the crash.

I also know that commenting out the last kernel and the calls to set it's arguments

fixes the crash. But I don't have any means by which to accomplish the task in just

those two alone.

Has anyone seen this before or know what might be causing it?

UPDATE: I tried compiling and running on the CPU instead of the GPU and got the

same error.

0 Likes
1 Solution

Accepted Solutions
dipak
Staff
Staff

Re: cl_mem_object_allocation_failure when calling clEnqueueNDRangeKernel

Jump to solution

Hi Scott,

I didn't observe the error as you mentioned. There were some other coding errors which caused the program to crash and forced the driver to restart. As I found, here the main issues:

  • In mark_hull_lines kernel, variable "j" is not updated in loop "while(j<points)" so, it is a infinite loop (hence kernel)
  • clReleaseMemObject is called multiple times for same object.

After modifying the code accordingly, the program ran successfully for GPU device as well as CPU.

Please try the attached code and share your findings.

P.S.

Setup: R9 290X with the latest Crimson 16.11.5 on Windows 7 64bit.

Regards,

View solution in original post

2 Replies
dipak
Staff
Staff

Re: cl_mem_object_allocation_failure when calling clEnqueueNDRangeKernel

Jump to solution

Hi Scott,

I didn't observe the error as you mentioned. There were some other coding errors which caused the program to crash and forced the driver to restart. As I found, here the main issues:

  • In mark_hull_lines kernel, variable "j" is not updated in loop "while(j<points)" so, it is a infinite loop (hence kernel)
  • clReleaseMemObject is called multiple times for same object.

After modifying the code accordingly, the program ran successfully for GPU device as well as CPU.

Please try the attached code and share your findings.

P.S.

Setup: R9 290X with the latest Crimson 16.11.5 on Windows 7 64bit.

Regards,

View solution in original post

sy6746
Journeyman III

Re: cl_mem_object_allocation_failure when calling clEnqueueNDRangeKernel

Jump to solution

Tried your solution dipak and it worked. Thank you very much!

0 Likes