Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running OpenCL kernel multiple times on Parallella #33

Open
abdullahyildiz opened this issue Jul 6, 2015 · 3 comments
Open

Running OpenCL kernel multiple times on Parallella #33

abdullahyildiz opened this issue Jul 6, 2015 · 3 comments

Comments

@abdullahyildiz
Copy link

I want to execute an OpenCL kernel multiple times. I modified hello-opencl example as follows:

for(i = 0; i < 5; 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);
}

It sometimes works, sometimes the terminal freezes up somewhere within the code and the operating system crashes.

The reason may be that memory is not freed properly.

During running the loop, I get the following error after a while (sometimes also the operating system crashes):

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

@browndeer
Copy link
Owner

Does the error occur after a few (successful) iterations and is it always the same iteration?

abdullah wrote:

I want to execute an OpenCL kernel multiple times. I modified the
hello-opencl example as follows:

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:

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


Reply to this email directly or view it on GitHub
#33.

David Richie, Ph.D.
Brown Deer Technology
1641 Denwright Court
Forest Hill, MD 21050
410-459-3848
[email protected]
www.browndeertechnology.com

@abdullahyildiz
Copy link
Author

Yes but not always the same iteration.

@MiguelTasende
Copy link

Hello!
I am having the exact same problem, but my "kernel" doesn't even use coprthr (I am using ESDK directly).
I write this here because this is the closest thing to my error that I found.

The behaviour is exactly the same as browndeer describes:
I launch the kernel many times. Every time on the same iteration (94 I think) it freezes and says:

e_alloc(): mmap failure.
ERROR: Can't allocate external memory buffer!

I am resetting and initializing the whole Epiphany on each iteration (i know I shouldn't in a production software, but this one is just for debugging; I am going to change that anyway and test again... but not sure if it will help).
Any idea on which is the problem. I see you are aware of some "similar" behaviours....

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants