OpenShadingLanguage icon indicating copy to clipboard operation
OpenShadingLanguage copied to clipboard

[BUG] Bad parallel performance when optimizing a group

Open fluidray opened this issue 6 months ago • 0 comments

Describe the bug

In Windows, when optimizing a shader group in parallel, the performance is almost as the optimization is performed sequentially.

I tracked down the problem, in src\liboslexec\llvm_instance.cpp.

In the block inside if (use_rs_bitcode()) { the call to ll.validate_global_mappings(names_of_unmapped_globals); triggers a global lock inside llvm.

commenting out the validation solves the problem. A possible solution would be to have an option to turn off validation, so I can turn it on only during debugging.

OSL version and dependencies

  • OSL branch/version: 1.14.5.1
  • OS: Windows
  • C++ compiler: MSVC 2022
  • LLVM version: 19.1.7
  • OIIO version: 3.0.2

fluidray avatar Jul 02 '25 09:07 fluidray