Blender crashes when using Cycles Progressive Refine in OptiX CPU + GPU mode #84049

Closed
opened 2020-12-22 14:23:16 +01:00 by Metin Seven · 23 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 457.30

Blender Version
Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-21 21:31, hash: ffacce5be4
Worked: 2.92.0 Alpha, branch: master, commit date: 2020-12-14, hash: 010f44b855

Short description of error
When Optix with CPU + GPU is activated in the Preferences, the Render Properties ➔ Performance ➔ Tiles ➔ Progressive Refine option makes Cycles crash, at least on my system.

Exact steps for others to reproduce the error

  • In the Preferences, switch to OptiX and check both CPU and GPU.
  • In the Render Properties, switch To Cycles and GPU.
  • In the Render Properties, switch on Performance ➔ Tiles ➔ Progressive Refine.
  • Start a rendering with F12.
  • Blender crashes shortly after the rendering has started.
**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 457.30 **Blender Version** Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-21 21:31, hash: `ffacce5be4` Worked: 2.92.0 Alpha, branch: master, commit date: 2020-12-14, hash: `010f44b855` **Short description of error** When Optix with CPU + GPU is activated in the Preferences, the Render Properties ➔ Performance ➔ Tiles ➔ Progressive Refine option makes Cycles crash, at least on my system. **Exact steps for others to reproduce the error** - In the Preferences, switch to OptiX and check both CPU and GPU. - In the Render Properties, switch To Cycles and GPU. - In the Render Properties, switch on Performance ➔ Tiles ➔ Progressive Refine. - Start a rendering with F12. - Blender crashes shortly after the rendering has started.
Author

Added subscriber: @MetinSeven-1

Added subscriber: @MetinSeven-1

#84790 was marked as duplicate of this issue

#84790 was marked as duplicate of this issue
Metin Seven changed title from Blender crashes when using Progressive Refine in OptiX CPU + GPU mode to Blender crashes when using Cycles Progressive Refine in OptiX CPU + GPU mode 2020-12-22 14:31:14 +01:00

Added subscriber: @lowpolysaac

Added subscriber: @lowpolysaac

I can reproduce it, I also get a crash.

Linux-5.4.0-53-generic-x86_64, GeForce GTX 670
2.92.0 Alpha, branch: master, commit date: 2020-12-21 21:31, hash: ffacce5be4

I can reproduce it, I also get a crash. Linux-5.4.0-53-generic-x86_64, GeForce GTX 670 2.92.0 Alpha, branch: master, commit date: 2020-12-21 21:31, hash: `ffacce5be4`
Author

Thanks for confirming, @lowpolysaac !

Thanks for confirming, @lowpolysaac !

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

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

Added subscribers: @kevindietrich, @brecht

Added subscribers: @kevindietrich, @brecht

@kevindietrich are you looking into this one?

I couldn't reproduce this crash. OptiX was broken for me due to to b2edc716c1, but it's working again now, but for GPU and CPU + GPU.

@kevindietrich are you looking into this one? I couldn't reproduce this crash. OptiX was broken for me due to to b2edc716c1, but it's working again now, but for GPU and CPU + GPU.

@brecht I set as confirmed as I could reproduce also, but I am not sure if I had master up to date. I wanted to look at it, but my computer shut down somehow while compiling the OptiX kernel in debug mode (not sure if it is because of that), after restart I did not go back to it. All I remember was that the crash was somewhere in the CPU tile code, according to /tmp/blender.crash.txt.

Let me update master and try again real quick.

@brecht I set as confirmed as I could reproduce also, but I am not sure if I had master up to date. I wanted to look at it, but my computer shut down somehow while compiling the OptiX kernel in debug mode (not sure if it is because of that), after restart I did not go back to it. All I remember was that the crash was somewhere in the CPU tile code, according to `/tmp/blender.crash.txt`. Let me update master and try again real quick.
Author

I just installed the latest NVIDIA Studio driver, but can still reproduce the crash.

I just installed the latest NVIDIA Studio driver, but can still reproduce the crash.

@brecht I can still reproduce with latest master (ac82904c49), both CUDA+CPU and OptiX+CPU. The crash happens in the kernel when the CPU is trying to write its result to the buffer. At this point the buffer is null for some reason, it is a bit late here so I'll investigate a bit more tomorrow. Also, I noticed that the crash tends to happen at the end of the render of the first sample, before moving to the next.

Content of /tmp/blender.crash.txt for completeness

# Blender 2.92.0, Commit date: 2020-12-22 17:18, Hash ac82904c49fe

# backtrace
/usr/lib/x86_64-linux-gnu/libasan.so.5(+0x6bb30) [0x7feed036bb30]
/home/kevin/src/blender/build_linux_debug/bin/blender(BLI_system_backtrace+0xc8) [0x55d475a2c4e9]
/home/kevin/src/blender/build_linux_debug/bin/blender(+0x2c6a70f) [0x55d46906570f]
/home/kevin/src/blender/build_linux_debug/bin/blender(+0x2c6ab96) [0x55d469065b96]
/lib/x86_64-linux-gnu/libc.so.6(+0x3f040) [0x7feece4e7040]
/home/kevin/src/blender/build_linux_debug/bin/blender(+0x88b8aee) [0x55d46ecb3aee]
/home/kevin/src/blender/build_linux_debug/bin/blender(ccl::kernel_cpu_path_trace(ccl::KernelGlobals*, float*, int, int, int, int, int)+0xcd) [0x55d46ed8f046]
/home/kevin/src/blender/build_linux_debug/bin/blender(ccl::CPUDevice::render(ccl::DeviceTask&, ccl::RenderTile&, ccl::KernelGlobals*)+0x86f) [0x55d46e15b3e3]
/home/kevin/src/blender/build_linux_debug/bin/blender(ccl::CPUDevice::thread_render(ccl::DeviceTask&)+0x751) [0x55d46e1618bf]
/home/kevin/src/blender/build_linux_debug/bin/blender(ccl::CPUDevice::thread_run(ccl::DeviceTask&)+0x69) [0x55d46e156227]
/home/kevin/src/blender/build_linux_debug/bin/blender(ccl::CPUDevice::task_add(ccl::DeviceTask&)::{lambda()#1}::operator()() const+0x108) [0x55d46e1638d8]
/home/kevin/src/blender/build_linux_debug/bin/blender(std::_Function_handler<void (), ccl::CPUDevice::task_add(ccl::DeviceTask&)::{lambda()#1}>::_M_invoke(std::_Any_data const&)+0x20) [0x55d46e174158]
/home/kevin/src/blender/build_linux_debug/bin/blender(std::function<void ()>::operator()() const+0x5c) [0x55d469db01be]
/home/kevin/src/blender/build_linux_debug/bin/blender(+0xd6830de) [0x55d473a7e0de]
/home/kevin/src/blender/build_linux_debug/bin/blender(+0x39f2435) [0x55d469ded435]
/home/kevin/src/blender/build_linux_debug/bin/blender(+0x39f26eb) [0x55d469ded6eb]
/home/kevin/src/blender/build_linux_debug/bin/blender(+0x39e4a47) [0x55d469ddfa47]
/home/kevin/src/blender/build_linux_debug/bin/blender(+0x39ec1b0) [0x55d469de71b0]
/home/kevin/src/blender/build_linux_debug/bin/blender(+0x39ee1bc) [0x55d469de91bc]
/home/kevin/src/blender/build_linux_debug/bin/blender(+0x39ee3b9) [0x55d469de93b9]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7feecfedf6db]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7feece5c971f]
@brecht I can still reproduce with latest master (ac82904c49), both CUDA+CPU and OptiX+CPU. The crash happens in the kernel when the CPU is trying to write its result to the buffer. At this point the buffer is null for some reason, it is a bit late here so I'll investigate a bit more tomorrow. Also, I noticed that the crash tends to happen at the end of the render of the first sample, before moving to the next. Content of `/tmp/blender.crash.txt` for completeness ``` # Blender 2.92.0, Commit date: 2020-12-22 17:18, Hash ac82904c49fe # backtrace /usr/lib/x86_64-linux-gnu/libasan.so.5(+0x6bb30) [0x7feed036bb30] /home/kevin/src/blender/build_linux_debug/bin/blender(BLI_system_backtrace+0xc8) [0x55d475a2c4e9] /home/kevin/src/blender/build_linux_debug/bin/blender(+0x2c6a70f) [0x55d46906570f] /home/kevin/src/blender/build_linux_debug/bin/blender(+0x2c6ab96) [0x55d469065b96] /lib/x86_64-linux-gnu/libc.so.6(+0x3f040) [0x7feece4e7040] /home/kevin/src/blender/build_linux_debug/bin/blender(+0x88b8aee) [0x55d46ecb3aee] /home/kevin/src/blender/build_linux_debug/bin/blender(ccl::kernel_cpu_path_trace(ccl::KernelGlobals*, float*, int, int, int, int, int)+0xcd) [0x55d46ed8f046] /home/kevin/src/blender/build_linux_debug/bin/blender(ccl::CPUDevice::render(ccl::DeviceTask&, ccl::RenderTile&, ccl::KernelGlobals*)+0x86f) [0x55d46e15b3e3] /home/kevin/src/blender/build_linux_debug/bin/blender(ccl::CPUDevice::thread_render(ccl::DeviceTask&)+0x751) [0x55d46e1618bf] /home/kevin/src/blender/build_linux_debug/bin/blender(ccl::CPUDevice::thread_run(ccl::DeviceTask&)+0x69) [0x55d46e156227] /home/kevin/src/blender/build_linux_debug/bin/blender(ccl::CPUDevice::task_add(ccl::DeviceTask&)::{lambda()#1}::operator()() const+0x108) [0x55d46e1638d8] /home/kevin/src/blender/build_linux_debug/bin/blender(std::_Function_handler<void (), ccl::CPUDevice::task_add(ccl::DeviceTask&)::{lambda()#1}>::_M_invoke(std::_Any_data const&)+0x20) [0x55d46e174158] /home/kevin/src/blender/build_linux_debug/bin/blender(std::function<void ()>::operator()() const+0x5c) [0x55d469db01be] /home/kevin/src/blender/build_linux_debug/bin/blender(+0xd6830de) [0x55d473a7e0de] /home/kevin/src/blender/build_linux_debug/bin/blender(+0x39f2435) [0x55d469ded435] /home/kevin/src/blender/build_linux_debug/bin/blender(+0x39f26eb) [0x55d469ded6eb] /home/kevin/src/blender/build_linux_debug/bin/blender(+0x39e4a47) [0x55d469ddfa47] /home/kevin/src/blender/build_linux_debug/bin/blender(+0x39ec1b0) [0x55d469de71b0] /home/kevin/src/blender/build_linux_debug/bin/blender(+0x39ee1bc) [0x55d469de91bc] /home/kevin/src/blender/build_linux_debug/bin/blender(+0x39ee3b9) [0x55d469de93b9] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7feecfedf6db] /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7feece5c971f] ```

Added subscriber: @riyadist

Added subscriber: @riyadist

I am using rtx 2060 and on the viewport it crashes

I am using rtx 2060 and on the viewport it crashes

Added subscribers: @Basarchitects, @rjg

Added subscribers: @Basarchitects, @rjg

Added subscriber: @pmoursnv

Added subscriber: @pmoursnv

Is still this an issue now that 4fde594 was fixed? Sounds like it could have a common cause.

Is still this an issue now that 4fde594 was fixed? Sounds like it could have a common cause.
Author

Just retried it by following the steps of the original post, and Blender still crashes here.

Blender 2.92.0 Beta
January 20, 00:09:57- c2e6969c56
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89

Just retried it by following the steps of the original post, and Blender still crashes here. Blender 2.92.0 Beta January 20, 00:09:57- c2e6969c56ef Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89

@brecht I can still reproduce the issue, even with 4fde594fda.

After some investigation it would appear that the crash is caused by tile stealing happening at the end of the rendering of the first sample before moving to the first tile again for the next sample. At least disabling tile stealing fixes the crash for me.

@brecht I can still reproduce the issue, even with 4fde594fda. After some investigation it would appear that the crash is caused by tile stealing happening at the end of the rendering of the first sample before moving to the first tile again for the next sample. At least disabling tile stealing fixes the crash for me.

This issue was referenced by 4a09907eab

This issue was referenced by 4a09907eab2a3b6da53b1942aebefdcf58bbd604
Member

Yeah. I was finally able to reproduce this now and it's crashing because trying to write to a GPU address on the CPU. The tile stealing code steals the tile buffer for the GPU and moves the data there, but next time around the tile may be re-used on the CPU again (which only happens in progressive mode, otherwise tiles are deleted when done). The buffer is still lying on the GPU then though and never moved back, so is inaccessible to the CPU.

Could you confirm this fixes it for you as well?:

diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -540,6 +540,10 @@ bool Session::acquire_tile(RenderTile &rtile, Device *tile_device, uint tile_typ
     tile->buffers = new RenderBuffers(tile_device);
     tile->buffers->reset(buffer_params);
   }
+  else if (tile->buffers->buffer.device != tile_device) {
+    /* Move buffer to current tile device again in case it was stolen before. */
+    tile->buffers->buffer.move_device(tile_device);
+  }
 
   tile->buffers->map_neighbor_copied = false;
Yeah. I was finally able to reproduce this now and it's crashing because trying to write to a GPU address on the CPU. The tile stealing code steals the tile buffer for the GPU and moves the data there, but next time around the tile may be re-used on the CPU again (which only happens in progressive mode, otherwise tiles are deleted when done). The buffer is still lying on the GPU then though and never moved back, so is inaccessible to the CPU. Could you confirm this fixes it for you as well?: ``` diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -540,6 +540,10 @@ bool Session::acquire_tile(RenderTile &rtile, Device *tile_device, uint tile_typ tile->buffers = new RenderBuffers(tile_device); tile->buffers->reset(buffer_params); } + else if (tile->buffers->buffer.device != tile_device) { + /* Move buffer to current tile device again in case it was stolen before. */ + tile->buffers->buffer.move_device(tile_device); + } tile->buffers->map_neighbor_copied = false; ```

This fixes the issue for me.

This fixes the issue for me.

Looks good to me.

Looks good to me.
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Patrick Mours self-assigned this 2021-01-20 14:42:18 +01:00
Thomas Dinges added this to the 2.92 milestone 2023-02-08 16:15:37 +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
No Assignees
8 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#84049
No description provided.