Cycles HIP crash with smoke volume #92984

Closed
opened 2021-11-10 10:14:33 +01:00 by Thomas Dinges · 29 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: Radeon RX 5500 XT ATI Technologies Inc. 4.5.14802 Core Profile Context 21.Q4 30.0.14002.136

Blender Version
Broken: version: 3.0.0 Beta, branch: cycles-hip-binaries, commit date: 2021-11-09 21:58, hash: ab57a3cfac

Short description of error
Cycles HIP rendering crash with Quick Smoke

Exact steps for others to reproduce the error
Run Quick Smoke operator (F3, type quick smoke), set Cycles to GPU rendering with HIP and press F12.

Crashlog: blender.crash.txt

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: Radeon RX 5500 XT ATI Technologies Inc. 4.5.14802 Core Profile Context 21.Q4 30.0.14002.136 **Blender Version** Broken: version: 3.0.0 Beta, branch: cycles-hip-binaries, commit date: 2021-11-09 21:58, hash: `ab57a3cfac` **Short description of error** Cycles HIP rendering crash with Quick Smoke **Exact steps for others to reproduce the error** Run Quick Smoke operator (F3, type quick smoke), set Cycles to GPU rendering with HIP and press F12. Crashlog: [blender.crash.txt](https://archive.blender.org/developer/F11784695/blender.crash.txt)
Author
Owner

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

I can confirm using a W6800.

I can confirm using a W6800.
Author
Owner

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

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

Added subscribers: @Sayak-Biswas, @BrianSavery, @brecht

Added subscribers: @Sayak-Biswas, @BrianSavery, @brecht

CC @Sayak-Biswas @bsavery.

(Let me know if we should notify only one of you or someone else on future bug reports, not sure how you want to handle this.)

CC @Sayak-Biswas @bsavery. (Let me know if we should notify only one of you or someone else on future bug reports, not sure how you want to handle this.)
Brian Savery (AMD) self-assigned this 2021-11-10 21:55:54 +01:00

Sure, I can. Is there a scene file here?

Sure, I can. Is there a scene file here?
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

not needed, instructions are in the description, i'll clarify a bit just in case

not needed, instructions are in the description, i'll clarify a bit just in case
Author
Owner

quick_smoke.blend
Just in case, here is a ready to crash blend file :)

[quick_smoke.blend](https://archive.blender.org/developer/F11790675/quick_smoke.blend) Just in case, here is a ready to crash blend file :)

Added subscriber: @2905710881

Added subscriber: @2905710881

In #92984#1252037, @ThomasDinges wrote:
quick_smoke.blend
Just in case, here is a ready to crash blend file :)

Why amd gpu often have problems with smoke, 2.93 opencl can not render smoke bug has not been fixed yet, but he can render the volume (add volume in the environment)

> In #92984#1252037, @ThomasDinges wrote: > [quick_smoke.blend](https://archive.blender.org/developer/F11790675/quick_smoke.blend) > Just in case, here is a ready to crash blend file :) Why amd gpu often have problems with smoke, 2.93 opencl can not render smoke bug has not been fixed yet, but he can render the volume (add volume in the environment)
Author
Owner

@2905710881 Please, this is a site for developers who work on the code, not for discussions. The HIP backend is new and just needs some fixes, that's to be expected with new code.

@2905710881 Please, this is a site for developers who work on the code, not for discussions. The HIP backend is new and just needs some fixes, that's to be expected with new code.

Added subscriber: @MikePan

Added subscriber: @MikePan

In #92984#1252306, @ThomasDinges wrote:
@2905710881 Please, this is a site for developers who work on the code, not for discussions. The HIP backend is new and just needs some fixes, that's to be expected with new code.

I'm very sorry, I may seem a bit anxious.

> In #92984#1252306, @ThomasDinges wrote: > @2905710881 Please, this is a site for developers who work on the code, not for discussions. The HIP backend is new and just needs some fixes, that's to be expected with new code. I'm very sorry, I may seem a bit anxious.

Added subscriber: @Diogo_Valadares

Added subscriber: @Diogo_Valadares

it also crashes on 5700xt with AMD 21.11.2. just volume BSDF doesn't crash, but quick smoke crashes instantly.

it also crashes on 5700xt with AMD 21.11.2. just volume BSDF doesn't crash, but quick smoke crashes instantly.

With OpenVDB/NanoVDB volume rendering working now, we could work around this by converting dense 3D volume to sparse NanoVDB for HIP. Though that's not ideal for e.g. viewport interactivity with smoke simulation playback, so it would still be good to fix the core of this issue.

In the backtrace we have:

Stack trace:
amdhip64.dll        :0x00007FFA01AA3590  hipTexRefGetMipmappedArray
amdhip64.dll        :0x00007FFA01AAEFA0  hipTexObjectCreate
blender.exe         :0x00007FF7A0BF44A0  ccl::HIPDevice::tex_alloc

We are passing the 3D texture as an array, not a mipmapped array, so potentially that hipTexRefGetMipmappedArray should not have been called.

I checked the open source Linux implementation to see if there is some condition where this could happen, but as far as I can tell it never internally calls hipTexRefGetMipmappedArray, it's only a public API function.
d2d2cacfe2/src/hip_texture.cpp

So I assume the Windows implementation is different here.

With OpenVDB/NanoVDB volume rendering working now, we could work around this by converting dense 3D volume to sparse NanoVDB for HIP. Though that's not ideal for e.g. viewport interactivity with smoke simulation playback, so it would still be good to fix the core of this issue. In the backtrace we have: ``` Stack trace: amdhip64.dll :0x00007FFA01AA3590 hipTexRefGetMipmappedArray amdhip64.dll :0x00007FFA01AAEFA0 hipTexObjectCreate blender.exe :0x00007FF7A0BF44A0 ccl::HIPDevice::tex_alloc ``` We are passing the 3D texture as an array, not a mipmapped array, so potentially that `hipTexRefGetMipmappedArray` should not have been called. I checked the open source Linux implementation to see if there is some condition where this could happen, but as far as I can tell it never internally calls `hipTexRefGetMipmappedArray`, it's only a public API function. https://github.com/ROCm-Developer-Tools/hipamd/blob/d2d2cacfe210307ec10c77400e1dafdeafefbc0f/src/hip_texture.cpp So I assume the Windows implementation is different here.

@BrianSavery, @Sayak-Biswas, is there any update on this from your side? We really like to have all high priority bugs fixed at least a week before the release, which means by next Wednesday.

We could work around this by using NanoVDB if there is no solution to use 3D textures, but would like to know as soon as possible then.

@BrianSavery, @Sayak-Biswas, is there any update on this from your side? We really like to have all high priority bugs fixed at least a week before the release, which means by next Wednesday. We could work around this by using NanoVDB if there is no solution to use 3D textures, but would like to know as soon as possible then.
Member

I am working on this. Is the quick smoke feature working with NanoVDB enabled? I tried it with the latest from the release branch and it still seems to crash. Debugging the crash, it seems to me like a pointer for the hipArray isn't correctly setup in hipew. I'm looking into this more, will try and update more details by Monday.

I am working on this. Is the quick smoke feature working with NanoVDB enabled? I tried it with the latest from the release branch and it still seems to crash. Debugging the crash, it seems to me like a pointer for the hipArray isn't correctly setup in hipew. I'm looking into this more, will try and update more details by Monday.

Thanks for the update.

(Quick) smoke in Blender does not use NanoVDB, so it is expected that this is still crashing. We could make it uses NanoVDB if we can't solve the 3D texture issue in time.

Thanks for the update. (Quick) smoke in Blender does not use NanoVDB, so it is expected that this is still crashing. We could make it uses NanoVDB if we can't solve the 3D texture issue in time.
Member

Okay, I think I have a fix for the issue with quick smoke{F11829719}. How can I test other volume rendering? Is there a sample scene?

Okay, I think I have a fix for the issue with quick smoke{[F11829719](https://archive.blender.org/developer/F11829719/image.png)}. How can I test other volume rendering? Is there a sample scene?
Member

There's various volume tests available in the unit tests, unsure if there's an easy way to make them automatically run on the GPU these days , but you should be able to manually open/render them.

There's various [volume tests available](https://svn.blender.org/svnroot/bf-blender/tags/blender-2.93-release/lib/tests/render/volume/) in the unit tests, unsure if there's an easy way to make them automatically run on the GPU these days , but you should be able to manually open/render them.
Author
Owner

Other volume rendering didn't show issues in my tests, the issue was only related to 3D textures, which is used for Smoke/Fire. So if the Quick Smoke works now, that should be fine.

Other volume rendering didn't show issues in my tests, the issue was only related to 3D textures, which is used for Smoke/Fire. So if the Quick Smoke works now, that should be fine.
Member

Okay, cool! Running through the Cycles demos once to make sure nothing else broke. Will submit that patch in a bit.

Okay, cool! Running through the Cycles demos once to make sure nothing else broke. Will submit that patch in a bit.

That's great.

For reference, running the tests with HIP would be done by adding HIP to CYCLES_TEST_DEVICES. There's more detail here on how to set up automated tests here:
https://wiki.blender.org/wiki/Tools/Tests/Setup

That's great. For reference, running the tests with HIP would be done by adding `HIP` to `CYCLES_TEST_DEVICES`. There's more detail here on how to set up automated tests here: https://wiki.blender.org/wiki/Tools/Tests/Setup

This issue was referenced by blender/cycles@bec1ee3891

This issue was referenced by blender/cycles@bec1ee3891055257119c672f3e0e6a79579bc1ae

This issue was referenced by f2bb42a095

This issue was referenced by f2bb42a095acde57c540ff619c422132f491ef1c

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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
10 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#92984
No description provided.