Calling clEnqueueNDRangeKernel in a loop

Moderator: dar

Calling clEnqueueNDRangeKernel in a loop

Postby yildizabdullah » Mon Jun 29, 2015 8:59 am

I want to execute an OpenCL kernel multiple times.

I modified the hello-opencl example as follows:

Code: Select all
for(i = 0; i < 100; i++){
      clEnqueueNDRangeKernel(cmdq,krn,1,0,gtdsz,ltdsz,0,0,&ev[0]);
      clEnqueueReadBuffer(cmdq,c_buf,CL_TRUE,0,c_sz,c,0,0,&ev[1]);
      err = clWaitForEvents(2,ev);
}


During running the loop, I get the following error after a while:

Code: Select all
hello-opencl.elf: e_alloc(): mmap failure.
hello-opencl.elf:
ERROR: Can't allocate external memory buffer!

[2931] clmesg WARNING: e32pth_engine_needham.c(360): hardcoded to devnum=0


What did I do wrong here?
yildizabdullah
 
Posts: 15
Joined: Thu Jul 31, 2014 10:51 am
Location: Istanbul

Re: Calling clEnqueueNDRangeKernel in a loop

Postby jar » Sat Jul 04, 2015 12:02 am

I don't have an answer for you, but I have seen this before on another application. Something changed with the COPRTHR interface to the eSDK with the newer eSDK. It didn't always happen, but it does now. If I had to guess, something with the eSDK isn't being properly freed since this appears to be a memory leak. If you still need an answer, run the application with cldebug and send the output to the COPRTHR developer, dar, on github.

Code: Select all
cldebug -- ./your_program
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am


Return to OpenCL

Who is online

Users browsing this forum: No registered users and 1 guest

cron