Crashes with Intel GPUs - GPU shader compilation fails #96678

Closed
opened 2022-03-21 14:54:38 +01:00 by Stefan Werner · 12 comments
Member

System Information
Operating system: Windows 10
Graphics card: Intel i-9 12900K iGPU

Blender Version
Broken: 374cb32d4a
Worked: 2580869901

Short description of error
GLSL shader compilation fails with error message:

ERROR (gpu.shader): subdiv patch evaluation ComputeShader:
      |
    6 | #define OS_WIN
      |                                                                                                                                                                                                             ^
      | Error: 'array' : failed to expand macro

And then crash:

Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF6BFF0DABB
Module  : blender.exe
Thread  : 00004dbc
Writing: C:\Users\stefanwe\AppData\Local\Temp\cyclesx_classroom.crash.txt`

Exact steps for others to reproduce the error
Open Blender
Load classroom scene

**System Information** Operating system: Windows 10 Graphics card: Intel i-9 12900K iGPU **Blender Version** Broken: 374cb32d4a43b5f959f7fbd96074cfae5f265dab Worked: 2580869901f20d6563c633906245a59377322321 **Short description of error** GLSL shader compilation fails with error message: ``` ERROR (gpu.shader): subdiv patch evaluation ComputeShader: | 6 | #define OS_WIN | ^ | Error: 'array' : failed to expand macro ``` And then crash: ``` Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FF6BFF0DABB Module : blender.exe Thread : 00004dbc Writing: C:\Users\stefanwe\AppData\Local\Temp\cyclesx_classroom.crash.txt` ``` **Exact steps for others to reproduce the error** Open Blender Load classroom scene
Author
Member

Added subscriber: @Stefan_Werner

Added subscriber: @Stefan_Werner

Added subscriber: @Sirgienko

Added subscriber: @Sirgienko

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Thanks for the report,

I suggest you use Help -> Report a Bug in Blender so there is complete information about the Blender version and graphics cards.
("Graphics card: Intel i-9 12900K iGPU" is not the information we would expect).

But this hardware is recent and should be supported.

Since there is an error message (and it appears to be related to 374cb32), I believe the report is valid and deserves to be forwarded to the #eevee_viewport team.

Thanks for the report, I suggest you use `Help -> Report a Bug` in Blender so there is complete information about the Blender version and graphics cards. (`"Graphics card: Intel i-9 12900K iGPU"` is not the information we would expect). But this hardware is recent and should be supported. Since there is an error message (and it appears to be related to 374cb32), I believe the report is valid and deserves to be forwarded to the #eevee_viewport team.

Added subscriber: @Memento

Added subscriber: @Memento
Author
Member
[system-info.txt](https://archive.blender.org/developer/F12940989/system-info.txt)
Author
Member

This should be addressed for the 3.2 release, otherwise the 3.2 release will crash on some machines with Intel graphics. (Blender dereferencing a NULL pointer from a failed shader compilation)

This should be addressed for the 3.2 release, otherwise the 3.2 release will crash on some machines with Intel graphics. (Blender dereferencing a NULL pointer from a failed shader compilation)

Looking at the code, all compute shaders have an array macro defined by default. See "#define array(_type) _type- [ ]\n" in {https://developer.blender.org/diffusion/B/browse/master/source/blender/gpu/opengl/gl_shader.cc$843}

And the shader named "subdiv patch evaluation" has some apparent "array" tokens in:
{https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl$251}
{https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl$254}
{https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl$260}
{https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl$276}
{https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl$282}

So... maybe if we undefine the macro array in the compute shader the problem is solved???

diff --git a/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl b/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl
index 65cf4ebb90f..e261e983113 100644
--- a/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl
+++ b/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl
@@ -1,3 +1,4 @@
+#undef array
 
 /* To be compiled with common_subdiv_lib.glsl */
 

Looking at the code, all compute shaders have an `array` macro defined by default. See `"#define array(_type) _type- [ ]\n"` in {https://developer.blender.org/diffusion/B/browse/master/source/blender/gpu/opengl/gl_shader.cc$843} And the shader named `"subdiv patch evaluation"` has some apparent "array" tokens in: {https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl$251} {https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl$254} {https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl$260} {https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl$276} {https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl$282} So... maybe if we undefine the macro `array` in the compute shader the problem is solved??? ``` diff --git a/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl b/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl index 65cf4ebb90f..e261e983113 100644 --- a/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl +++ b/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl @@ -1,3 +1,4 @@ +#undef array /* To be compiled with common_subdiv_lib.glsl */ ```
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Hi @Stefan_Werner, I'm also getting similar OpenGL error.
I've not loaded classroom scene on my system. But can you check if crash still occurs after turning Off the GPU subdivision?
Also check if you can reproduce crash as mentioned in #97449 (GPU subdivision: Crash on adding subdivision surface modifier)
I suspect both reports are identical :)

Hi @Stefan_Werner, I'm also getting similar OpenGL error. I've not loaded classroom scene on my system. But can you check if crash still occurs after turning Off the GPU subdivision? Also check if you can reproduce crash as mentioned in #97449 (GPU subdivision: Crash on adding subdivision surface modifier) I suspect both reports are identical :)

Closed as duplicate of #97449

Closed as duplicate of #97449
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
6 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#96678
No description provided.