AcademySoftwareFoundation / OpenShadingLanguage

Advanced shading language for production GI renderers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash in optimize_all_groups running in pre-release Blender on Apple Silicon

hargettp opened this issue · comments

Problem

I've been running pre-release Blender on Apple Silicon, and found this bug: Crash when enabling Open Shading Language with Cycles on macOS and Apple Silicon M1.

Thinking the issue might be thread-safety, I've even modified Blender to run optimize_all_groups synchronously on the current thread (by passing 1 for the first arg), rather than the typical multi-threaded variant. Still getting a crash when that happens, leading me to think the issue may be in OSL on Apple Silicon.

The issue has been confirmed in the current pre-release builds of Blender available here.

Note that Blender uses pre-built versions of dependencies (OSL and LLVM at a minimum are relevant here), so yes there can be problems upstream of Blender but downstream of OSL. At the moment, I've not yet been able to build OSL from source, so have not been able to debug further.

I get that its hard to know if this is Blender or OSL--mostly looking for guidance. Thanks!

Expected behavior:

No crash.

Actual behavior:

Consistent crash.

Steps to Reproduce

Copied from Blender ticket:

  1. Open Blender, just use default scene
  2. Set Viewport shading to Rendered Preview (so that Cycles results can be previewed in real-time)
  3. On Render Properties panel, set Render Engine to Cycles (leave CPU selected)
  4. On Render Properties panel, check the "Open Shading Language" checkbox
  5. Crash

Versions

  • OSL branch/version: 1.11
  • OS: macOS Big Sur (on Apple Silicon)
  • C++ compiler: clang 12.0
  • LLVM version: 11.0.1
  • OIIO version: 2.1.15

Okay, we've applied a patch to OSL on the Blender side that has solved this. Might be worth reviewing for inclusion in OSL here. https://developer.blender.org/rBL62619.

Submitted for review in #1361.

Fixed by #1361