Results 1 to 6 of 6

Thread: CL_INVALID_COMMAND_QUEUE

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    18

    CL_INVALID_COMMAND_QUEUE

    hi all

    i run my code on cpu device and everything is all right, but when i run it ongpu device i get
    error 36 that according to cl.h it corresponding to CL_INVALID_COMMAND_QUEUE
    this is a piece of code that have problem:


    while (round <= rounds) {

    printf("Round %u...\n", (unsigned) round);
    error |= clSetKernelArg(kernel, 5, sizeof(cl_uint), &round);
    if (error != CL_SUCCESS) {
    fprintf(stderr, "ERROR: clSetKernelArg, error code %d\n", error);
    ok = 0;
    goto cleanup;
    }


    error = clEnqueueNDRangeKernel(command_queue, kernel, 1, NULL, &global_size, &local_size, 0, NULL, &event_execute);
    if (error != CL_SUCCESS) {
    fprintf(stderr, "ERROR: clEnqueueNDRangeKernel, error code %d\n", error);
    ok = 0;
    goto cleanup;
    }
    clFinish(command_queue);

    execution_time += execution_time_msecs(event_execute);
    ++round;
    }

    when i run it (with global_size=64,local_size=1) on cpu it works(it goes every 10 rounds) but on gpu i get :
    Round 0...
    Round 1...
    ERROR: clEnqueueNDRangeKernel, error code -36

    i suspect that somehow synchronization has problem, then i add clFinish(command_queue) but still not works

    any idea???

  2. #2
    Senior Member
    Join Date
    Aug 2011
    Posts
    271

    Re: CL_INVALID_COMMAND_QUEUE

    That error usually means that the code has crashed on the gpu - which means you've got a bug in your kernel code (or the arguments you're giving it).

    Having it work on a cpu is a good test but it has a totally different execution engine and memory map so bugs manifest themselves differently.

  3. #3
    Junior Member
    Join Date
    Jun 2012
    Posts
    18

    Re: CL_INVALID_COMMAND_QUEUE

    hi

    what are different between cpu and gpu in execution kernel,
    i mean, when i run kernel on gpu with global_size=64 and local_size=1 and then run it with same
    parameter global_size=64 and local_size=1 on cpu what is deferent except "command_queue".
    i was thinking that when i don't group data (local_size=1) , then there is no deferent between running on cpu and gpu then i have to get same result from both( both cpu and gnu run same kernel).

    did i misunderstand something??

  4. #4
    Junior Member
    Join Date
    Jun 2012
    Posts
    18

    Re: CL_INVALID_COMMAND_QUEUE

    Quote Originally Posted by notzed
    That error usually means that the code has crashed on the gpu - which means you've got a bug in your kernel code (or the arguments you're giving it).

    Having it work on a cpu is a good test but it has a totally different execution engine and memory map so bugs manifest themselves differently.
    i entirely commented kernel content but nothing changed i still take that error?

  5. #5
    Junior Member
    Join Date
    Jun 2012
    Posts
    18

    Re: CL_INVALID_COMMAND_QUEUE

    hi

    when i comment "clFinish(command_queue)" the while loop finish correctly( i can see Round 0 ...
    till Round10 ... in output) but after while loop i get same error "error code -36" but this time
    it is relative to "clEnqueueReadBuffer"?

    i'am pretty sure that "command_queue" has problem because:
    1. i comment content of kernel entirely but i get same error then the problem can't be of
    kernel
    2. i NULL local_size( workgroup size) till opencl assign it itself and error remain
    3. i NULL event_execute and noting change
    4. the only option that change between running on cpu( that works correctly) and gpu (that
    has error) is command_queue and other options are same for cpu and gnu

    then the only error prone option is "command_queue"
    but i have no idea what else can i do , because i don't have any access to command queue and i
    don't know how to debug it?
    please help

  6. #6
    Junior Member
    Join Date
    Jun 2012
    Posts
    18

    Re: CL_INVALID_COMMAND_QUEUE

    Quote Originally Posted by a.mirzaean
    hi

    what are different between cpu and gpu in execution kernel,
    i mean, when i run kernel on gpu with global_size=64 and local_size=1 and then run it with same
    parameter global_size=64 and local_size=1 on cpu what is deferent except "command_queue".
    i was thinking that when i don't group data (local_size=1) , then there is no deferent between running on cpu and gpu then i have to get same result from both( both cpu and gnu run same kernel).

    did i misunderstand something??
    i found something:
    actually when we run kernel with global_size=m and local_size=1 on gpu opencl spread kernel
    between m "compute unit" that each one has only a work item but we have different scenario on
    cpu i think the only option for running kernel on cpu is local_size=1 (the only number that can assign to local_size is 1) maybe with this constraint
    we force cpu to run serially ???
    am i correct ??

Similar Threads

  1. CL_INVALID_COMMAND_QUEUE error
    By qwer in forum OpenCL
    Replies: 16
    Last Post: 01-17-2011, 07:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •