Open CL on rMPB doesn't work with GT 650M?

Discussion in 'Mac Programming' started by oschrenk, Aug 28, 2012.

  1. oschrenk macrumors newbie

    Joined:
    May 29, 2012
    #1
    I'm trying to run Apple's Hello World OpenCL example. It does compile, but fails with
    Code:
    Error: Failed to create a command commands
    .

    I also tried to run a JOCL based sample application which also fails when trying to create a command queue with a GPU device (with CPU everything works fine.)

    Does anybody else have this problems?
     
  2. Persifleur macrumors member

    Joined:
    Jun 1, 2005
    Location:
    London, UK
    #2
    It works for me (rMBP running XCode 4.4.1 on 10.8.1).

    Code:
    Computed '1024/1024' correct values!
     
  3. oschrenk thread starter macrumors newbie

    Joined:
    May 29, 2012
    #3
    I've tried other peoples code,including the code samples from the OpenCL book and all fail with CL_INVALID_VALUE can't create Command queue.

    I'm really stumped (and in despair to be honest, as I need this to work for my master thesis). I tried the examples in admin and standard accounts, and using gfxCardStatus forcing to use discrete graphics.


    Have you installed anything besides XCode?
     
  4. Persifleur, Aug 29, 2012
    Last edited: Aug 29, 2012

    Persifleur macrumors member

    Joined:
    Jun 1, 2005
    Location:
    London, UK
    #4
    I've tried gcc and clang from the command line with the same result (clang -framework OpenCL hello.c -o hello). Using gfxCardStatus, I've tried both Automatic Switching and Discrete Only, neither of which failed. When set to Automatic Switching, I see the Growl notification that the 650M is briefly engaged before switching back to the 4000. I can only get it to fail if I set properties to a non-zero value in the call to clCreateCommandQueue.

    Have you tried passing an error notification callback function into clCreateContext to see if you get anything useful?

    e.g.
    Code:
    #include <OpenCL/cl_ext.h>
    
    context = clCreateContext(0, 1, &device_id, [B]clLogMessagesToStdoutAPPLE[/B], NULL, &err);
     

Share This Page