Fix #120038: Possible fix for macOS buildbot test crash #120432

Open
Jason Fielder wants to merge 1 commits from Jason-Fielder/blender:Fix_120038_PossibleFixForBuildBotCrash into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

The tests appeared to be deadlocking due to reaching
the upper-bound for number of command buffers in flight.

This PR contains two changes to address this. Ensure
in-flight command buffer tracking is atomic and thus can
track command buffer counts across all threads and contexts
correctly.

Secondly, disable the encoder splitting debug option for the
general DEBUG builds, as this option causes excessive
command buffer flushing between operations, which can
cause the limit to be prematurely reached.

Authored by Apple: Michael Parkin-White

The tests appeared to be deadlocking due to reaching the upper-bound for number of command buffers in flight. This PR contains two changes to address this. Ensure in-flight command buffer tracking is atomic and thus can track command buffer counts across all threads and contexts correctly. Secondly, disable the encoder splitting debug option for the general DEBUG builds, as this option causes excessive command buffer flushing between operations, which can cause the limit to be prematurely reached. Authored by Apple: Michael Parkin-White
Jason Fielder added 1 commit 2024-04-09 15:39:30 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
93307db7d6
Fix #120038: Possible fix for macOS buildbot test crash
The tests appeared to be deadlocking due to reaching
the upper-bound for number of command buffers in flight.

This PR contains two changes to address this. Ensure
in-flight command buffer tracking is atomic and thus can
track command buffer counts across all threads and contexts
correctly.

Secondly, disable the encoder splitting debug option for the
general DEBUG builds, as this option causes excessive
command buffer flushing between operations, which can
cause the limit to be prematurely reached.

Authored by Apple: Michael Parkin-White
Jason Fielder requested review from Jeroen Bakker 2024-04-09 15:39:52 +02:00
First-time contributor

Please note that I was unable to reproduce the original crash, so this may not resolve the same issue, but is a best-guess at what may have been the root cause.

Please note that I was unable to reproduce the original crash, so this may not resolve the same issue, but is a best-guess at what may have been the root cause.
Member

@blender-bot build +gpu macos-arm64

@blender-bot build +gpu macos-arm64
Jeroen Bakker added this to the 4.2 LTS milestone 2024-04-09 17:11:19 +02:00
Jeroen Bakker added the
Interest
Metal
label 2024-04-09 17:11:38 +02:00
Jeroen Bakker added this to the EEVEE & Viewport project 2024-04-09 17:11:44 +02:00
First-time contributor

Hmm unfortunately timeout seems to still occur, will continue attempting to reproduce.

Hmm unfortunately timeout seems to still occur, will continue attempting to reproduce.
First-time contributor

Although, I do feel this patch makes sense to land regardless, as it should harden the category of errors and stalls when running in debug, as the flag now being disabled was not intended to be left on long-term.

Although, I do feel this patch makes sense to land regardless, as it should harden the category of errors and stalls when running in debug, as the flag now being disabled was not intended to be left on long-term.
Jeroen Bakker reviewed 2024-04-10 21:50:28 +02:00
@ -39,4 +39,2 @@
/* Fire off a single dispatch per encoder. Can make debugging view clearer for texture resources
* associated with each dispatch. */
#if defined(NDEBUG)
Member

IIRC when tests are run on the buildbot it is done on a build where asserts are enabled. In that sense this doesn't make a change in behavior on the buildbot.

@brecht is my recollection correct?

IIRC when tests are run on the buildbot it is done on a build where asserts are enabled. In that sense this doesn't make a change in behavior on the buildbot. @brecht is my recollection correct?

The only purpose of NDEBUG is to turn asserts off, following the C standard.

It is independent of debug / release build configurations, despite the name.

So, this does affect behavior of builds using asserts.

The only purpose of `NDEBUG` is to turn asserts off, following the C standard. It is independent of debug / release build configurations, despite the name. So, this does affect behavior of builds using asserts.
First-time contributor

Thanks Brecht, then I do believe we should still land this patch regardless, as it should not be changing GPU dispatch behavior on this flag.

(The flag is still situationally used to wait and validate execution of GPU work, but this can be considered a valid assertion that everything has executed correctly).

Thanks Brecht, then I do believe we should still land this patch regardless, as it should not be changing GPU dispatch behavior on this flag. (The flag is still situationally used to wait and validate execution of GPU work, but this can be considered a valid assertion that everything has executed correctly).
Some checks failed
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u Fix_120038_PossibleFixForBuildBotCrash:Jason-Fielder-Fix_120038_PossibleFixForBuildBotCrash
git checkout Jason-Fielder-Fix_120038_PossibleFixForBuildBotCrash
Sign in to join this conversation.
No reviewers
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 Assignees
4 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#120432
No description provided.