libdxcompiler.so
locks up when used in many threads at once
#4792
Milestone
libdxcompiler.so
locks up when used in many threads at once
#4792
We're parallelizing our shader (asset) builds and hit a snag where - on Linux - this process locks up fairly often. With some debugging in
gdb
we've pinpointed the issue to reside insideCALL_ONCE_INITIALIZATION
on astatic volatile
:DirectXShaderCompiler/include/llvm/PassSupport.h
Lines 36 to 54 in 6dd31be
All threads are either stuck on the
MemoryFence()
, orinitializeLoopSimplifyPass
directly above that:Without diving into the code and whether this may or may not be free of race conditions or not guarantee forward progress, I forward-ported some of the upstream LLVM changes to at least use
std::call_once
instead of this custom implementation in https://github.com/MarijnS95/DirectXShaderCompiler/compare/import-llvm_once-upstream-changes. Unfortunately this also locks up:(Note that this happened to be a
RelWithDebInfo
build versusRelease
above, but does not change the outcome)Fortunately we also stumbled upon https://reviews.llvm.org/D19271: this patch has not yet been applied, but is much simpler in design by replacing the entire
call_once
logic with a simplestatic
initializer through a lambda expression. We are now running with this and have not yet observed any erratic behaviour.Additional context
DXC was tested on the latest commit as of yesterday: 24ca1f4
The text was updated successfully, but these errors were encountered: