GPU subdivision: Bad performance with viewport statistics #96434

Closed
opened 11 months ago by reanimate · 18 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.23

Blender Version
Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-03-14 00:08, hash: b959f603da.
Also broken in 3.1.0 Stable release.
Worked: None i can find.

I'm getting bad perfomance when using Modifier stacks and GPU Subdivision are enabled.
the video are recorded on 3.1 stable release, issue also occurred on 3.2 alpha.
Repro scene are attached.
ModifierStack_GPUSubdiv_BadPerformance.blend
blender_ksRjvVXVIX.mp4

Exact steps for others to reproduce the error

  1. Open the scene file and try to change the Bend Angle on Simple Deform modifier.
  2. Now Toggle the GPU Subdiv settings and repeat step one.
  3. There's should be a performance difference when GPU Subdiv are enabled.

or just watch the attached video of a flailing magazine

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.23 **Blender Version** Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-03-14 00:08, hash: `b959f603da`. Also broken in 3.1.0 Stable release. Worked: None i can find. I'm getting bad perfomance when using Modifier stacks and GPU Subdivision are enabled. the video are recorded on 3.1 stable release, issue also occurred on 3.2 alpha. Repro scene are attached. [ModifierStack_GPUSubdiv_BadPerformance.blend](https://archive.blender.org/developer/F12926703/ModifierStack_GPUSubdiv_BadPerformance.blend) [blender_ksRjvVXVIX.mp4](https://archive.blender.org/developer/F12926702/blender_ksRjvVXVIX.mp4) **Exact steps for others to reproduce the error** 1. Open the scene file and try to change the Bend Angle on Simple Deform modifier. 2. Now Toggle the GPU Subdiv settings and repeat step one. 3. There's should be a performance difference when GPU Subdiv are enabled. or just watch the attached video of a flailing magazine
Poster

Added subscriber: @reanimate

Added subscriber: @reanimate
Collaborator

#97182 was marked as duplicate of this issue

#97182 was marked as duplicate of this issue
Collaborator

Added subscribers: @kevindietrich, @mano-wii

Added subscribers: @kevindietrich, @mano-wii
Collaborator

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

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

I can confirm the delay in the example presented in the file.
The GPU subdivision update is 1/5 of the CPU subdivision performance.
@kevindietrich, any idea why this is happening?


Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: Radeon (TM) RX 480 Graphics ATI Technologies Inc. 4.5.14802 Core Profile/Debug Context 22.2.3 30.0.14029.5006

I can confirm the delay in the example presented in the file. The GPU subdivision update is 1/5 of the CPU subdivision performance. @kevindietrich, any idea why this is happening? --- Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: Radeon (TM) RX 480 Graphics ATI Technologies Inc. 4.5.14802 Core Profile/Debug Context 22.2.3 30.0.14029.5006
Collaborator

This is because the viewport statistics require a the final mesh for the number of triangles/vertices/etc. so the subdivision is evaluated twice: on the CPU and on the GPU. I'm not sure yet how we can improve the situation, maybe by caching the stats when evaluating on the GPU.

This is because the viewport statistics require a the final mesh for the number of triangles/vertices/etc. so the subdivision is evaluated twice: on the CPU and on the GPU. I'm not sure yet how we can improve the situation, maybe by caching the stats when evaluating on the GPU.
kevindietrich changed title from Modifier Stack causing bad performance on GPU Subdivision to Bad GPU Subdivision performance with viewport statistics 11 months ago
Collaborator

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

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'
Poster

In #96434#1326519, @kevindietrich wrote:
This is because the viewport statistics require a the final mesh for the number of triangles/vertices/etc. so the subdivision is evaluated twice: on the CPU and on the GPU. I'm not sure yet how we can improve the situation, maybe by caching the stats when evaluating on the GPU.

Oooh interesting, turning off statistics did bring back the performance.
Hmm how about delaying the update of the statistics? ie on mouse click up event?

> In #96434#1326519, @kevindietrich wrote: > This is because the viewport statistics require a the final mesh for the number of triangles/vertices/etc. so the subdivision is evaluated twice: on the CPU and on the GPU. I'm not sure yet how we can improve the situation, maybe by caching the stats when evaluating on the GPU. Oooh interesting, turning off statistics did bring back the performance. Hmm how about delaying the update of the statistics? ie on mouse click up event?
Collaborator

In #96434#1328333, @reanimate wrote:
Oooh interesting, turning off statistics did bring back the performance.
Hmm how about delaying the update of the statistics? ie on mouse click up event?

The statistics update is part of the 3D view draw code, they will be refreshed on each redraw event, it is not really possible to discriminate those events and know which one to delay statistics, and how the delay should be defined.

> In #96434#1328333, @reanimate wrote: > Oooh interesting, turning off statistics did bring back the performance. > Hmm how about delaying the update of the statistics? ie on mouse click up event? The statistics update is part of the 3D view draw code, they will be refreshed on each redraw event, it is not really possible to discriminate those events and know which one to delay statistics, and how the delay should be defined.
Poster

In #96434#1328661, @kevindietrich wrote:

In #96434#1328333, @reanimate wrote:
Oooh interesting, turning off statistics did bring back the performance.
Hmm how about delaying the update of the statistics? ie on mouse click up event?

The statistics update is part of the 3D view draw code, they will be refreshed on each redraw event, it is not really possible to discriminate those events and know which one to delay statistics, and how the delay should be defined.

I see, this is kinda problematic. Thanks for the information

> In #96434#1328661, @kevindietrich wrote: >> In #96434#1328333, @reanimate wrote: >> Oooh interesting, turning off statistics did bring back the performance. >> Hmm how about delaying the update of the statistics? ie on mouse click up event? > > The statistics update is part of the 3D view draw code, they will be refreshed on each redraw event, it is not really possible to discriminate those events and know which one to delay statistics, and how the delay should be defined. I see, this is kinda problematic. Thanks for the information
Collaborator

Added subscriber: @Smjert

Added subscriber: @Smjert
lichtwerk changed title from Bad GPU Subdivision performance with viewport statistics to GPU subdivision: Bad performance with viewport statistics 10 months ago
Collaborator

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Collaborator

Talked to @kevindietrich , setting to High prio (since it is a bug in a new feature according to the playbook

Talked to @kevindietrich , setting to High prio (since it is a bug in a new feature according to the [playbook ](https://wiki.blender.org/wiki/Process/Bug_Reports/Triaging_Playbook)
Owner

Added subscriber: @brecht

Added subscriber: @brecht
Owner

Could we compute the stats without actually performing the subdivision? Or even just provide a rough estimate? I don't think the exact number is even that important, some guess based on the subdivision level could be enough.

Could we compute the stats without actually performing the subdivision? Or even just provide a rough estimate? I don't think the exact number is even that important, some guess based on the subdivision level could be enough.
Collaborator

Actually we can just get the counters from the draw code's subdivision grid traversal, they are cached there anyway.

Actually we can just get the counters from the draw code's subdivision grid traversal, they are cached there anyway.
Collaborator

This issue was referenced by 163f6a17e4

This issue was referenced by 163f6a17e4fe60ce917715afc5bb5eae3d5ff07a
Collaborator

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
kevindietrich closed this issue 10 months ago
kevindietrich self-assigned this 10 months ago
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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
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/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#96434
Loading…
There is no content yet.