Cycles Metal crash with simultaneous viewport and final render #94142
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
12 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#94142
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-12.0.1-arm64-arm-64bit 64 Bits
Graphics card: Apple M1 Apple 4.1 Metal - 76.1
Blender Version
Broken: version: 3.1.0 Alpha, branch: master, commit date: 2021-12-15 00:57, hash:
67b657f07c
Worked: none (testing the new Metal renderer)
Short description of error
Blender crashes when using Cycles with Metal GPU in both viewport and renderer
Exact steps for others to reproduce the error
human001-no-texture.blend
Added subscriber: @FrederikDeBleser
I've attached the crash report:
2021-12-15-blender-crash-report.txt
Added subscriber: @JurgenS-4
I have tested with this file and on my Mac mini M1 16 GB with the same build of blender, sometimes it works fine and other times it indeed chrashed.
Added subscriber: @Staars
More or less the same here.
When I wait for the viewport to finish the render completely (checking with start option
--verbose 2
in the console), I can finish the first render and even finish a second render with that method. But when I want to close the render window the second time, I get a crash too.Added subscriber: @hatchli
Added subscribers: @Michael-Jones, @brecht
CC @michael_jones.
Added subscriber: @Caden-Mitchell
I also get a crash. With GPU only set in preferences and with CPU+GPU set. My scene also consumes ~30 GB of memory when rendering so maybe it is too advanced for the current Metal GPU render anyways? M1 16 GB RAM, macOS Monterey. It crashes on default cube, too.
Added subscriber: @michael64
The render on M1 with cycles crash with GPU compute came through
35b1e9fc
.Running Blender in Xcode revealed a few error lines about missing explicit address space qualifiers.
Adding ccl_private in front of every type that was incomplete as in the other shaders was enough to fix the crash.
Please note that I have not tested if the point cloud actually works on M1 (no test scene at hand).
The patch is D13612.
Also #94182 can probably merged into this report.
This issue was referenced by blender/cycles@f60ff20029
This issue was referenced by
67734d1853
Changed status from 'Needs Triage' to: 'Resolved'
Changed status from 'Resolved' to: 'Needs Triage'
This report predates point cloud rendering so must have a different cause.
Blender crashes when using Cycles with Metal GPU in both viewport and rendererto Cycles crash with simultaneous viewport and final renderCycles crash with simultaneous viewport and final renderto Cycles Metal crash with simultaneous viewport and final renderI forgot to mention the root cause of the crash which I have also seen before the combined M1 + M1 GPU worked.
These crashes happen in intern/cycles/device/metal/kernel.mm:379 'string errors = [err UTF8String];' at the moment:
The Metal compiler fails for example when the shader source is incorrent there may be other reasons as well.
Both kernels (device->mtlLibrary[kernel_type]) are therefore nil.
This method call is made on a nil object which is not a bad Objective-C style btw. but a common idiom.
But in this case -[newFunctionWithDescriptor:desc:error] returns nil but *error is also nil.
'[error localizedDescription];' is still ok and returns nil but then [err UTF8String] crashes when err is nil.
That was what I meant, there are different ways to fail a Metal library compilation but so far they all crashed at this line:
That could be made more robust.
Also if the environment variable CYCLES_METAL_DUMP_SOURCE is set the source is dumped.
Maybe it is a good idea for the moment to save the metal source string and if this error condition is reached
the metal source is dumped even if CYCLES_METAL_DUMP_SOURCE is not set.
As a workaround, this crash can be fixed by setting the environment variable:
CYCLES_METAL_DISABLE_BINARY_ARCHIVES="1"
It occurs when additional instances of the same underlying Pipeline State Objects are created in order to do multi-instanced rendering. Pending further investigations as to the root cause...
Added subscriber: @deadpin
Changed status from 'Needs Triage' to: 'Confirmed'
Will at least confirm this report based on the previous comment.
Will mark as high priority, since there is a workaround we can do for the 3.1 release.
Changed status from 'Confirmed' to: 'Resolved'
Added subscriber: @Carter-LaSalle
I am also having this issue am I am using:
Blender Version: 3.2.0 Alpha, master, 2022-02-20 02:31,
1f79132287
OS: macOS-12.3-arm64-arm-64bit
GPU: Apple M1 Pro Apple 4.1 Metal - 76.3
@Carter-LaSalle this bug is supposed to be fixed, if you still encounter it please open a new bug report with example .blend file.
Removed subscriber: @Caden-Mitchell
Added subscriber: @jackattack
Im still having the exact same issue. Not only is blender crashing for me- my whole computer crashes. Has this maybe resolved? or is there a different thread i can read about the topic?
When rendering in cycles with metal GPU and having viewport also in cycles everything freezes and crashes...
Blender Version: 3.3.1
I mac 2020, Retina, 27"
Processor: 3.6 GHz 10-Core Intel Core i9
Graphic card: AMD Radeon Pro 5700 8 GB
Ram: 16 GB 2667 MHz DDR4
OS ventura 13.0.1
Workaround at the moment is to not have the viewport in cycles when rendering in cycles
Thank you allready :)
@jackattack , thanks for the report. I was unable to reproduce the issue on an M1 Max laptop with 64GB shared memory so I think the root cause may be different. One thing that springs to mind: the Metal backend doesn't handle out-of-memory cases very gracefully yet, so it's possible that doing two renders overflows your GPU's 8GB of VRAM, but one render is okay. Do you know roughly how much memory your scene uses?