Results 1 to 7 of 7

Thread: invalid command queue

  1. #1

    invalid command queue

    Hi forum,

    I am declared a global variable to hold the command queue and initialized it with the following command:

    Code :
       commandQueue = clCreateCommandQueue(context,device,0,&errNum);
     
       if(errNum != CL_SUCCESS)
       {
          std::cerr << "Failed to create the Command Queue: "
    		<< get_error_string(errNum)
    		<< std::endl;
          cleanup(EXIT_FAILURE);
       }


    Later in some other function i need to use this command queue, while using it i am getting the error : CL_INVALID_COMMAND_QUEUE with the following command:

    Code :
       cl_int errNum;
       //forward FFT
       errNum = clfftEnqueueTransform(planr2c,CLFFT_FORWARD,1,&commandQueue,0,NULL,NULL,&vx,NULL,NULL);
     
       //wait for the calculations to finish
       errNum = clFinish(commandQueue);
     
       if(errNum != CL_SUCCESS)
       {
          std::cerr << "the clFinish() failed  in the diffuse projection stage at forward FFT of X-component: "
    		<<  get_error_string(errNum) << std::endl;
          cleanup(EXIT_FAILURE);
       }


    The last errNum is giving me failure mentioning CL_INVALID_COMMAND_QUEUE

    I am clueless what might have went wrong. I have checked while creating the command queue and it returned CL_SUCCESS.

    Any idea ?


    Thanks

  2. #2
    Senior Member
    Join Date
    Dec 2011
    Posts
    152
    Search the specification for all references to CL_INVALID_COMMAND_QUEUE; each API lists the conditions it might return this error code. You might find that one of those conditions exists in your code.

  3. #3
    Are you sure ? My card so far supports the 1.1 spec and i checked all the instances of the CL_INVALID_COMMAND_QUEUE. Each of the instances mentions that

    "if command_queue is not a valid command-queue".

  4. #4
    I have seen some OpenCL implementations return CL_INVALID_COMMAND_QUEUE after something catastrophic happens inside a kernel. Like perhaps an out-of-bounds access. You might try and comment out your call to clfftEnqueueTransform and see if you still get an error when you call clFinish. Maybe something inside clfftEnqueueTransform is making trouble. Just a guess on my part...

  5. #5
    Senior Member
    Join Date
    Dec 2011
    Posts
    152
    good ideas kunze. It sounds like a mystery. @sajis997, can you try your code on a different platform (if you don't have a GPU from a different vendor, perhaps use the Intel CPU driver). It might give you a better error message or some other clue as to what is up.

  6. #6
    I have no access to any other platform other than nvidia gtx 560m . Now if clFinish() returns CL_SUCCESS are we validated that the enqueued kernels completed execution successfully ?

  7. #7
    Senior Member
    Join Date
    Dec 2011
    Posts
    152
    No, getting CL_SUCCESS from clFinish only means that command worked.

    If you install the (free) Intel OpenCL SDK then you have another OpenCL compiler available that may give better error messages.

Posting Permissions

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