GPU Metal Render fails with error "CommandBuffer Failed: cycles metal integrator_ reset" on M2 MacBook Air #101787
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
10 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#101787
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-13.0-arm64-arm-64bit 64 Bits
Graphics card: Apple M2 Apple 4.1 Metal - 83
Blender Version
Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash:
b292cfe5a9
Worked: -
Short description of error
Certain scenes fail to render under GPU Metal on the M2 MacBook Air.
Exact steps for others to reproduce the error
The scene renders without issue if the Device in Render Properties is set to CPU.
The scene also renders without issue if 'Apple M2' is enabled and 'Apple M2 (GPU - 8 cores)' is disabled in Cycles Render Devices in Preferences.
Enabling 'MetalRT' in Preferences results in the same error.
Added subscriber: @stephenthomas
I have a M1 Mac Mini at the office that's running macOS 12, I'll try rendering on that today to see if the same issue occurs.
Crashes with the same error on the mini. Details:
Mac mini (M1, 2020) - 8GB Memory
macOS 12.6
Blender 3.3.0
Added subscriber: @OmarEmaraDev
Changed status from 'Needs Triage' to: 'Needs User Info'
Seems similar to #97065, #97155, and #101556.
Could this be an insufficient memory issue as mentioned in one of the reports? Does the M2 have 8 GB of memory as well? Can you monitor total memory usage during rendering and check if the crash happens at a particular point?
Hey Omar,
Yes, both machines have 8GB of memory. Have just checked and it does look like it could be a memory issue, here's a screen recording of the render and activity monitor:
Screen Recording 2022-10-13 at 14.35.34.mov
Blender's memory usage peaks at 13.79GB. Although there isn't an 'insufficient memory' error like in https://developer.blender.org/T97155, I'd guess this is the issue.
Changed status from 'Needs User Info' to: 'Needs Triage'
I can't view the above video for some reason. But as far as I can see in the code, the device should be able to tell us if it can't allocate a buffer with a
System is out of GPU memory
error.But I guess it is possible that it does other unguarded allocations internally. Maybe someone with a Mac can reproduce and investigate this better.
Ah, sorry it isn’t playing for you. Here’s a screenshot at the point where it crashes
No memory errors, just lots of CommandBuffer Failed errors
Added subscriber: @Oversun
The same issue on MacBook Pro M1 with 16gb ram, if any blender files have exceed memory more then available ram have the same issue with CommandBuffer
Thanks Valentin, useful to know that it’s happening on your MBP too. It’s surprising to hear that 16GB isn’t enough to render this shot though, especially considering there’s some extra wiggle room with swap (Blender got up to just under 14GB with me).
Just looking at your terminal screenshot and maybe I’m reading it wrong, but it looks like your memory usage peaks at 13.5GB? That’s quite a bit below 16GB
Yes but other free ram is occupied by other apps and system itself, so its look like that Metal driver can't normally work when swap is active, the same issue I faced in Linux on CPU rendering with Dynamic Swap allocation, I don't think that's the same issue but similar one.
With CPU only this file is rendering as expected
Your demo file from this topic I was rendering as expected without any errors, so I think we need some Blender reference file that can occupy more than 16GB ram for example for reproduce it on 16ram Mac.
Ah, I thought the screenshot you posted was from rendering the file I linked to, that's why I was confused 16GB couldn't handle it. If that's the case, it looks like it is just an issue of Blender running out of memory, bit odd that it's not throwing up an appropriate error though.
Added subscriber: @iss
Changed status from 'Needs Triage' to: 'Needs User Info'
Just a note, that crash due to running out of memory are currently not considered to be a bug. If this is not issue with available memory, such big and complex .blend files are not accepted for bug reports and should be simplified as much as possible.
Please try to simplify .blend file as much as possible and see if this is caused by particular object, or if issue comes whenever some memory limit is exceeded.
Good thinking Richard, best to be sure. I should have some time over the weekend to experiment, will let you know how I get on.
I think out of physical memory should not be a problem for Blender because we have a swap for this, Blender can handle this situation on CPU rendering without any problems so maybe it can work like this for Metal as well.
I think this is not a specific object in scene because sample scene from this post described in overview is rendering without problems on 16gb ram Mac M1. So my little opinion
that is the dynamic swap allocation handling memory issue that I faced on Linux OS with Dynamic Swap allocation for CPU render when blend file have reach physical memory and kernel try to allocate dynamic swap size for Blender
and i don't know how to set on Mac a static swap size because its simple solve this issue for CPU rendering on Linux with Dynamic Swap size allocation, maybe if you know ho to do that I can try to reproduce this on my Mac. Of course
I can mistake because really don't know how its implemented under the hood.
Very good point. I’ll do some poking around anyway to be sure though.
I don’t think macOS lets you change the swap size: https://discussions.apple.com/thread/7509515
Yes, that’s my thinking too, with unified memory and all the CPU and GPU should have access to the same pool of memory. The scene renders without issue on the CPU. The question is: Is Metal supposed to work with memory the same way independent of compute device? If so, this could be a bug. If not, it would be a feature request/improvement.
I've experimented with disabling collections to see if anything in particular causes the crash, can confirm that all collections render fine individually, the crash occurs when too many are enabled at the same time (i.e. taking up too much memory). Still can't see any memory warnings in the terminal, but one of the crashes managed to write out a crash report, see below
Blender 2.crash.txt
It's a separate issue, maybe hair rendering hasn't been implemented for Metal yet, but the girls hair isn't rendering for me. If this is an error, please let me know and I'll submit a separate bug report for this. No settings were changed from the original download (except for disabling collections) and the hair renders correctly on the CPU.
Changed status from 'Needs User Info' to: 'Needs Triage'
Added subscribers: @Michael-Jones, @brecht
Sure, Blender would likely be able to handle swapping, but I don't think Metal can work with swap. However I can't find any resources on this topic.
Not familiar with Metal pipeline at all, but crash log seems to point in crash in Metal itself. So I would assume with aditional info that this happens due to insuficient physical memory. So I don't think this is a bug, but I would rather defer to @brecht or @Michael-Jones to have a look.
Added subscriber: @duduchier
Hello !
I run
I randomly but often get:
CommandBuffer Failed: cycles_metal_integrator_queued_paths_array
Impossible to entirely render a short animation containing atmospheric haze, 6 layers and compositing (denoise etc).
I think the rendering cannot be run again until I quit (not sure anymore).
Resizing in % the render resolution, does not solve the problem.
Changing the out file type neither.
But no crash until I ask to quit myself.
I always get the same crash log:
———————————>
Crashed Thread: 22
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000018f02e3ec
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process: exc handler [628]
Kernel Triage:
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
———————————
Thread 22 Crashed:
0 libsystem_c.dylib 0x18f02e3ec __abort + 160
1 libsystem_c.dylib 0x18f02e3ec __abort + 160
2 libsystem_c.dylib 0x18f02e34c abort + 180
3 libsystem_c.dylib 0x18f02d754 __assert_rtn + 272
4 Metal 0x197aeadd8 MTLReportFailure.cold.1 + 56
5 Metal 0x197ad4790 MTLReportFailure + 480
6 Metal 0x197a27178 -[_MTLCommandEncoder dealloc] + 128
7 AGXMetalG13X 0x1d5cf683c 0x1d5b14000 + 1976380
8 libobjc.A.dylib 0x18ef812b4 AutoreleasePoolPage::releaseUntil(objc_object**) + 196
9 libobjc.A.dylib 0x18ef7db34 objc_autoreleasePoolPop + 212
10 libobjc.A.dylib 0x18ef86218 AutoreleasePoolPage::tls_dealloc(void*) + 136
11 libsystem_pthread.dylib 0x18f0f1bd4 _pthread_tsd_cleanup + 524
12 libsystem_pthread.dylib 0x18f0f4968 _pthread_exit + 84
13 libsystem_pthread.dylib 0x18f0f4278 _pthread_start + 160
14 libsystem_pthread.dylib 0x18f0ef08c thread_start + 8
Thanks Duduche, that’s really useful to know.
With this new information and seeing as the crash doesn’t mention memory, it seems like a low amount of memory makes this kind of crash more common rather than being the cause.
Hello again,
FYI, I am not 100% sure yet but it seems that setting up the Cycles renderer with:
solves the problem.
"features set" -> "GPU "experimental" may create the error and stop the rendering.
I still need to try again soon to be sure.
Unfortunately that's not the case for me.
It could be that the experimental feature set for your scene is resulting in greater memory usage, so while switching it on is causing the crash, it's not the direct cause.
Added subscriber: @2Face
Previously I had the same issue, I managed to get Cycles to render on
without a problem, but I don't know if it might work for others cus I am running a particle simulation. I managed to do this by baking the particles. The Blend file I used is attached. Christmas Tree.blend
Thanks Rajin, that’s useful to hear, I’ll see if I can do a test when I’m in the office tomorrow.
Also, I had a crash with this error on a project today. Unfortunately I won’t be able to share the project file, but the project is quite light (only simple meshes and SVG artwork). The crash didn’t occur until well into the render (frame 400, starting at 1). I’ll do some testing as soon as I can and hopefully get back with some useful information.
Added subscriber: @Fellipe-Oliveira
I was also experiencing the same problem, I have a MacBook Pro M1 8Gb RAM. Every time I tried to render using the GPU, the same error that appears for you appears. Until I decided to optimize the render so that it doesn't use a lot of RAM, and it worked. You can reduce the tile size, this helps a lot in the optimization. Now I can render normally using the M1 GPU.
This issue was referenced by
2dc51fccb8
Changed status from 'Needs Triage' to: 'Resolved'
Hey! Blender 3.6. MBP 16 gb. Scene I've just modeled, renders fine in 3.5 version, same as viewport render view. On 3.6 stuck on loading kernels and nothing happens.. can't get back to any other viewport, blender need to be shut.. In 3.6 if i go to CPU, then it's ok, on 3.5 does't matter if its cpu or gpu.. !3.6.1 same issues.
Hey @Grigorij-Mancinskij, sorry to hear you're getting crashes. This bug report has been resolved and closed, it'll probably be best to create a new bug report.