Hi,
I create an read_write buffer on device. After computing the CL kernel I'm ready to read is back to the host, but it appears an CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST error. The documents online says:
if the read and write operations are blocking and the execution status of any of the events in event_wait_list is a negative integer value.
event_wait_list
But the event_wait_list I pass into is null and the number of event is zero. This help nothing. It runs no error in any other gpu but mali (mali-T760). What the reason cause this?
Best wishes,
phenix
Hi Phenix,
CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST means that one of the jobs in the queue failed. It's not necessarily related to the read or write operation.
Most of the time the error comes from a read or write out of bound. (Usually you can find whether it's a read or write error by checking the kernel messages in "dmesg").
If you have several kernels in the queue I would recommend removing them all and adding them back one by one to find which one causes the error.
Hope this helps,
Hi Anthony,
Thanks a lot for your help.
I have already found that this issue was appeared after compute one of kernels, but the err_code return by this NDRange is right. The problem produces again when I trying read result back to host. Is this the read error ? or how to ckeck the kernel messages in "dmesg" in the Android system ?
Thx .
Phenix.
Is there any possible that the kernel was too complex to cause this problem when running in mali-t760?
Thanks very much.
I rewrite the code as your recommendation:
cl_event event;
cl_int status;
ret = clEnqueueNDRangeKernel(pGpuMgr->cmdQueue[0],
pNLFlt->CLKernelFNL[i].kernel,
2,MNull,
pNLFlt->CLKernelFNL[i].globalSize,
pNLFlt->CLKernelFNL[i].localSize,0,MNull,&event);
if (ret != CL_SUCCESS)
{
mlog("ERROR: parameters are invalid CLKernelFNL[%d] \n",i);
ss_gpuOCLErrCode(ret);
return;
}
ret = clWaitForEvents(1,&event);
if(ret != CL_SUCCESS){
mlog("ERROR: Failed to wait for event.\n");
ret = clGetEventInfo(event,CL_EVENT_COMMAND_EXECUTION_STATUS,sizeof(status),&status,NULL);
mlog("ERROR: Failed to get event info.\n");
if(status != CL_COMPLETE){
printf("ERROR executing the kernel %d\n",status);
and find that the error occur again after call clWaitForEvents(CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST). Can it be sure that it's caused by the kernel?
My bad, this is normal, you don't actually need to use clGetEventInfo
According to the specs for clWaitForEvents:
CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST if the execution status of any of the events in event_list is a negative integer value.
event_list
You would only need to use clGetEventInfo to find out which event failed in the case where you have several events in the queue.
I'm going to edit my previous reply to reflect that.
On android you can do:
adb shell dmesg
When clEnqueueNDRangeKernel returns the kernel is simply enqueued (It hasn't been dispatched to the GPU yet), so any error returned by this function is related to the kernel set up ( parameters types, local and global work group sizes) but not to the execution.
The kernel only get executed after the queue is flushed by either a call to clFlush or a blocking call (In your case the blocking read).
If you do:
cl_event event; cl_int error; cl_int status; error = clEnqueueNDRangeKernel( queue, kernel, dim, offset, gws, lws, 0, NULL, &event); assert( error == CL_SUCCESS ); // All the parameters are valid error = clWaitForEvents( 1, &event); if( error != CL_SUCCESS ) // 1 of the events in the queue failed { // Optional: Check if it's the kernel error = clGetEventInfo(event, CL_EVENT_COMMAND_ EXECUTION_STATUS, sizeof(status),&status, NULL); assert( error == CL_SUCCESS); if(status != CL_COMPLETE ) printf("ERROR executing the kernel %d\n", status); }
You will see that the error actually comes from the kernel execution and not the read.
It is unlikely to be an issue related to kernel complexity, it's almost certainly a read or write out of bound issue.
EDIT: Fixed the example
Hi phenix,
Did you make any progress ?
Would you be able to share the code of the failing kernel ?
HI, Anthony,
Thanks very much for your help.I have already solved this issue.
1.the error occur because of the operation failure of one kernel.
2.In the kernel I decalared an uint variable (linestep).After multipy linestep with an negative value (-1),I get a number which is not -linestep which supposed to be.Then this cause an overflow when access the global memory.
Best Regards,
View all questions in Graphics and Gaming forum