On Thu, Aug 16, 2012 at 02:39:48PM -0400, Tom Stellard wrote: > On Thu, Aug 16, 2012 at 07:44:53PM +0200, Mathias Fröhlich wrote: > > > > Hi, > > > > > This is likely caused by the fact that the same LLVM Context is used > > > for all threads. Take a look at the comment starting at > > > src/gallium/auxilary/gallivm/lp_bld_init.c:314 > > > > > > You should be able to reproduce this error on llvmpipe as well. > > > Creating a new LLVM Context for each thread should fix this. > > > > I checked the suggestion, but: Are you sure? > > I think we are using a new context for r* even per compile. > > See radeon_setup_tgsi_llvm.c:1009. > > > > You're right. I missed that. > > > I have spent some time now to look into this a little closer: > > The observation is that some pass manager stuff is crashing usually. > > Its from the addPassesToEmitFile call while setting up > > AMDGPUTargetMachine but if you lock just this it crashes mostly in > > LLVMAddPromoteMemoryToRegisterPass called from radeon_llvm_finalize_module. > > Locking both with the same mutex appears to work for a few short tests. > > > > Does this ring an other bell at the llvm guys? > > >
Actually, I just noticed that the LLVM docs say that only one thread can access the target registry at a time: http://llvm.org/docs/doxygen/html/structllvm_1_1TargetRegistry.html#a0b078b468553a84ec2b9fd70e93f7b43 Also, I think we should be doing the target registry once per context rather than once per compile. -Tom > I'm not really sure about this one. It might be worth while to see if > you can reproduce the bug with the r600 backend built with LLVM rather > than Mesa. I have LLVM and Mesa branches that make this possible: > > LLVM: http://cgit.freedesktop.org/~tstellar/llvm/ r600-master > Mesa: cgit.freedesktop.org/~tstellar/mesa/ r600-external-llvm > > I haven't tested it in a while, though, so it may not work. > > -Tom > > > > > Greetings > > > > Mathias > > > > > > _______________________________________________ > > mesa-dev mailing list > > [email protected] > > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > > > > _______________________________________________ > mesa-dev mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
