OpenCL sample code

Discussion in 'Mac Programming' started by ManiG, Aug 29, 2009.

  1. ManiG macrumors member

    Joined:
    Aug 11, 2009
    #1
    So, I've downloaded and compiled some of Apple's OpenCL sample code.

    Pretty much none of them work for me, except for the Hello World example.

    Has anyone else had any luck? I'm assuming the OpenCL spec has changed since these were last worked on (since the error occurs when trying to load the .cl files), and some tweaks need to be make to the kernel code.

    In particular, the following sample projects don't work for me:

    OpenCL_Procedural_Grass_and_Terrain_Example
    OpenCL_RayTraced_Quaternion_Julia_Set_Example
    OpenCL_Procedural_Noise_Example

    Any help appreciated!


    Code:
    /Users/mani/Downloads/OpenCL_Procedural_Noise_Example/build/Debug/noise ; exit;
    Galactus:~ mani$ /Users/mani/Downloads/OpenCL_Procedural_Noise_Example/build/Debug/noise ; exit;
    ----------------------------------------------------------------------
    Using active OpenGL context...
    ----------------------------------------------------------------------
    Connecting to AMD Radeon HD 4870...
    ----------------------------------------------------------------------
    Loading kernel source from file 'noise_kernel.cl'...
    Error opening file noise_kernel.cl
    Failed to setup compute kernel! Error -8
    logout
    
    [Process completed]
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    OpenCL_Procedural_Grass_and_Terrain_Example worked for me (NVIDIA GeForce 9400M).

    opencl.jpg
     
  3. ManiG thread starter macrumors member

    Joined:
    Aug 11, 2009
    #3
    That is worrisome for me. :(

    Can anyone with a 4870, flashed or not, let me know if the OpenCL samples work?
     
  4. ManiG thread starter macrumors member

    Joined:
    Aug 11, 2009
  5. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #5
    I don't have that graphics card but it does work on my Mac Pro with the Nvidia 8800GT. Maybe it is an ATI thing?

    Also I had to switch the compiler from the default (GCC 4.2) to LLVM Clang to get it too work for me.
     

    Attached Files:

  6. rharder macrumors newbie

    Joined:
    Jun 21, 2002
    #6
    Those samples specifically show how OpenCL and OpenGL can share buffers, so if you don't have a compatible card, they won't run. If you _do_ have a compatible card...sorry, don't know.

    I have a Radeon card, so I've had to modify most of the samples to not try to look for a GPU and just run on the CPU, but I can't fake the OpenGL/OpenCL buffer sharing thing that way.

    -Rob
     

Share This Page