From: Alan H. <al...@re...> - 2002-06-28 18:00:10
|
That patch works here. As for debugging, you need to link crfaker.so to libGL.so then instead of running crappfaker, run the actual application. Oh, and ensure your LD_LIBRARY_PATH is set to the linked libGL.so. Alan. On Fri, Jun 28, 2002 at 10:43:55AM -0700, Mike Houston wrote: > Still a no go. Anyone know of a way in linux to effectively debug a > parallel app? If I use the debug directory method, the second instance > just dies. I also noticed that if I dump the call to draw pixels and just > do a clear and a swap buffers, crserver still does not put up a window. > > I can try to emulate the readback spu closer sine it seems to create it's > own context now. It didn't used to need to do so. I'm guessing that the > multi-context and multi-threaded stuff has muddied the simplicity of > writing certain spus. > > I would love to provide a "localhost" version of bswap, but the network > layer doesn't figure out what to do correctly if you specify a node to > connect to as "tcpip://localhost" > > -Mike > > On Fri, 28 Jun 2002, Alan Hourihane wrote: > > > On Fri, Jun 28, 2002 at 10:34:43AM +0100, Alan Hourihane wrote: > > > On Thu, Jun 27, 2002 at 05:42:18PM -0700, Mike Houston wrote: > > > > DrawPixels is still hosed in the binaryswap spu. crappfaker just dies on > > > > the call. I'm having a heck of a time debugging this since it is a > > > > parallel app. If I try to use the debug directory method that usually > > > > works, the mothership gets very confused and the second instance of > > > > crappfaker cannot find the OpenGL libs. Or, if I'm really unlucky, gdb > > > > segfaults. > > > > > > DrawPixels is hosed in the binaryswap spu as it never creates a context. > > > Therefore when DrawPixels hits the packspu it can't resolve the > > > client-side state to pick up the packing requirements for the DrawPixels > > > call. i.e. thread->currentContext is NULL, and so trying to grab > > > the ->clientState causes the segfault. > > > > > > I don't know whether this should be handled in the binaryswapspu or > > > not, but I've attached a fix to the packspu below which corrects > > > the fault. We actually end up creating the default context in the > > > packspu's init routine, and make that current. > > > > > > This will also need massaging into the tilesortSPU too. If no one > > > disagrees with the patch below - I'll fix the tilesortSPU too. > > > > Ignore that last patch. More testing less speed... > > > > Use this one instead. > > > > Alan. > > > > Index: packspu_context.c > > =================================================================== > > RCS file: /cvsroot/chromium/cr/spu/pack/packspu_context.c,v > > retrieving revision 1.11 > > diff -u -r1.11 packspu_context.c > > --- packspu_context.c 21 Jun 2002 14:40:35 -0000 1.11 > > +++ packspu_context.c 28 Jun 2002 09:51:36 -0000 > > @@ -171,12 +171,12 @@ > > > > crStateDestroyContext( context->clientState ); > > > > - context->clientState = NULL; > > context->serverCtx = 0; > > + context->clientState = NULL; > > > > if (thread->currentContext == context) { > > - thread->currentContext = NULL; > > - crStateMakeCurrent( NULL ); > > + thread->currentContext = &pack_spu.context[0]; > > + crStateMakeCurrent( pack_spu.context[0].clientState ); > > } > > } > > > > @@ -209,8 +209,8 @@ > > serverCtx = pack_spu.context[slot].serverCtx; > > } > > else { > > - thread->currentContext = NULL; > > - crStateMakeCurrent( NULL ); > > + thread->currentContext = &pack_spu.context[0]; > > + crStateMakeCurrent( pack_spu.context[0].clientState ); > > newCtx = NULL; > > serverCtx = 0; > > } > > Index: packspu_init.c > > =================================================================== > > RCS file: /cvsroot/chromium/cr/spu/pack/packspu_init.c,v > > retrieving revision 1.14 > > diff -u -r1.14 packspu_init.c > > --- packspu_init.c 27 May 2002 15:35:10 -0000 1.14 > > +++ packspu_init.c 28 Jun 2002 09:51:36 -0000 > > @@ -50,7 +50,16 @@ > > CRASSERT( thread == &(pack_spu.thread[0]) ); > > > > packspuCreateFunctions(); > > + > > crStateInit(); > > + > > + pack_spu.context[0].clientState = crStateCreateContext( &pack_spu.limits ); > > + > > + crStateMakeCurrent( pack_spu.context[0].clientState ); > > + > > + thread->currentContext = &pack_spu.context[0]; > > + > > + pack_spu.numContexts++; > > > > return &pack_functions; > > } > > |