0
votes

I am trying to run face detection on a 5 minute 720P video. I am using opencv API and opencl kernels to do my job. When I try to run the program, it runs fine for intial few number of frames. But after some frames, it gives me an error

OpenCV Error: Gpu API call (CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST) in openCLMemcpy2D, file /opencv-2.4.6.1/modules/ocl/src/initialization.cpp, line 466

Sometimes I get this error after processing 200 frames, sometimes I get this error after 2000 frames. Can anyone suggest me why I am facing this error and what could be a possible solution? I searched internet but did not find anythng.

UPDATE: I executed the program on my desktop PC which has a AMD APU. The whole machine freezed after processing some frame. I also applied clFinish after each kernel to make sure teh synchronization. Even though, the system freezed. So, it is not a synchronization issue.

1

1 Answers

0
votes

This error means that OpenCL event, which is in wait list of some kernel, has invalid status. Kernel, being issued to Command Queue can't wait for it's completion. Usually this happens due to lack of proper synchronization, so the number of processed frames is a matter of luck.

As OpenCV is pretty big library, not so easy to debug, the easiest way to go, in my opinion, is to collect runtime profile & see if tasks in Command Queues are going in right order. You can do it with profiler, which is usually shipped with OpenCL SDK by vendor (like Nvidia Visual Profiler or AMD CodeXL).