Blender Crashing when rendering with Opencl GPU on Ubuntu. #86610

Closed
opened 2021-03-16 02:31:05 +01:00 by gabe2252 · 20 comments

System Information
Operating system: Linux-5.8.0-45-generic-x86_64-with-glibc2.31 64 Bits
Graphics card: Radeon RX 580 Series (POLARIS10, DRM 3.38.0, 5.8.0-45-generic, LLVM 10.0.1) X.Org 4.6 (Core Profile) Mesa 20.1.6

Blender Version
Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-03-15 19:47, hash: be51d671b5
Worked: 2.83.13

Short description of error
Blender crashing while compiling shader during rendering. Happens with gpu only and gpu+cpu. I'm using a fresh Ubuntu 20.04.1instal with Radeon gpu 20.45 driver, non-pro version with no-dkms and opencl legacy flags. Blender 2.83.13 works fine but 2.92 is also broken.
blender.crash.txt
system-info.txt

Exact steps for others to reproduce the error

  1. Open default blender scene and switch to cycles.
  2. Enable opencl gpu rendering in user pref.
  3. Render with GPU.
  4. Crash
**System Information** Operating system: Linux-5.8.0-45-generic-x86_64-with-glibc2.31 64 Bits Graphics card: Radeon RX 580 Series (POLARIS10, DRM 3.38.0, 5.8.0-45-generic, LLVM 10.0.1) X.Org 4.6 (Core Profile) Mesa 20.1.6 **Blender Version** Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-03-15 19:47, hash: `be51d671b5` Worked: 2.83.13 **Short description of error** Blender crashing while compiling shader during rendering. Happens with gpu only and gpu+cpu. I'm using a fresh Ubuntu 20.04.1instal with Radeon gpu 20.45 driver, non-pro version with no-dkms and opencl legacy flags. Blender 2.83.13 works fine but 2.92 is also broken. [blender.crash.txt](https://archive.blender.org/developer/F9893658/blender.crash.txt) [system-info.txt](https://archive.blender.org/developer/F9893662/system-info.txt) **Exact steps for others to reproduce the error** 1. Open default blender scene and switch to cycles. 2. Enable opencl gpu rendering in user pref. 3. Render with GPU. 4. Crash
Author

Added subscriber: @gabe2252

Added subscriber: @gabe2252

Added subscriber: @Svend

Added subscriber: @Svend

Added subscriber: @thomas-29

Added subscriber: @thomas-29

Same crash with openSUSE Leap 15.2, distribution provided graphics driver + v20.40 AMD opencl library.
Happens on Blender 2.92 and 2.93.

Can be avoided by compiling Blender without nanoVDB.

...or change ~/blender-2.92.0-linux64/2.92/scripts/addons/cycles/source/kernel/kernels/opencl/kernel_opencl_image.h
add a new

undef WITH_NANOVDB

after the

ifdef WITH_NANOVDB

near the top of the file.

That will allow compiling the cycles kernels but you won't get rendered volume objects when rendering on the gpu.

Same crash with openSUSE Leap 15.2, distribution provided graphics driver + v20.40 AMD opencl library. Happens on Blender 2.92 and 2.93. Can be avoided by compiling Blender without nanoVDB. ...or change ~/blender-2.92.0-linux64/2.92/scripts/addons/cycles/source/kernel/kernels/opencl/kernel_opencl_image.h add a new # undef WITH_NANOVDB after the # ifdef WITH_NANOVDB near the top of the file. That will allow compiling the cycles kernels but you won't get rendered volume objects when rendering on the gpu.

The cause of the crash seems to be located in the following piece of code in kernel_opencl_image.h:

#ifdef WITH_NANOVDB
  /* NanoVDB Float */
  else if (texture_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT) {
    cnanovdb_coord coord;
    coord.mVec[0] = x;
    coord.mVec[1] = y;
    coord.mVec[2] = z;
    float f = cnanovdb_readaccessor_getValueF((cnanovdb_readaccessor *)acc, &coord);
    return make_float4(f, f, f, 1.0f);
  }
  /* NanoVDB Float3 */
  else if (texture_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT3) {
    cnanovdb_coord coord;
    coord.mVec[0] = x;
    coord.mVec[1] = y;
    coord.mVec[2] = z;
    cnanovdb_Vec3F f = cnanovdb_readaccessor_getValueF3((cnanovdb_readaccessor *)acc, &coord);
    return make_float4(f.mVec[0], f.mVec[1], f.mVec[2], 1.0f);
  }
#endif

Replacing the 2.93 version of kernel_opencl_image.h by the 2.91 version and compiling wihout nanoVDB will avoid the crash and bring back volume objects rendered on the gpu.

The cause of the crash seems to be located in the following piece of code in kernel_opencl_image.h: ``` #ifdef WITH_NANOVDB /* NanoVDB Float */ else if (texture_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT) { cnanovdb_coord coord; coord.mVec[0] = x; coord.mVec[1] = y; coord.mVec[2] = z; float f = cnanovdb_readaccessor_getValueF((cnanovdb_readaccessor *)acc, &coord); return make_float4(f, f, f, 1.0f); } /* NanoVDB Float3 */ else if (texture_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT3) { cnanovdb_coord coord; coord.mVec[0] = x; coord.mVec[1] = y; coord.mVec[2] = z; cnanovdb_Vec3F f = cnanovdb_readaccessor_getValueF3((cnanovdb_readaccessor *)acc, &coord); return make_float4(f.mVec[0], f.mVec[1], f.mVec[2], 1.0f); } #endif ``` Replacing the 2.93 version of kernel_opencl_image.h by the 2.91 version and compiling wihout nanoVDB will avoid the crash and bring back volume objects rendered on the gpu.

Added subscriber: @mano-wii

Added subscriber: @mano-wii

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

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

Due to the growing number of reports (many of which are mentioned in #85099 (Cycles GPU render crashes in 2.92, 2.93 on Ubuntu with rx580)), I believe that this problem deserves priority.
So I am confirming the issue even though I am not able to replicate the problem on Windows.
I hope @thomas-29's findings help the devs to solve the problem.

Due to the growing number of reports (many of which are mentioned in #85099 (Cycles GPU render crashes in 2.92, 2.93 on Ubuntu with rx580)), I believe that this problem deserves priority. So I am confirming the issue even though I am not able to replicate the problem on Windows. I hope @thomas-29's findings help the devs to solve the problem.

Switching off the opencl compiler optimization of one pointer prevents the crash during cycles kernel compilation.
Applying this patch
nanoVDB-fix.patch
to ~/blender-git/lib/linux_centos7_x86_64/nanovdb/include/nanovdb/CNanoVDB.h
allows compiling blender with nanoVDB switched on and rendering a volume object on gpu.
Unfortunately the render result is not as expected:

nanoVDB-GPU.png rendered on GPU

nanoVDB-CPU.png rendered on CPU

A part of the volume is not rendered.
(looks like the part of the volume object in -y direction from the origin of the object)

Don't try to render the viewport via GPU. It seems to freeze blender, at least on my computer.

Switching off the opencl compiler optimization of one pointer prevents the crash during cycles kernel compilation. Applying this patch [nanoVDB-fix.patch](https://archive.blender.org/developer/F9909678/nanoVDB-fix.patch) to ~/blender-git/lib/linux_centos7_x86_64/nanovdb/include/nanovdb/CNanoVDB.h allows compiling blender with nanoVDB switched on and rendering a volume object on gpu. Unfortunately the render result is not as expected: ![nanoVDB-GPU.png](https://archive.blender.org/developer/F9909681/nanoVDB-GPU.png) rendered on GPU ![nanoVDB-CPU.png](https://archive.blender.org/developer/F9909683/nanoVDB-CPU.png) rendered on CPU A part of the volume is not rendered. (looks like the part of the volume object in -y direction from the origin of the object) Don't try to render the viewport via GPU. It seems to freeze blender, at least on my computer.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Germano Cavalcante self-assigned this 2021-04-12 14:55:29 +02:00

I believe that this bug has already been fixed by 91c44fe885.

Please try the latest daily build: https://builder.blender.org/download/

If the problem persists, please let us know so we can re-open the report. Don't forget to mention the specific version you tested again.

I believe that this bug has already been fixed by 91c44fe885. Please try the latest daily build: https://builder.blender.org/download/ If the problem persists, please let us know so we can re-open the report. Don't forget to mention the specific version you tested again.
Author

Alright I tested version: 2.93.0 Alpha, branch: master, commit date: 2021-04-11 20:10, hash: 09d7d88cc4 with my RX580 and it seems to be fixed.

Alright I tested version: 2.93.0 Alpha, branch: master, commit date: 2021-04-11 20:10, hash: 09d7d88cc42a with my RX580 and it seems to be fixed.

I tested blender-2.93.0-09d7d88cc42a-linux64 from https://builder.blender.org/download/

The crash is gone, but for the cost of not rendering volume objects on the GPU with AMD OpenCL.
On CPU the volume objects are still rendered.

I think there could be a proper way of just disabeling the use of nanoVDB for rendering volume objects with AMD OpenCL and still rendering the volume objects with AMD OpenCL.
The workaround:
"Replacing the 2.93 version of kernel_opencl_image.h by the 2.91 version and compiling wihout nanoVDB will avoid the crash and bring back volume objects rendered on the gpu."
still works when applied to the latest commit 2bd9f9d976.

Would you mind re-opening?

I tested blender-2.93.0-09d7d88cc42a-linux64 from https://builder.blender.org/download/ The crash is gone, but for the cost of not rendering volume objects on the GPU with AMD OpenCL. On CPU the volume objects are still rendered. I think there could be a proper way of just disabeling the use of nanoVDB for rendering volume objects with AMD OpenCL and still rendering the volume objects with AMD OpenCL. The workaround: "Replacing the 2.93 version of kernel_opencl_image.h by the 2.91 version and compiling wihout nanoVDB will avoid the crash and bring back volume objects rendered on the gpu." still works when applied to the latest commit 2bd9f9d976560. Would you mind re-opening?
Author

The volume objects are rendering for me.

Edit: I'm using the 20.50 driver for ubuntu.

Edit2: I was wrong and Volume objects don't work.

The volume objects are rendering for me. Edit: I'm using the 20.50 driver for ubuntu. Edit2: I was wrong and Volume objects don't work.

Added subscriber: @brecht

Added subscriber: @brecht

In #86610#1145496, @thomas-29 wrote:
The crash is gone, but for the cost of not rendering volume objects on the GPU with AMD OpenCL.
(...)
Would you mind re-opening?

The description in the report does not mention volumes, so this appears to be a different problem.
And I'm not sure if it's really related to the fix.
CC @brecht

> In #86610#1145496, @thomas-29 wrote: > The crash is gone, but for the cost of not rendering volume objects on the GPU with AMD OpenCL. > (...) > Would you mind re-opening? The description in the report does not mention volumes, so this appears to be a different problem. And I'm not sure if it's really related to the fix. CC @brecht

@gabe2252
could you please double check rendering using Cycles and OpenCL with GPU selected in the preferences as well as in the render setting with this file:
Volume.blend

Thanks!

@gabe2252 could you please double check rendering using Cycles and OpenCL with GPU selected in the preferences as well as in the render setting with this file: [Volume.blend](https://archive.blender.org/developer/F9931077/Volume.blend) Thanks!
Author

Oh, I was thinking objects with cycles volume rendering. I haven't used the new volume objects and I didn't realize that's you where talking about that. I'll try your blend file in few hours when I get back to my computer. Feeling a bit embarrassed.

Oh, I was thinking objects with cycles volume rendering. I haven't used the new volume objects and I didn't realize that's you where talking about that. I'll try your blend file in few hours when I get back to my computer. Feeling a bit embarrassed.
Author

Alright, I tested the @thomas-29 's blend file and can confirm that the new volume objects do not work.

Alright, I tested the @thomas-29 's blend file and can confirm that the new volume objects do not work.

@gabe2252 , thanks for testing!

@mano-wii, agreed, opened new task #87471 to track this problem.

@gabe2252 , thanks for testing! @mano-wii, agreed, opened new task #87471 to track this problem.
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
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#86610
No description provided.