Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ManiG

macrumors member
Original poster
Aug 11, 2009
44
0
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]
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
OpenCL_Procedural_Grass_and_Terrain_Example worked for me (NVIDIA GeForce 9400M).

opencl.jpg
 

ManiG

macrumors member
Original poster
Aug 11, 2009
44
0
That is worrisome for me. :(

Can anyone with a 4870, flashed or not, let me know if the OpenCL samples work?
 

Cromulent

macrumors 604
Oct 2, 2006
6,802
1,096
The Land of Hope and Glory
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.
 

Attachments

  • grass.png
    grass.png
    970.6 KB · Views: 154

rharder

macrumors newbie
Jun 21, 2002
4
0
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.