Snow Leopard

Problem with OpenCL kernel patch

utopianational's picture

Hi,

I'm trying to create a OpenCL kernel but I cannot get it work well. This program is to convert X/Y mouse position queue to an image. It looks work fine, but it gets gradually slower, and finally crashes MacOSX after several minutes.

__kernel void main(__global const float *X,__global const float *Y,__wr image2d_t output)
{
 
 
   int2   pos = (int2)(get_global_id(0), get_global_id(1));
   float4 color;
 
   color.x=X[pos.x]; //R
   color.y=Y[pos.x]; //G
   color.z=0.0; //B
   if(color.x<0)
      color.x=0;
   if(color.y<0)
      color.y=0;
   if(color.x>1)
      color.x=1;
   if(color.y>1)
      color.y=1;      
   write_imagef(output, pos, color);
 
}

I set queue size to 80 in qc, so that it creates 80x1 pixels image.

I found that it gets work well when I continue to click "Sample Now" button in "Advanced Kernel Settings" every minute, but I have no idea to get code work stably. Could you help me?

Cheers

OpenCL Meshes

cybero's picture

I had been studying the Aurora [Rainbow Snow] example recently that was posted up in the Developer Sample Code section sometime ago.

I was peaked to look again when the Iteration degradation problem cropped up earlier this week from itsthejayj.

I already knew that the OpenCL audio spectrum mesh creation routine worked outside of iTunes and produced a pretty mesh ribbon. It completely fails to show inside of iTunes.

Either way, the composition produced a load of Console messages, patches failing and segmentation fault crashes. Even if I attached a static .dae, then the Fog Environment, containing a Camera macro patch, would still bleat a lot , but only if the Audio Peak information were lacking slightly - silent to low points. If only those messages didn't presage the aforementioned crashes, I wouldn't be so worried. The Iterative string of errors doesn't end until the Console is reloaded.

Definitely a structural problem and one that the use of Iterations means keeps repeating even after the Render has been ceased. This behaviour also evidences when running the visualizer in iTunes and not playing any audio. I don't think this is specifically an Open CL, .dae related issue BTW. However, thus far I have not been able to reproduce the problem when replacing the Mesh with a simple Circle.

In fact , the problem seems to to have 'gone away' since I forced the Enable to be on only when Audio was running, whilst I typed up this report / post :-). If anyone can reproduce the problem I'd be interested to hear.

BTW - I do already know that when iTunes stops audio this visualizer kind of freeze frames and the QC Render window blacks out , the iTunes re-renders on fresh audio and the QC needs a stop/ restart on the Render window FYFI :-)

GL Tools 1.3 in Snow Leopard - Resulting Crashes - probably post update 10.6.1

cybero's picture

The following was the resulting output when running GL Tools 1.3 on Snow Leopard and saving a composition from Quartz Composer that had originally been produced on the PPC with GLTools 1.1, then 1.2 and finally 1.3.

iTunes Visualizer was running in the background - probably unimportant. *~ - edit - as it happens, upon closer examination, when iTunes isn't running the crash does not occur - probably down to the queueing of the current data state from the music :-)

This happened in both 32 and 64 bit mode.

The same standard working procedure results in the same type of crash upon the PPC and the crash can be avoided by not explicitly going down this route.

It is being precipitated specifically by having Command + W , or otherwise clicked to close down either the Viewer or Editor window, leaving the other open.

Once this has been done and one is left with the remaining QC window, when one Command + W's to close the remaining window and clicks on the save dialog button, the application crashes.

Work Around

Work can be saved if one saves Command + S at the first of the two open windows, then proceeds to close the remaining window and clicks the Don't Save button.

So I guess this workaround wouldn't be needed if one wasn't working on a Music Visualizer protocol item with iTunes Visualizer running just to see if it really does do what one wanted it to do.

Process:         Quartz Composer [2285]
Path:            /Developer/Applications/Quartz Composer.app/Contents/MacOS/Quartz Composer
Identifier:      com.apple.QuartzComposer.editor
Version:         4.0 (103.1)
Build Info:      QuartzComposerEditor-1030100~1
Code Type:       X86-64 (Native)
Parent Process:  launchd [663]
 
PlugIn Path:       /Users/cybero/Library/Graphics/Quartz Composer Patches/GLTools.plugin/Contents/MacOS/GLTools
PlugIn Identifier: net.kineme.GLTools
PlugIn Version:    1.3 (20090903)
 
Date/Time:       2009-10-22 14:34:53.341 +0100
OS Version:      Mac OS X 10.6.1 (10B504)
Report Version:  6
 
Interval Since Last Report:          75955 sec
Crashes Since Last Report:           5
Per-App Interval Since Last Report:  67750 sec
Per-App Crashes Since Last Report:   5
Anonymous UUID:                      5480A871-6E0B-4AF4-B8DA-1E7DC47D4D1C
 
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread
 
Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   net.kineme.GLTools               0x000000011a3619e3 -[KinemeGLSplinePatch state] + 259
1   com.apple.QuartzComposer         0x00007fff8037fe3f -[GFGraph(Private) _saveState:filterTarget:filterAction:flatten:] + 2829
2   com.apple.QuartzComposer         0x00007fff8037fffd -[GFGraph state] + 420
3   com.apple.QuartzComposer         0x00007fff803cff9b -[QCPatch(Override) state] + 51
4   com.apple.QuartzComposer         0x00007fff8037fe3f -[GFGraph(Private) _saveState:filterTarget:filterAction:flatten:] + 2829
5   com.apple.QuartzComposer         0x00007fff8037fffd -[GFGraph state] + 420
6   com.apple.QuartzComposer         0x00007fff803cff9b -[QCPatch(Override) state] + 51
7   com.apple.QuartzComposer         0x00007fff8037fe3f -[GFGraph(Private) _saveState:filterTarget:filterAction:flatten:] + 2829
8   com.apple.QuartzComposer         0x00007fff8037fffd -[GFGraph state] + 420
9   com.apple.QuartzComposer         0x00007fff803cff9b -[QCPatch(Override) state] + 51
10  com.apple.QuartzComposer         0x00007fff8037fe3f -[GFGraph(Private) _saveState:filterTarget:filterAction:flatten:] + 2829
11  com.apple.QuartzComposer         0x00007fff8037fffd -[GFGraph state] + 420
12  com.apple.QuartzComposer         0x00007fff803cff9b -[QCPatch(Override) state] + 51
13  com.apple.QuartzComposer         0x00007fff8037fe3f -[GFGraph(Private) _saveState:filterTarget:filterAction:flatten:] + 2829
14  com.apple.QuartzComposer         0x00007fff8037fffd -[GFGraph state] + 420
15  com.apple.QuartzComposer         0x00007fff803cff9b -[QCPatch(Override) state] + 51
16  com.apple.QuartzComposer         0x00007fff803d14e9 _PatchToComposition + 794
17  com.apple.QuartzComposer         0x00007fff803cdc2d -[QCView saveComposition:] + 56
18  com.apple.QuartzComposer         0x00007fff803cdccb -[QCView saveCompositionToFile:flatten:] + 57
19  com.apple.AppKit                 0x00007fff8608be36 -[NSDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:] + 210
20  com.apple.AppKit                 0x00007fff8608fdfa -[NSDocument _writeSafelyToURL:ofType:forSaveOperation:error:] + 281
21  com.apple.AppKit                 0x00007fff8608f1f8 -[NSDocument writeSafelyToURL:ofType:forSaveOperation:error:] + 359
22  com.apple.AppKit                 0x00007fff8608a57e -[NSDocument saveToURL:ofType:forSaveOperation:error:] + 168
23  ...apple.QuartzComposer.editor   0x000000010000e6c1 0x100000000 + 59073
24  com.apple.AppKit                 0x00007fff8608d62c -[NSDocument _saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:] + 85
25  com.apple.AppKit                 0x00007fff8608a85f -[NSDocument saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:] + 683
26  com.apple.AppKit                 0x00007fff8608ece0 -[NSDocument _saveDocumentWithDelegate:didSaveSelector:contextInfo:] + 852
27  com.apple.AppKit                 0x00007fff8608ab77 -[NSDocument saveDocumentWithDelegate:didSaveSelector:contextInfo:] + 292
28  ...apple.QuartzComposer.editor   0x000000010000e607 0x100000000 + 58887
29  com.apple.AppKit                 0x00007fff8608c807 -[NSDocument _closeAlertSheet:wasPresentedWithResult:inContext:] + 99
30  com.apple.AppKit                 0x00007fff85fb482c -[NSAlert didEndSheet:returnCode:contextInfo:] + 104
31  com.apple.AppKit                 0x00007fff85fa39f9 -[NSApplication endSheet:returnCode:] + 321
32  com.apple.AppKit                 0x00007fff85f9ce31 -[NSAlert buttonPressed:] + 264
33  com.apple.AppKit                 0x00007fff85eb623e -[NSApplication sendAction:to:from:] + 95
34  com.apple.AppKit                 0x00007fff85eb619d -[NSControl sendAction:to:] + 94
35  com.apple.AppKit                 0x00007fff85f4168b -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 1715
36  com.apple.AppKit                 0x00007fff85f721a3 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 555
37  com.apple.AppKit                 0x00007fff85f40135 -[NSControl mouseDown:] + 624
38  com.apple.AppKit                 0x00007fff85e5a967 -[NSWindow sendEvent:] + 5409
39  com.apple.AppKit                 0x00007fff85d90122 -[NSApplication sendEvent:] + 4717
40  ...apple.QuartzComposer.editor   0x000000010000a994 0x100000000 + 43412
41  com.apple.AppKit                 0x00007fff85d26acc -[NSApplication run] + 474
42  ...apple.QuartzComposer.editor   0x0000000100001d2b 0x100000000 + 7467
43  com.apple.AppKit                 0x00007fff85d1f798 NSApplicationMain + 364
44  ...apple.QuartzComposer.editor   0x0000000100001258 0x100000000 + 4696
 
Thread 1:  Dispatch queue: com.apple.libdispatch-manager
0   libSystem.B.dylib                0x00007fff8423db16 kevent + 10
1   libSystem.B.dylib                0x00007fff8423fa19 _dispatch_mgr_invoke + 154
2   libSystem.B.dylib                0x00007fff8423f6d6 _dispatch_queue_invoke + 195
3   libSystem.B.dylib                0x00007fff8423f1f6 _dispatch_worker_thread2 + 244
4   libSystem.B.dylib                0x00007fff8423eb28 _pthread_wqthread + 353
5   libSystem.B.dylib                0x00007fff8423e9c5 start_wqthread + 13
 
Thread 2:
0   libSystem.B.dylib                0x00007fff8423e94a __workq_kernreturn + 10
1   libSystem.B.dylib                0x00007fff8423ed5c _pthread_wqthread + 917
2   libSystem.B.dylib                0x00007fff8423e9c5 start_wqthread + 13
 
Thread 3:
0   libSystem.B.dylib                0x00007fff8423e94a __workq_kernreturn + 10
1   libSystem.B.dylib                0x00007fff8423ed5c _pthread_wqthread + 917
2   libSystem.B.dylib                0x00007fff8423e9c5 start_wqthread + 13
 
Thread 4:
0   libSystem.B.dylib                0x00007fff8425f9c6 __semwait_signal + 10
1   libSystem.B.dylib                0x00007fff8425f855 nanosleep + 148
2   libSystem.B.dylib                0x00007fff8425f7bf usleep + 57
3   com.apple.AppKit                 0x00007fff85eac702 -[NSUIHeartBeat _heartBeatThread:] + 1540
4   com.apple.Foundation             0x00007fff80abcf65 __NSThread__main__ + 1429
5   libSystem.B.dylib                0x00007fff8425df66 _pthread_start + 331
6   libSystem.B.dylib                0x00007fff8425de19 thread_start + 13
 
Thread 5:
0   libSystem.B.dylib                0x00007fff8423e94a __workq_kernreturn + 10
1   libSystem.B.dylib                0x00007fff8423ed5c _pthread_wqthread + 917
2   libSystem.B.dylib                0x00007fff8423e9c5 start_wqthread + 13
 
Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000000  rcx: 0x0000000119c08670  rdx: 0x0000000000000007
  rdi: 0x000000011a384550  rsi: 0x00007fff86450968  rbp: 0x00007fff5fbfe170  rsp: 0x00007fff5fbfe100
   r8: 0x000000011a384550   r9: 0x0000000000000000  r10: 0x00007fff80aaeda2  r11: 0x0000000100217570
  r12: 0x0000000119c08670  r13: 0x0000000000000000  r14: 0x0000000119e60c80  r15: 0x00007fff8207f568
  rip: 0x000000011a3619e3  rfl: 0x0000000000010206  cr2: 0x0000000000000000

Is it SL Compatible or Broken (?), Plug-Ins / Patches - Discussion

gtoledo3's picture

After some back and forth with Offonoll, it came to mind that a forum topic needed to be started which catalogues in one central location what does or doesn't work in QC4, Snow Leopard, that did work in QC3.

I'm not talking about aberrations in the app itself (like Editor or Viewer issues), but about issues with plug-ins and patches. I would also like this to apply to Apple "patches"; the stock ones, available via the the QC patch library interface.

(Do not devolve into discussing app bugs that involved the Editor or Viewer, focus of app windows, etc., if possible.)

It would be great if people could use this as a thread to gather all of this info into one place, for easy reference.

Some thoughts to keep this as constructive as possible:

-A plugin/patch may appear to work, but may have various functions or "sub-patches" that work improperly. That said, it's not always going to be a straightforward answer about whether a plugin or patch works or doesn't work. We will probably see many that work "overall" but with some lingering broken functionality.

-Please indicate if you are running QC in 32 bit mode of 64 bit mode.

Some plugins and patches will run fine in QC, when the QC app is run in 32 bit mode, but won't run in 64 bit. Find the app in your Developer folder, do a "get info" and check the 32 bit mode to run in 32 bit).

-Indicate what OS version you are running. ("Apple" logo on the menu bar/ "about this Mac".)

-Generality doesn't help, while specificity does. Be as specific as possible about what you were doing when something didn't work, and possibly include sample qtz's or other needed code.

No one shall write "yo, ___ doesn't work". Pretty please.

-This isn't explicitly about Kineme patches at all.

This is about ALL patches, mainly 3rd party, obscure and rare ones, Kineme or otherwise, but also function that is broken in Apple patches, if applicable. It would also be more productive if this wasn't only centered on what is broken, but also what has been vetted to work well; if something works perfectly in your estimation, please share that info.

Similarly, if anyone notes that any bugs can be mitigated by following certain steps (eg., it works when QC is run in 32 bit, but not 64 bit, or another plugin of feature has superseded the old one), please let that be known as well.

Let's try to keep new patches/features out of this, or it could simply turn into a discussion about OpenCL issues.

Snow Leopard and Leopard update Performance Update 1.0

cybero's picture

Snow Leopard and Leopard update Performance Update 1.0 is now available - addressing hard drive - performance freeze issues - see http://support.apple.com/kb/HT3901 - just might help with some , but probably by no means all reported freeze up issues.

Does require a restart.