Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: command queue goes dead after clEnqueueNDRangeKernel ?

  1. #11

    Re: command queue goes dead after clEnqueueNDRangeKernel ?

    If I replace the kernel with an empty one, it executes without issue on the GPU. In fact if I comment out the double loop, i.e., change to code to reflect
    Code :
    //	for (size_t j = 0; j < M; ++j) {
    //		size_t m = 1;
    //		for (size_t i = 0; i < dim; ++i) {
    //			size_t ki = (j / m) % n;
    //			m *= n; 
    //		}
    //	}
    but leave everything else the same, then is also executes without issue.

    It is this simple double loop that is causing some strange memory leak. Incidentally, there is nothing special about the base n = 10. This loop was embedded an algorithm for which I used several different values: n = 13, 9, 7, and 5. This is the key algorithm needed for the index-arithmetic in computing parameters related to a tensor-product approximation. I can't really get rid of it. What I find the most puzzling is that it executes fine on the CPU without issue -- even with lots of other floating-point math going on inside the inner loop!

  2. #12
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: command queue goes dead after clEnqueueNDRangeKernel ?

    If I replace the kernel with an empty one, it executes without issue on the GPU.
    This is odd. A decent compiler would remove that loop altogether (since it doesn't affect the kerne's output) and it would never be executed.

    It's possible that Apple is doing just-in-time compilation and the compiler crashes when it tries to JIT that loop. That could make the driver invalidate the whole queue.

    File a bug to Apple since this this is quite clearly not an issue with the application.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #13

    Re: command queue goes dead after clEnqueueNDRangeKernel ?

    Thanks David, my intuition had told me pretty much the same thing -- of course I didn't express it as concisely as you did. I had actually already filed a bug report with Apple before this last post, but wanted to follow up here to get input from other members OpenCL community.

  4. #14
    Junior Member
    Join Date
    Jun 2011
    Posts
    13

    Re: command queue goes dead after clEnqueueNDRangeKernel ?

    drjerry: have you been able to fix this bug? I just recently encountered the same thing, but i can fix it when running in DEBUG mode or by getting rid of one value in my code. Neither of which are feasible for the application.

  5. #15

    Re: command queue goes dead after clEnqueueNDRangeKernel ?

    Hi dlw, I can't recall the exact work-around that I used in that project. However I filed a bug report with Apple, and the engineers got back to me. They basically pointed out that the declaration of the kernel with the size_t argument is invalid. Specifically: "Refer to section 6.8, item k in the 1.1 specification for a list of types that are not valid kernel argument types."

    That was when I was compiling kernels on a machine that only supported OpenCL 1.0. OS X 10.7 ships with OpenCL 1.1 support (e.g., for Nvidia graphics cards). The Apple engineers later asked me to check whether I could replicate this problem with OpenCL 1.1, and I couldn't.

  6. #16
    Junior Member
    Join Date
    Aug 2011
    Posts
    1

    Re: command queue goes dead after clEnqueueNDRangeKernel ?

    Just tried the code. Thanks!

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Command Queue
    By chanakya.sun in forum OpenCL
    Replies: 3
    Last Post: 11-09-2011, 05:39 PM
  2. When is a command queue actually executed?
    By sanderbeckers in forum OpenCL
    Replies: 6
    Last Post: 03-03-2011, 06:28 PM
  3. Problem with Command queue
    By Gregorien in forum OpenCL
    Replies: 0
    Last Post: 03-25-2010, 02:55 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
  •