Grease pencil immediately crashes on macOS #74536

Closed
opened 2020-03-08 00:46:38 +01:00 by Michiel van der Wal · 19 comments

System Information
Operating system: Darwin-19.3.0-x86_64-i386-64bit 64 Bits
Graphics card: NVIDIA GeForce GT 750M OpenGL Engine NVIDIA Corporation 4.1 NVIDIA-14.0.31 355.11.11.10.10.143

Blender Version
Broken: version: 2.83 (sub 7), branch: greasepencil-object, commit date: 2020-03-07 11:42, hash: 505494062c
Worked:

Short description of error
It seems grease pencil objects in general make Blender crash. This is the first version with the refactor that i'm aware of.

Exact steps for others to reproduce the error
Opening blender and selecting 2D animation startup preset results in crash.
Opening blender and using the default startup preset, then adding a GP-Object, entering draw mode and attempting to draw results in a crash.
Opening blender and using the default startup preset, then adding a GP-Object Monkey type results in crash.

**System Information** Operating system: Darwin-19.3.0-x86_64-i386-64bit 64 Bits Graphics card: NVIDIA GeForce GT 750M OpenGL Engine NVIDIA Corporation 4.1 NVIDIA-14.0.31 355.11.11.10.10.143 **Blender Version** Broken: version: 2.83 (sub 7), branch: greasepencil-object, commit date: 2020-03-07 11:42, hash: `505494062c` Worked: **Short description of error** It seems grease pencil objects in general make Blender crash. This is the first version with the refactor that i'm aware of. **Exact steps for others to reproduce the error** Opening blender and selecting 2D animation startup preset results in crash. Opening blender and using the default startup preset, then adding a GP-Object, entering draw mode and attempting to draw results in a crash. Opening blender and using the default startup preset, then adding a GP-Object Monkey type results in crash.

Added subscriber: @MichielvanderWal

Added subscriber: @MichielvanderWal

#74582 was marked as duplicate of this issue

#74582 was marked as duplicate of this issue
Contributor

Added subscriber: @dupoxy

Added subscriber: @dupoxy
Contributor

same for me
System Information
Operating system: Darwin-17.7.0-x86_64-i386-64bit 64 Bits
Graphics card: NVIDIA GeForce GTX 680MX OpenGL Engine NVIDIA Corporation 4.1 NVIDIA-10.32.0 355.11.10.10.40.102

Blender Version
Broken: version: 2.83 (sub 7), branch: greasepencil-object, commit date: 2020-03-07 16:29, hash: 5b3670acb4

terminal:

Missing icons: /Users/dup/Desktop/Blender2.83 greasepencil.app/Contents/Resources/2.83/datafiles/icons/brush.gpencil_draw.tint.dat Unable to load from file
GPUShader: linking error:
ERROR: Implementation limit of 16 MAX_VERTEX_ATTRIBS (e.g., number of generic plus conventional active vec4 attributes) exceeded, shader uses up to vec4 attribute 16.

GPUShader: linking error:
ERROR: Implementation limit of 16 MAX_VERTEX_ATTRIBS (e.g., number of generic plus conventional active vec4 attributes) exceeded, shader uses up to vec4 attribute 16.

Writing: /var/folders/8j/smz3tf1s3gl0pzz06wbm7dhh0000gp/T/blender.crash.txt
Segmentation fault: 11

blender.crash.txt:

# Blender 2.83 (sub 7), Commit date: 2020-03-07 16:29, Hash 5b3670acb421

# backtrace
0   Blender                             0x0000000114a3d6e7 BLI_system_backtrace + 55
1   Blender                             0x000000010e637c18 sig_handle_crash + 392
2   libsystem_platform.dylib            0x00007fff54e85f5a _sigtramp + 26
3   libsystem_malloc.dylib              0x00007fff54d377d6 tiny_free_no_lock + 570
4   Blender                             0x000000010e9b4873 drw_shgroup_init + 51
5   Blender                             0x000000010e9b51b0 DRW_shgroup_create + 112
6   Blender                             0x000000010e9e5746 gpencil_layer_cache_add + 1510
7   Blender                             0x000000010e9e79ff gpencil_layer_cache_populate + 191
8   Blender                             0x000000010e705e3b BKE_gpencil_visible_stroke_iter + 859
9   Blender                             0x000000010e9e7716 GPENCIL_cache_populate + 326
10  Blender                             0x000000010e9afaa1 drw_engines_cache_populate + 161
11  Blender                             0x000000010e9af022 DRW_draw_render_loop_ex + 1330
12  Blender                             0x000000010f027b2d view3d_main_region_draw + 125
13  Blender                             0x000000010ec21f4e ED_region_do_draw + 366
14  Blender                             0x000000010e85e27b wm_draw_update + 1915
15  Blender                             0x000000010e85bed0 WM_main + 48
16  Blender                             0x000000010e63439d main + 957
17  libdyld.dylib                       0x00007fff54b77015 start + 1

output with --debug-all:
log-debug.txt

@antoniov are you aware of that !

same for me **System Information** Operating system: Darwin-17.7.0-x86_64-i386-64bit 64 Bits Graphics card: NVIDIA GeForce GTX 680MX OpenGL Engine NVIDIA Corporation 4.1 NVIDIA-10.32.0 355.11.10.10.40.102 **Blender Version** Broken: version: 2.83 (sub 7), branch: greasepencil-object, commit date: 2020-03-07 16:29, hash: `5b3670acb4` terminal: ``` Missing icons: /Users/dup/Desktop/Blender2.83 greasepencil.app/Contents/Resources/2.83/datafiles/icons/brush.gpencil_draw.tint.dat Unable to load from file GPUShader: linking error: ERROR: Implementation limit of 16 MAX_VERTEX_ATTRIBS (e.g., number of generic plus conventional active vec4 attributes) exceeded, shader uses up to vec4 attribute 16. GPUShader: linking error: ERROR: Implementation limit of 16 MAX_VERTEX_ATTRIBS (e.g., number of generic plus conventional active vec4 attributes) exceeded, shader uses up to vec4 attribute 16. Writing: /var/folders/8j/smz3tf1s3gl0pzz06wbm7dhh0000gp/T/blender.crash.txt Segmentation fault: 11 ``` blender.crash.txt: ``` # Blender 2.83 (sub 7), Commit date: 2020-03-07 16:29, Hash 5b3670acb421 # backtrace 0 Blender 0x0000000114a3d6e7 BLI_system_backtrace + 55 1 Blender 0x000000010e637c18 sig_handle_crash + 392 2 libsystem_platform.dylib 0x00007fff54e85f5a _sigtramp + 26 3 libsystem_malloc.dylib 0x00007fff54d377d6 tiny_free_no_lock + 570 4 Blender 0x000000010e9b4873 drw_shgroup_init + 51 5 Blender 0x000000010e9b51b0 DRW_shgroup_create + 112 6 Blender 0x000000010e9e5746 gpencil_layer_cache_add + 1510 7 Blender 0x000000010e9e79ff gpencil_layer_cache_populate + 191 8 Blender 0x000000010e705e3b BKE_gpencil_visible_stroke_iter + 859 9 Blender 0x000000010e9e7716 GPENCIL_cache_populate + 326 10 Blender 0x000000010e9afaa1 drw_engines_cache_populate + 161 11 Blender 0x000000010e9af022 DRW_draw_render_loop_ex + 1330 12 Blender 0x000000010f027b2d view3d_main_region_draw + 125 13 Blender 0x000000010ec21f4e ED_region_do_draw + 366 14 Blender 0x000000010e85e27b wm_draw_update + 1915 15 Blender 0x000000010e85bed0 WM_main + 48 16 Blender 0x000000010e63439d main + 957 17 libdyld.dylib 0x00007fff54b77015 start + 1 ``` output with --debug-all: [log-debug.txt](https://archive.blender.org/developer/F8395623/log-debug.txt) @antoniov are you aware of that !
Contributor

Added subscriber: @antoniov

Added subscriber: @antoniov

Added subscriber: @fclem

Added subscriber: @fclem

@fclem What do you think of this?

@fclem What do you think of this?

The longest attribs used is this:

GPU_vertformat_attr_add(&format, "ma", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
    GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
    GPU_vertformat_attr_add(&format, "uv", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
    GPU_vertformat_attr_add(&format, "hard", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
    /* IMPORTANT: This means having only 4 attributes to fit into GPU module limit of 16 attrib. */
    GPU_vertformat_multiload_enable(&format, 4);

If you add the values you get: 4 + 4 + 4 + 2 = 14 values in 4 attributtes. Never more than 16 attribs are used, so it looks a driver issue.

The longest attribs used is this: ``` GPU_vertformat_attr_add(&format, "ma", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); GPU_vertformat_attr_add(&format, "uv", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); GPU_vertformat_attr_add(&format, "hard", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); /* IMPORTANT: This means having only 4 attributes to fit into GPU module limit of 16 attrib. */ GPU_vertformat_multiload_enable(&format, 4); ``` If you add the values you get: `4 + 4 + 4 + 2 = 14` values in 4 attributtes. Never more than 16 attribs are used, so it looks a driver issue.

can someone test in a MacOS machine? We have only Windows and Linux.

can someone test in a MacOS machine? We have only Windows and Linux.

This now also happens in the latest master build (07bdbeda84) same results! Windows and Linux most likely work, could it be an issue on my end?

This now also happens in the latest master build (07bdbeda8462) same results! Windows and Linux most likely work, could it be an issue on my end?

Added subscribers: @Le.Citron, @BerbankGreen

Added subscribers: @Le.Citron, @BerbankGreen
Brecht Van Lommel changed title from Grease Pencil Object build crashes with any GP-Object at all on Mac to Grease pencil immediately crashes on macOS 2020-03-09 21:42:23 +01:00

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

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

Added subscriber: @brecht

Added subscriber: @brecht

Here is the failing shader: P1288

I don't know how these are counted exactly, maybe geometry shader attributes add to the total?

Removing e.g. hard2 and using hard1 instead makes it work. hard1 and hard2 are both vec2, maybe those can be merged into a vec4?

Here is the failing shader: [P1288](https://archive.blender.org/developer/P1288.txt) I don't know how these are counted exactly, maybe geometry shader attributes add to the total? Removing e.g. `hard2` and using `hard1` instead makes it work. `hard1` and `hard2` are both `vec2`, maybe those can be merged into a `vec4`?

I don't know how these are counted exactly, maybe geometry shader attributes add to the total?

There is no geometry shader anymore for GPencil. I don't know how OSX driver finds more than 16 attributes because we just use 15.
Capture d’écran du 2020-03-10 00-07-37.png
Maybe gl_InstanceID and gl_VertexID count in this limit. In which case we would have 17 attribs.

@brecht can you try replacing gl_InstanceID by 1 to comfirm my hypothesis?

Removing e.g. hard2 and using hard1 instead makes it work. hard1 and hard2 are both vec2, maybe those can be merged into a vec4?

No we cannot. This is because hard1 and hard2 refer to different vertices. (see the offset and stride for each attrib in the screenshot)

This is really tricky because the data is already packed like crazy.

After giving it more thoughts, I think we can pack hardness and aspect ratio with dots rotation if we accept the quality loss (8bits quantization). Also unpacking in the shader will add some overhead.

>I don't know how these are counted exactly, maybe geometry shader attributes add to the total? There is no geometry shader anymore for GPencil. I don't know how OSX driver finds more than 16 attributes because we just use 15. ![Capture d’écran du 2020-03-10 00-07-37.png](https://archive.blender.org/developer/F8398266/Capture_d_écran_du_2020-03-10_00-07-37.png) Maybe gl_InstanceID and gl_VertexID count in this limit. In which case we would have 17 attribs. @brecht can you try replacing gl_InstanceID by 1 to comfirm my hypothesis? >Removing e.g. hard2 and using hard1 instead makes it work. hard1 and hard2 are both vec2, maybe those can be merged into a vec4? No we cannot. This is because `hard1` and `hard2` refer to different vertices. (see the offset and stride for each attrib in the screenshot) This is really tricky because the data is already packed like crazy. After giving it more thoughts, I think we can pack hardness and aspect ratio with dots rotation if we accept the quality loss (8bits quantization). Also unpacking in the shader will add some overhead.

@brecht can you try replacing gl_InstanceID by 1 to comfirm my hypothesis?

Assuming you mean this, yes that works as well. So I guess it does indeed count.

diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
index 8774b633467..b15735417bc 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
@@ -580,7 +580,7 @@ void gpencil_vertex()
   /* Trick to detect if a drawcall is stroke or fill.
    * This does mean that we need to draw an empty stroke segment before starting
    * to draw the real stroke segments. */
-  bool is_fill = (gl_InstanceID == 0);
+  bool is_fill = (1 == 0);

   if (!is_fill) {
     stroke_vertex();
> @brecht can you try replacing gl_InstanceID by 1 to comfirm my hypothesis? Assuming you mean this, yes that works as well. So I guess it does indeed count. ``` diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl index 8774b633467..b15735417bc 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl @@ -580,7 +580,7 @@ void gpencil_vertex() /* Trick to detect if a drawcall is stroke or fill. * This does mean that we need to draw an empty stroke segment before starting * to draw the real stroke segments. */ - bool is_fill = (gl_InstanceID == 0); + bool is_fill = (1 == 0); if (!is_fill) { stroke_vertex(); ```

This issue was referenced by c971e812d5

This issue was referenced by c971e812d5e2e5c45ed262ccd3bccfcf547b9ff7

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Clément Foucault self-assigned this 2020-03-10 04:48:06 +01:00

Thanks, I can confirm this works, tested with the 2.82 splash screen .blend.

Thanks, I can confirm this works, tested with the 2.82 splash screen .blend.
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#74536
No description provided.