Crash when enabling Open Shading Language with Cycles on macOS and Apple Silicon M1 #86530
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#86530
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: macOS Big Sur 11.2.3
CPU: Apple M1
Graphics card: Apple M1
Blender Version
Broken: 2.93 alpha on master, built locally, currently at commit
b1ef55abdb
(although older commits also have this issue)Worked: 2.92 Blender Intel version running on Apple M1 via Rosetta 2 does not crash
Short description of error
Enabling Open Shading Language on the Render Properties panel with Render Engine set to Cycles causes an immediate crash.
First noticed this on my own scenes, but can reproduce by just opening blender and using the default scene.
Exact steps for others to reproduce the error
Details gathered so far
I've been building and using Blender successfully after progress was made on #78710 and the Building Blender instructions for Mac were known to work again. My current projects don't need OSL, but was just experimenting when I discovered the crash.
After building an Xcode project and attaching Xcode to my locally built Blender app (again, this is all running on the new Apple M1/ARM64 chip, not Intel), I did find that the crashing thread seems to be in OSL library code:
After reviewing other threads to see if they were doing anything interesting (as opposed to just looping on semaphores or event loops), there is this thread:
This is pretty much the last line of method
ccl::OSLShaderManager::device_update
.Added subscriber: @hargettp
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @2046411367
So, for what it's worth, I changed this line: https://git.blender.org/gitweb/gitweb.cgi/blender.git/blob/HEAD:/intern/cycles/render/osl.cpp#l171
from this call:
ss->optimize_all_groups();
to this call:
ss->optimize_all_groups(1, true);
This basically makes the
optimize_all_groups
synchronous on the calling thread, rather than spread out over multiple threads. Such a change should eliminate thread safety in OSL as a cause.Repeating the test still caused a crash in OSL. This suggests the bug might be in OSL on M1--although I can't rule out we didn't pass a bad data structure or pointer to OSL before this.
Added subscriber: @CookItOff
I can confirm the crash on M1 with the Arm 64 official build.
FYI, filed this ticket for OSL: Crash in optimize_all_groups running in pre-release Blender on Apple Silicon . Not 100% sure its OSL, but hoping for guidance.
This issue was referenced by
33f218fa3f
Changed status from 'Confirmed' to: 'Resolved'
This issue was referenced by None@62619
Yep, solved--ty @brecht !