AnsweredAssumed Answered

Opencl ReleaseCommandQueue hangs

Question asked by jpsollie on Jan 26, 2017
Latest reply on Feb 2, 2017 by dipak

Hello everyone,

 

I'm experimenting with OpenCL driven event programming.

I have a situation where the system hangs indefinitely while performing the cleanup of the whole system.

The target is a TeraScale 5 device, no GCN, I am using fglrx 15.10, and am creating a context for CPU familiy, and one for gpu familiy.

the function cleanup() in my software is supposed to:

-release all buffer objects,

-cleanup the devices,

-release the context

... for all contexts in the system.

 

this is my gdb output:

enqueueing AA for execution on 0  //the CPU

enqueueing AA for execution on 1 // the VLIW device

enqueueing AA for execution on 2 // the GCN device

received completion of kernel 2

result : �������  (this is an openCL bug in the openCL kernel, I'm working on it)

-4

-1

-1

-1

-1

-1

-1

 

Breakpoint 1, cleanup () at ./bf_deepsearch2.c:244

244             while(active_devices != 0) sleep(10);

(gdb) step

received completion of kernel 1

received completion of kernel 0

245             for(i = 0; i < num_of_platforms; i++) {

(gdb) step

246                     clReleaseMemObject(input[i][0]);

(gdb) step

247                     clReleaseMemObject(input[i][1]);

(gdb) step

248                     clReleaseMemObject(input[i][2]);

(gdb) step

249                     clReleaseMemObject(output[i]);

(gdb) step

250                     clReleaseProgram(program[i]);

(gdb) step

251                     clReleaseKernel(clkernel[i]);

(gdb) step

252                     for(j = 0; j < num_of_devices[i]; j++) {

(gdb) step

253                             clFlush(command_queue[i][j]);

(gdb) step

254                             clReleaseCommandQueue(command_queue[i][j]);

(gdb) step

[Thread 0x7fffeae40700 (LWP 18023) exited]

[Thread 0x7fffebe55700 (LWP 18022) exited]

[Thread 0x7fffd9fd5700 (LWP 18027) exited]

[Thread 0x7fffc6fea700 (LWP 18029) exited]

[Thread 0x7fffb7fff700 (LWP 18031) exited]

[Thread 0x7fffe9e2b700 (LWP 18024) exited]

[Thread 0x7fffa6fea700 (LWP 18035) exited]

[Thread 0x7fff57fff700 (LWP 18049) exited]

[Thread 0x7fff56fea700 (LWP 18050) exited]

[Thread 0x7fff47fff700 (LWP 18052) exited]

[Thread 0x7fffb5fd5700 (LWP 18033) exited]

[Thread 0x7fffb6fea700 (LWP 18032) exited]

252                     for(j = 0; j < num_of_devices[i]; j++) {

(gdb) step

[Thread 0x7fff55fd5700 (LWP 18051) exited]

[Thread 0x7fffa7fff700 (LWP 18034) exited]

[Thread 0x7fffc5fd5700 (LWP 18030) exited]

[Thread 0x7fff46fea700 (LWP 18053) exited]

[Thread 0x7fff65fd5700 (LWP 18048) exited]

[Thread 0x7fff67fff700 (LWP 18046) exited]

[Thread 0x7fff66fea700 (LWP 18047) exited]

[Thread 0x7fff87fff700 (LWP 18040) exited]

[Thread 0x7fff75fd5700 (LWP 18045) exited]

[Thread 0x7fff76fea700 (LWP 18044) exited]

[Thread 0x7fff85fd5700 (LWP 18042) exited]

[Thread 0x7fffc7fff700 (LWP 18028) exited]

[Thread 0x7fff86fea700 (LWP 18041) exited]

[Thread 0x7fffa5fd5700 (LWP 18036) exited]

[Thread 0x7fffdafea700 (LWP 18026) exited]

[Thread 0x7fffebe96700 (LWP 18021) exited]

[Thread 0x7fffdbfff700 (LWP 18025) exited]

256                     clReleaseContext(context[i]);

(gdb) step

[Thread 0x7fff77fff700 (LWP 18043) exited]

[Thread 0x7fff97fff700 (LWP 18037) exited]

[Thread 0x7fff95fd5700 (LWP 18039) exited]

[Thread 0x7fff96fea700 (LWP 18038) exited]

257                     free(command_queue[i]);

(gdb) step

258                     free(device_id[i]);

(gdb) step

245             for(i = 0; i < num_of_platforms; i++) {

(gdb) step

246                     clReleaseMemObject(input[i][0]);

(gdb) step

247                     clReleaseMemObject(input[i][1]);

(gdb) step

248                     clReleaseMemObject(input[i][2]);

(gdb) step

249                     clReleaseMemObject(output[i]);

(gdb) step

250                     clReleaseProgram(program[i]);

(gdb) step

251                     clReleaseKernel(clkernel[i]);

(gdb) step

252                     for(j = 0; j < num_of_devices[i]; j++) {

(gdb) print num_of_devices[1]

$1 = 2

(gdb) step

253                             clFlush(command_queue[i][j]);

(gdb) step

254                             clReleaseCommandQueue(command_queue[i][j]);

(gdb) step

 

any ideas? why does releaseCommandQueue hang indefinitely?

thanks

(and sorry for the long output, but as a newbie, I'm not supposed to make replies, apparently)

Outcomes