Crash when rendering with CUDA / OptiX #85089
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#85089
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: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.79
Blender Version
Broken: version: 2.92.0 Beta, branch: master, commit date: 2021-01-25 22:10, hash:
77f73a9284
Worked: 2.91.2
Short description of error
Crashes while loading textures to GPU memory using CUDA.
After some digging in the code it seems to happen when the device memory is low and it decides to 'move_textures_to_host' then it ends up trying to lock 'cuda_mem_map_mutex' twice.
Example stack trace:
Attached .blend just has 16k and 8k generated black textures and highly subdivided cubes to fill GPU memory. Can't seem to get this to crash in the 2.91.2 release build.
Exact steps for others to reproduce the error
Select CUDA or OptiX as the device
Render a scene with large textures
292Crash.blend
Added subscriber: @mmdanggg2
Seems to have been introduced with
bfb6fce659
Added subscriber: @olivier.fx
I've hit this deadlock bug last week as well: I believe you're right, it was introduced when the scoped locks were put in. When the GPU mem is full, the mechanism to free items from the device mem to re-allocate them on the host now suffers from a deadlock, since
move_textures_to_host
is called from within a mutex locked scope. The method then calls free/alloc which try to acquire the same lock (cuda_mem_map_mutex
) and cause a deadlock.I think the same bug is responsible for #84734.
I fixed the pb guarding the mem calls in
CUDADevice::move_textures_to_host(size_t size, bool for_texture)
:And at the end of the method since
load_texture_info
also tries to acquire the same lock:Just saw your diff, great! (was just about to submit one, will take yours).
Added subscriber: @rjg
@mmdanggg2 @olivier.fx This is a duplicate of #84734. I will merge this ticket into that one and try to put the information you've gathered in there as well.
Thank you for investigating this. Please continue the discussion in the ticket this one has been merged into.
Closed as duplicate of #84734
This issue was referenced by blender/cycles@88c43b68e6
This issue was referenced by
4fbeb3e6be
Changed status from 'Duplicate' to: 'Resolved'