ofxMSAOpenCL : Assertion failed

Hello world,

I’m trying to run the HelloWorld example from ofxMSAOpenCL and have run in to an issue that has me stumped.
The code compiles correctly, however once running, I get the output, error & warning pasted below.
I also get the message “Thread 1 : Program received signal: “SIGABRT”.” for line 132 of MSAOpenCLProgram.cpp

I’ve added in the opencl.framework and I’m on OSX 10.7.5 with NVIDIA GeForce 9600M GT and GeForce 9400M.
(I can post all device information logged by the app if needed.) I’ve also attached the stack trace as well in case that helps give any potential life saver more information :slight_smile:

***UPDATE ***

  
cl_int err = clBuildProgram(clProgram, 0, NULL, NULL, NULL, NULL);  

err is -11, CL_BUILD_PROGRAM_FAILURE.

  
[verbose] OpenCL::loadProgramFromFile  
[verbose] OpenCLProgram::OpenCLProgram  
[verbose] OpenCLProgram::loadFromFile MSAOpenCL/HelloWorld.cl, isBinary: 0  
[verbose] OpenCLProgram::loadFromSource   
[error]   
 ***** Error building program. *****   
 ***********************************  
  
[error] <program source>:14:64: error: parameter may not be qualified with an address space  
__kernel void multiplyScaler(__global float *a, __global float b, __global float *result) {  
                                                               ^  
Assertion failed: (false), function build, file /Users/mattbilson/Development/workspace/openframeworks/of_v0072_osx_release/apps/gl/emptyExample/../../../addons/ofxMSAOpenCL/src/MSAOpenCLProgram.cpp, line 132.  
  
sharedlibrary apply-load-rules all  
warning: Could not find object file "/openFrameworks/GLUT/OF_CUSTOM_GLUT/libForeground.a(macx_foreground.o)" - no debug information available for "/Users/mcast/Code/GLUT-ToPost/macx_foreground.m".  

![](http://forum.openframeworks.cc/uploads/default/2648/Screen Shot 2012-11-19 at 13.05.33.png)

Ok, so I fixed this by removing the global address space from the function parameter b

  
__kernel void multiplyScaler(__global float *a, float b, __global float *result) {  

Having fixed this assertion failed issue and successfully run the HelloWorld and image examples, I attempted to run the particle example and have hit another Assertion Failed error.
This has made me wonder if there’s something more serious that’s wrong with my setup?

This assertion error is below and err is -36, CL_INVALID_COMMAND_QUEUE.

  
[verbose] OpenCL::loadProgramFromFile  
[verbose] OpenCLProgram::OpenCLProgram  
[verbose] OpenCLProgram::loadFromFile MSAOpenCL/Particle.cl, isBinary: 0  
[verbose] OpenCLProgram::loadFromSource   
[verbose] OpenCL::loadKernel updateParticle, 0  
[verbose] OpenCLProgram::loadKernel updateParticle  
[verbose] OpenCLKernel::OpenCLKernel 3931920, updateParticle  
[verbose] OpenCLBuffer::initBuffer  
[verbose] OpenCLMemoryObject::memoryObjectInit  
[verbose] OpenCLBuffer::initFromGLObject  
[verbose] OpenCLMemoryObject::memoryObjectInit  
Assertion failed: (err == CL_SUCCESS), function run, file /Users/mattbilson/Development/workspace/openframeworks/of_v0072_osx_release/apps/gl/msaOpenClExample-particles/../../../addons/ofxMSAOpenCL/src/MSAOpenCLKernel.cpp, line 37.  

Is part of my setup fundamentally wrong, which is causing these Assertion failed errors, or is it just a case of tweaking something for my system?

got the same issue. Any update?

I haven’t found a fix yet.
What hardware/OS are you on Pach?

I’m on a macbook pro early 2011 (i7 2.66 Ghz and nvidia GT330M 512Mo).
I’ll try to have a quick test on the macpro in the day if I get the time.
I also can’t compile on the CPU. Will do more test in the day too.

Could be an OS issue. My macbookpro is running under 10.8 and get this issue quite a lot, even on some old code that are working perfectly on the other mac pro I’m working on under 10.7. Unfortunately didn’t had the time yet to really push forward in that direction, thousand of other stuff to do for that show.

OK, after a bit more of tryout.
It’s not working on mine nor a friend MBP which is Mountain Lion 10.8 and GT330M.
It was working on the same MBP under 10.7
it’s working on another friend MBP which is under 10.8.2 and a Radeon graphics cards.
it’s working on my macPro which is 10.7 and has two Radeon (HD5870 and X1900XT)

(ps : repost, my last one was flagged as spam???)

Hey guys, sorry for the really late reply. I"ve just come across this problem myself. After lots of research I’ve come to the conclusion (along with the rest of the internet) that the OpenCL drivers in 10.8 (I’m currently on 10.8.2) is completely buggered (at least for NVidia drivers). The info it’s returning for my Nvidia GT 650M (retina MBP) is completely screwed (clockspeed 0Mhz!) and doesn’t even have OpenCL drivers (so an OpenCL command queue cannot be created).

the good news is, I have found if you install NVidia’s CUDA drivers it seems to work. http://www.nvidia.com/object/cuda-mac-driver.html

I’ve just put a slightly tweaked version at https://github.com/memo/ofxMSAOpenCL
(some of the kernel code needed tweaking to comply with the more strict compilers)

I was having a lot of trouble with this. I use a retina macbook Pro. I installed a utility that let me turn off dynamic graphics card switching. The built in version did not work for me. Once I selected discrete only gfx card it all worked a treat.

Hey, I think I replied to this in another similar thread somewhere.
In short the 10.8.x nvidia drivers are horrible and don’t have CUDA support, so the opencl context isn’t created. Installing NVidias own drivers fixes the problem
http://www.nvidia.com/object/cuda-mac-driver.html

also the current opencl kernel compilers are a bit more strict so make sure you get the latest ofxOpenCL for the latest examples with updated kernels
https://github.com/memo/ofxMSAOpenCL

I have an early 2011 MBP with Intel HD Graphics 3000 512M
So CUDA isn’t handled afaik.
But Intel chipsets go well with openCL, AFAIK…

Is there a way for me to use ofxOpenCL or should I use OpenCL through … Quartz composer ?

Any ideas/experiences would be very great for me.