Blender 3.1 beta crashes when trying to render on the GPU with Metal #95477

Closed
opened 2022-02-03 17:42:55 +01:00 by cotooleimages@gmail.com · 14 comments

System Information
Operating system: macOS-12.1-arm64-arm-64bit 64 Bits
Graphics card: Apple M1 Max Apple 4.1 Metal - 76.3

Blender Version
Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-02 15:25, hash: 43b0ff3054
Worked: 3.1 beta (on CPU)

Short description of error
Whenever I try to render this scene on the GPU with Metal, Blender crashes (it renders fine on the CPU).

Exact steps for others to reproduce the error
Just render the scene on the GPU with Metal

Interstellar try1.blend

**System Information** Operating system: macOS-12.1-arm64-arm-64bit 64 Bits Graphics card: Apple M1 Max Apple 4.1 Metal - 76.3 **Blender Version** Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-02 15:25, hash: `43b0ff3054` Worked: 3.1 beta (on CPU) **Short description of error** Whenever I try to render this scene on the GPU with Metal, Blender crashes (it renders fine on the CPU). **Exact steps for others to reproduce the error** Just render the scene on the GPU with Metal [Interstellar try1.blend](https://archive.blender.org/developer/F12844033/Interstellar_try1.blend)

Added subscriber: @BlenderChris

Added subscriber: @BlenderChris
Member

Added subscribers: @mano-wii, @PratikPB2123

Added subscribers: @mano-wii, @PratikPB2123
Member

@mano-wii , can you check?

@mano-wii , can you check?

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Added subscriber: @Michael-Jones

Added subscriber: @Michael-Jones

I can confirm a crash in ccl::MetalDevice::tex_alloc:

__pthread_kill (@__pthread_kill:5)
pthread_kill (@pthread_kill:75)
abort (@abort:44)
__assert_rtn (@__assert_rtn:56)
MTLReportFailure.cold.1 (@bool MTLGetEnvCase<MTLErrorModeType>(char const*, MTLErrorModeType&, std::__1::vector<std::__1::pair<char const*, MTLErrorModeType>, std::__1::allocator<std::__1::pair<char const*, MTLErrorModeType> > > const&) (.cold.1):3)
MTLReportFailure (@MTLReportFailure:122)
_MTLMessageContextEnd (@_MTLMessageContextEnd:270)
-[MTLTextureDescriptorInternal validateWithDevice:] (@-[MTLTextureDescriptorInternal validateWithDevice:]:646)
___lldb_unnamed_symbol5130 (@___lldb_unnamed_symbol5130:20)
ccl::MetalDevice::tex_alloc(ccl::device_texture&) (/Users/germanocavalcante/blender-git/blender/intern/cycles/device/metal/device_impl.mm:890)
ccl::MultiDevice::mem_copy_to(ccl::device_memory&) (/Users/germanocavalcante/blender-git/blender/intern/cycles/device/multi/device.cpp:307)
ccl::ImageManager::device_load_image(ccl::Device*, ccl::Scene*, int, ccl::Progress*) (/Users/germanocavalcante/blender-git/blender/intern/cycles/scene/image.cpp:777)
std::__1::__function::__value_func<void ()>::operator()() const (/Users/germanocavalcante/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/functional:1885)
std::__1::function<void ()>::operator()() const (/Users/germanocavalcante/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/functional:2560)
tbb::internal::function_task<std::__1::function<void ()> >::execute() (/Users/germanocavalcante/blender-git/lib/darwin_arm64/tbb/include/tbb/task.h:1059)
tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) (@tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long):113)
tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*) (@tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*):49)
tbb::internal::arena::process(tbb::internal::generic_scheduler&) (@tbb::internal::arena::process(tbb::internal::generic_scheduler&):66)
tbb::internal::market::process(rml::job&) (@tbb::internal::market::process(rml::job&):13)
tbb::internal::rml::private_worker::run() (@tbb::internal::rml::private_worker::run():75)
tbb::internal::rml::private_worker::thread_routine(void*) (@tbb::internal::rml::private_worker::thread_routine(void*):6)
_pthread_start (@_pthread_start:40)
I can confirm a crash in `ccl::MetalDevice::tex_alloc`: ``` __pthread_kill (@__pthread_kill:5) pthread_kill (@pthread_kill:75) abort (@abort:44) __assert_rtn (@__assert_rtn:56) MTLReportFailure.cold.1 (@bool MTLGetEnvCase<MTLErrorModeType>(char const*, MTLErrorModeType&, std::__1::vector<std::__1::pair<char const*, MTLErrorModeType>, std::__1::allocator<std::__1::pair<char const*, MTLErrorModeType> > > const&) (.cold.1):3) MTLReportFailure (@MTLReportFailure:122) _MTLMessageContextEnd (@_MTLMessageContextEnd:270) -[MTLTextureDescriptorInternal validateWithDevice:] (@-[MTLTextureDescriptorInternal validateWithDevice:]:646) ___lldb_unnamed_symbol5130 (@___lldb_unnamed_symbol5130:20) ccl::MetalDevice::tex_alloc(ccl::device_texture&) (/Users/germanocavalcante/blender-git/blender/intern/cycles/device/metal/device_impl.mm:890) ccl::MultiDevice::mem_copy_to(ccl::device_memory&) (/Users/germanocavalcante/blender-git/blender/intern/cycles/device/multi/device.cpp:307) ccl::ImageManager::device_load_image(ccl::Device*, ccl::Scene*, int, ccl::Progress*) (/Users/germanocavalcante/blender-git/blender/intern/cycles/scene/image.cpp:777) std::__1::__function::__value_func<void ()>::operator()() const (/Users/germanocavalcante/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/functional:1885) std::__1::function<void ()>::operator()() const (/Users/germanocavalcante/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/functional:2560) tbb::internal::function_task<std::__1::function<void ()> >::execute() (/Users/germanocavalcante/blender-git/lib/darwin_arm64/tbb/include/tbb/task.h:1059) tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) (@tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long):113) tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*) (@tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*):49) tbb::internal::arena::process(tbb::internal::generic_scheduler&) (@tbb::internal::arena::process(tbb::internal::generic_scheduler&):66) tbb::internal::market::process(rml::job&) (@tbb::internal::market::process(rml::job&):13) tbb::internal::rml::private_worker::run() (@tbb::internal::rml::private_worker::run():75) tbb::internal::rml::private_worker::thread_routine(void*) (@tbb::internal::rml::private_worker::thread_routine(void*):6) _pthread_start (@_pthread_start:40) ```

The allocation is failing due to an individual texture exceeding MTLTexture dimension limits:

MTLTextureDescriptor has width (21600) greater than the maximum allowed size of 16384.

The allocation is failing due to an individual texture exceeding `MTLTexture` dimension limits: `MTLTextureDescriptor has width (21600) greater than the maximum allowed size of 16384.`

Added subscriber: @brecht

Added subscriber: @brecht

Maybe in the future we can solve that with a tiled texture cache system, but for now it would be good to show an error to the user instead of crashing.

Maybe in the future we can solve that with a tiled texture cache system, but for now it would be good to show an error to the user instead of crashing.

In #95477#1301802, @Michael-Jones wrote:
The allocation is failing due to an individual texture exceeding MTLTexture dimension limits:

MTLTextureDescriptor has width (21600) greater than the maximum allowed size of 16384.

Is there a fix for this, or is it just an area where I'll need to cope with rendering with the CPU for now?

> In #95477#1301802, @Michael-Jones wrote: > The allocation is failing due to an individual texture exceeding `MTLTexture` dimension limits: > > `MTLTextureDescriptor has width (21600) greater than the maximum allowed size of 16384.` Is there a fix for this, or is it just an area where I'll need to cope with rendering with the CPU for now?

In #95477#1301828, @brecht wrote:
Maybe in the future we can solve that with a tiled texture cache system, but for now it would be good to show an error to the user instead of crashing.

Is Device::set_error(...) the preferred method of error reporting for cases like this?

> In #95477#1301828, @brecht wrote: > Maybe in the future we can solve that with a tiled texture cache system, but for now it would be good to show an error to the user instead of crashing. Is `Device::set_error(...)` the preferred method of error reporting for cases like this?

Yes.

Yes.

This issue was referenced by 35dedc11d5

This issue was referenced by 35dedc11d5649352326af3701aef444b39bb6aa3

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Michael Jones (Apple) self-assigned this 2022-02-10 18:06:36 +01:00
Sign in to join this conversation.
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
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#95477
No description provided.