sculpt mode performance regression in 2.83. #77641

Closed
opened 2020-06-08 19:32:39 +02:00 by Jean Da Costa · 20 comments

System Information
Operating system: Linux-5.3.0-53-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: Radeon RX 570 Series (POLARIS10, DRM 3.36.0, 5.3.0-53-generic, LLVM 9.0.0) X.Org 4.5 (Core Profile) Mesa 19.3.4

Blender Version
Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: 211b6c29f7
Worked: version 2.82 before 56d6666689 (commit that introduced the issue)

Short description of error
Performance regression when navigating while sculpting dense meshes

Exact steps for others to reproduce the error
load a highpoly mesh 1.000.000 faces or more, enter sculpt mode and pan/orbit

**System Information** Operating system: Linux-5.3.0-53-generic-x86_64-with-debian-buster-sid 64 Bits Graphics card: Radeon RX 570 Series (POLARIS10, DRM 3.36.0, 5.3.0-53-generic, LLVM 9.0.0) X.Org 4.5 (Core Profile) Mesa 19.3.4 **Blender Version** Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: `211b6c29f7` Worked: version 2.82 before 56d6666689 (commit that introduced the issue) **Short description of error** Performance regression when navigating while sculpting dense meshes **Exact steps for others to reproduce the error** load a highpoly mesh 1.000.000 faces or more, enter sculpt mode and pan/orbit
Author

Added subscriber: @jeacom

Added subscriber: @jeacom

Added subscriber: @NelsonNAS

Added subscriber: @NelsonNAS

Yes, after #74692 (Sculpt Mode significantly laggy after the addition of Face Sets?) things never became as smooth as before.
Maybe there's no solution to this.

Yes, after #74692 (Sculpt Mode significantly laggy after the addition of Face Sets?) things never became as smooth as before. Maybe there's no solution to this.
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Member

Does the performance improve if you turn off Dyntopo ?
https://developer.blender.org/T76109

Does the performance improve if you turn off Dyntopo ? https://developer.blender.org/T76109
Author

In #77641#948988, @ankitm wrote:
Does the performance improve if you turn off Dyntopo ?
https://developer.blender.org/T76109

The performance is bad with or without dyntopo. but with dyntopo its worse, almost unbearable.

> In #77641#948988, @ankitm wrote: > Does the performance improve if you turn off Dyntopo ? > https://developer.blender.org/T76109 The performance is bad with or without dyntopo. but with dyntopo its worse, almost unbearable.
Author

@ankitm
I also noticed a weird behaviour.

It seems like as I orbit around the model, the performance slowly increases, it takes anywhere between 1-2 mins but it does get a usable performance eventually, in 2.82 this also happens but it takes seconds to stabilize instead of minutes.
it's really weird.

@ankitm I also noticed a weird behaviour. It seems like as I orbit around the model, the performance slowly increases, it takes anywhere between 1-2 mins but it does get a usable performance eventually, in 2.82 this also happens but it takes seconds to stabilize instead of minutes. it's really weird.
Author

Added subscriber: @fclem

Added subscriber: @fclem
Author

After bisecting between v2.82a and v2.83 I found this commit to be the first with the issue.

56d6666689

To be clear, even before this commit the performance wasnt good but after this it got much worse.

I dont see any relation besides using an amd GPU.
@fclem

After bisecting between v2.82a and v2.83 I found this commit to be the first with the issue. 56d6666689 To be clear, even before this commit the performance wasnt good but after this it got much worse. I dont see any relation besides using an amd GPU. @fclem
Member

https://mesa3d.org
Can you update the mesa version ?

https://mesa3d.org Can you update the mesa version ?
Author

In #77641#949405, @ankitm wrote:
https://mesa3d.org
Can you update the mesa version ?

I tried a later version and nothing changed.

> In #77641#949405, @ankitm wrote: > https://mesa3d.org > Can you update the mesa version ? I tried a later version and nothing changed.
Author

ok, I was playing with perf and got these record results. Maybe it could shine some light Idk.

Samples: 139K of event 'cycles', Event count (approx.): 97085600534
Overhead  Command          Shared Object           Symbol
  46,64%  blender          blender                 [.] GPU_draw_list_submit
   8,11%  blender          blender                 [.] BLI_mempool_iterstep
   6,46%  blender          blender                 [.] test_frustum_aabb
   2,83%  blender          blender                 [.] dot_v3v3
   2,56%  blender          blender                 [.] pbvh_iter_next
   1,29%  blender          blender                 [.] draw_call_batching_do
   1,22%  blender          blender                 [.] BLI_ghash_lookup 
   1,14%  blender          blender                 [.] bmesh_elem_check
   1,05%  blender          radeonsi_dri.so         [.] 0x000000000056a7a1
   1,00%  blender          blender                 [.] BM_mesh_elem_index_validate
   0,98%  blender          blender                 [.] update_search_cb
   0,98%  blender          blender                 [.] pbvh_stack_push
   0,92%  blender          radeonsi_dri.so         [.] 0x000000000013d56b
   0,90%  blender          blender                 [.] BLI_mempool_len
   0,78%  blender          radeonsi_dri.so         [.] 0x000000000073fe8f
   0,75%  blender          blender                 [.] BM_mesh_bm_to_me
   0,75%  blender          blender                 [.] draw_shgroup
   0,74%  blender          blender                 [.] BKE_pbvh_draw_cb
   0,68%  blender          blender                 [.] BLI_ghash_haskey
   0,60%  blender          blender                 [.] bmesh_radial_length
   0,55%  blender          radeonsi_dri.so         [.] 0x000000000073fe6e
   0,45%  blender          blender                 [.] BKE_pbvh_search_gather
   0,44%  blender:gdrv0    radeonsi_dri.so         [.] 0x00000000002a287a
   0,43%  blender:gdrv0    radeonsi_dri.so         [.] 0x0000000000314944
   0,39%  blender          blender                 [.] bmiter__elem_of_mesh_step
   0,38%  blender          blender                 [.] pbvh_draw_search_cb
   0,37%  blender          blender                 [.] CustomData_from_bmesh_block
   0,34%  blender          blender                 [.] BKE_pbvh_node_frustum_contain_AABB
   0,30%  blender          libc-2.27.so            [.] __memcpy_ssse3
   0,27%  blender          radeonsi_dri.so         [.] 0x000000000073fe9f
   0,27%  blender          blender                 [.] BLI_memblock_elem_get
   0,25%  blender:gdrv0    radeonsi_dri.so         [.] 0x00000000003147d5
...
ok, I was playing with perf and got these record results. Maybe it could shine some light Idk. ``` Samples: 139K of event 'cycles', Event count (approx.): 97085600534 Overhead Command Shared Object Symbol 46,64% blender blender [.] GPU_draw_list_submit 8,11% blender blender [.] BLI_mempool_iterstep 6,46% blender blender [.] test_frustum_aabb 2,83% blender blender [.] dot_v3v3 2,56% blender blender [.] pbvh_iter_next 1,29% blender blender [.] draw_call_batching_do 1,22% blender blender [.] BLI_ghash_lookup 1,14% blender blender [.] bmesh_elem_check 1,05% blender radeonsi_dri.so [.] 0x000000000056a7a1 1,00% blender blender [.] BM_mesh_elem_index_validate 0,98% blender blender [.] update_search_cb 0,98% blender blender [.] pbvh_stack_push 0,92% blender radeonsi_dri.so [.] 0x000000000013d56b 0,90% blender blender [.] BLI_mempool_len 0,78% blender radeonsi_dri.so [.] 0x000000000073fe8f 0,75% blender blender [.] BM_mesh_bm_to_me 0,75% blender blender [.] draw_shgroup 0,74% blender blender [.] BKE_pbvh_draw_cb 0,68% blender blender [.] BLI_ghash_haskey 0,60% blender blender [.] bmesh_radial_length 0,55% blender radeonsi_dri.so [.] 0x000000000073fe6e 0,45% blender blender [.] BKE_pbvh_search_gather 0,44% blender:gdrv0 radeonsi_dri.so [.] 0x00000000002a287a 0,43% blender:gdrv0 radeonsi_dri.so [.] 0x0000000000314944 0,39% blender blender [.] bmiter__elem_of_mesh_step 0,38% blender blender [.] pbvh_draw_search_cb 0,37% blender blender [.] CustomData_from_bmesh_block 0,34% blender blender [.] BKE_pbvh_node_frustum_contain_AABB 0,30% blender libc-2.27.so [.] __memcpy_ssse3 0,27% blender radeonsi_dri.so [.] 0x000000000073fe9f 0,27% blender blender [.] BLI_memblock_elem_get 0,25% blender:gdrv0 radeonsi_dri.so [.] 0x00000000003147d5 ... ```
Author

Ok, I am sort of sure that GPU_draw_list_submit is from where the lag comes.
flamegraph.svg
image.png

Ok, I am sort of sure that GPU_draw_list_submit is from where the lag comes. ![flamegraph.svg](https://archive.blender.org/developer/F8604574/flamegraph.svg) ![image.png](https://archive.blender.org/developer/F8604576/image.png)
Member

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

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

Thank you for the bisect and perf graph!

Thank you for the bisect and perf graph!

@jeacom Can you test this?

diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 8dd468b5414..277d23d19a0 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -227,7 +227,7 @@ bool GPU_context_local_shaders_workaround(void)
 bool GPU_crappy_amd_driver(void)
 {
   /* Currently are the same drivers with the `unused_fb_slot` problem. */
-  return GG.broken_amd_driver;
+  return true;
 }
 
 void gpu_extensions_init(void)```
@jeacom Can you test this? ``` diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 8dd468b5414..277d23d19a0 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -227,7 +227,7 @@ bool GPU_context_local_shaders_workaround(void) bool GPU_crappy_amd_driver(void) { /* Currently are the same drivers with the `unused_fb_slot` problem. */ - return GG.broken_amd_driver; + return true; } void gpu_extensions_init(void)```
Author

In #77641#950519, @fclem wrote:
@jeacom Can you test this?

diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 8dd468b5414..277d23d19a0 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -227,7 +227,7 @@ bool GPU_context_local_shaders_workaround(void)
 bool GPU_crappy_amd_driver(void)
 {
   /* Currently are the same drivers with the `unused_fb_slot` problem. */
-  return GG.broken_amd_driver;
+  return true;
 }
 
 void gpu_extensions_init(void)```

I tried it and the performance is back at how it was before the commit, much better when dyntopo is enabled.
It still makes me wonder why object mode drawing feels orders of magnitude faster than sculpt mode at high polycounts.
2020-06-10 06-53-28.mp4

> In #77641#950519, @fclem wrote: > @jeacom Can you test this? > ``` > diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c > index 8dd468b5414..277d23d19a0 100644 > --- a/source/blender/gpu/intern/gpu_extensions.c > +++ b/source/blender/gpu/intern/gpu_extensions.c > @@ -227,7 +227,7 @@ bool GPU_context_local_shaders_workaround(void) > bool GPU_crappy_amd_driver(void) > { > /* Currently are the same drivers with the `unused_fb_slot` problem. */ > - return GG.broken_amd_driver; > + return true; > } > > void gpu_extensions_init(void)``` I tried it and the performance is back at how it was before the commit, much better when dyntopo is enabled. It still makes me wonder why object mode drawing feels orders of magnitude faster than sculpt mode at high polycounts. [2020-06-10 06-53-28.mp4](https://archive.blender.org/developer/F8605617/2020-06-10_06-53-28.mp4)

This issue was referenced by 2087b87807

This issue was referenced by 2087b878078bf16f212e9bce48c05b4456b90d96

This issue was referenced by aeb4792044

This issue was referenced by aeb47920447da116b776f08379d5029c052fbc9c

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

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'
Clément Foucault self-assigned this 2020-07-01 02:12:09 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
5 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#77641
No description provided.