Cycles-X: Spring demo scene shows large performance regression #91428

Closed
opened 2021-09-15 09:12:32 +02:00 by Alaska · 12 comments
Member

System Information
Operating system: Linux-5.10.0-8-amd64-x86_64-with-glibc2.31 64 Bits
Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.63.01

Blender Version
Broken: version: 3.0.0 Alpha, branch: cycles-x, commit date: 2021-09-14 15:01, hash: 58ab616d4c
Worked: Prior to Cycles-X

Short description of error
The Spring demo scene shows large performance regressions on GPUs compared to normal Cycles. For example, normal Cycles may only take about a minute on my GPU, but Cycles-X takes 30 minutes. This was reported by Raimund Klink in blender chat:

Master.png Cycles-X.png
Master with OptiX Cycles-X with OptiX

Exact steps for others to reproduce the error

  1. Open the Spring demo file and render it on a GPU, comparing performance to normal Cycles. https://www.blender.org/download/demo-files/

Upon investigation I have found what seems to be the cause. The hair on Spring seems to be the issue. It is made with a shader like this:
image.png
And there are a lot of intersecting hairs and a lot of "transparent bounces". Looking at just this culprit object, you can simplify the scene with something like this:
Transparent hair performance regression Cycles-X.blend

Here are some steps to recreate the file above:

  1. Create an object with a lot of hair (a cube with 400,000 strands of hair works)
  2. Get the hairs to overlap with each other (Using the "Brownian" value in the "Physics -> Forces" tab of the particle settings (with "Advanced" enabled at the top of the particle setting section) worked for me).
  3. Give the cube a material with the culprit material (mix shader with a "Transparent BSDF")
  4. Change the "Light Paths" count for "Transparent" to something high (64) for the biggest effect
  5. Position the camera and objects in such a way that the object with the hair only takes up a small portion of the frame
  6. Render
**System Information** Operating system: Linux-5.10.0-8-amd64-x86_64-with-glibc2.31 64 Bits Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.63.01 **Blender Version** Broken: version: 3.0.0 Alpha, branch: cycles-x, commit date: 2021-09-14 15:01, hash: `58ab616d4c` Worked: Prior to Cycles-X **Short description of error** The Spring demo scene shows large performance regressions on GPUs compared to normal Cycles. For example, normal Cycles may only take about a minute on my GPU, but Cycles-X takes 30 minutes. This was reported by Raimund Klink in blender chat: |![Master.png](https://archive.blender.org/developer/F10418747/Master.png)|![Cycles-X.png](https://archive.blender.org/developer/F10418750/Cycles-X.png)| | -- | -- | |Master with OptiX|Cycles-X with OptiX| **Exact steps for others to reproduce the error** 1. Open the Spring demo file and render it on a GPU, comparing performance to normal Cycles. https://www.blender.org/download/demo-files/ Upon investigation I have found what seems to be the cause. The hair on Spring seems to be the issue. It is made with a shader like this: ![image.png](https://archive.blender.org/developer/F10418757/image.png) And there are a lot of intersecting hairs and a lot of "transparent bounces". Looking at just this culprit object, you can simplify the scene with something like this: [Transparent hair performance regression Cycles-X.blend](https://archive.blender.org/developer/F10418762/Transparent_hair_performance_regression_Cycles-X.blend) Here are some steps to recreate the file above: 1. Create an object with a lot of hair (a cube with 400,000 strands of hair works) 2. Get the hairs to overlap with each other (Using the "Brownian" value in the "Physics -> Forces" tab of the particle settings (with "Advanced" enabled at the top of the particle setting section) worked for me). 3. Give the cube a material with the culprit material (mix shader with a "Transparent BSDF") 4. Change the "Light Paths" count for "Transparent" to something high (64) for the biggest effect 5. Position the camera and objects in such a way that the object with the hair only takes up a small portion of the frame 6. Render
Author
Member

Added subscriber: @Alaska

Added subscriber: @Alaska
Author
Member

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

Changed status from 'Needs Triage' to: 'Archived'
Author
Member

Bug report for Cycles-X. Reported here for ease of access but archived because we do not accept bug reports for Cycles-X yet.

Bug report for Cycles-X. Reported here for ease of access but archived because we do not accept bug reports for Cycles-X yet.
Contributor

Added subscriber: @Raimund58

Added subscriber: @Raimund58

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Archived' to: 'Confirmed'

Changed status from 'Archived' to: 'Confirmed'

I'll open this bug since we won't fully solve it before the merge.

Part of the problem is that we are repeating some ray-curve intersection, to reduce memory usage. D12524 helps with this but does not fully solve it. Increasing the number of stored intersections helps a bit but not all that much. For the hair case, a good solution may be to add an option to bake transparency to curve vertices, and enable it by default. This would allow applying it to the throughput in the hit function, and would be a good optimization for transparent hair rendering in general.

But there is another problem, which is that full frame progressive rendering is in some way fundamentally bad at this. A subset of the pixels takes much longer to render than others, which leaves GPU occupancy low when rendering 1 sample at a time. What makes this worse is that we keep rendering 1 sample at a time because the render scheduler is not aware of this low occupancy. That could be addressed somehow. However to get the best performance we still need to render practically all samples at once, as rendering 320 samples is significantly faster than 32 samples in this scene still. So you'd have no interactive updates at all, unless you enable tiling.

There may be some other way to improve GPU occupancy, Allowing main paths to spawn multiple shadow paths if there is room available could help.

I'll open this bug since we won't fully solve it before the merge. Part of the problem is that we are repeating some ray-curve intersection, to reduce memory usage. [D12524](https://archive.blender.org/developer/D12524) helps with this but does not fully solve it. Increasing the number of stored intersections helps a bit but not all that much. For the hair case, a good solution may be to add an option to bake transparency to curve vertices, and enable it by default. This would allow applying it to the throughput in the hit function, and would be a good optimization for transparent hair rendering in general. But there is another problem, which is that full frame progressive rendering is in some way fundamentally bad at this. A subset of the pixels takes much longer to render than others, which leaves GPU occupancy low when rendering 1 sample at a time. What makes this worse is that we keep rendering 1 sample at a time because the render scheduler is not aware of this low occupancy. That could be addressed somehow. However to get the best performance we still need to render practically all samples at once, as rendering 320 samples is significantly faster than 32 samples in this scene still. So you'd have no interactive updates at all, unless you enable tiling. There may be some other way to improve GPU occupancy, Allowing main paths to spawn multiple shadow paths if there is room available could help.

This issue was referenced by a9ad15a88f129a0593432e1217610ac840687497

This issue was referenced by a9ad15a88f129a0593432e1217610ac840687497

This issue was referenced by blender/cycles@6cafe6adc7

This issue was referenced by blender/cycles@6cafe6adc7cbd8aca3849b1b3e275f6c90f921c4

This issue was referenced by fd77a28031

This issue was referenced by fd77a28031daff3122ded3a1cb37a7fb44feedf6

Added subscriber: @Wovchick

Added subscriber: @Wovchick

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Brecht Van Lommel self-assigned this 2021-10-19 15:30:55 +02:00
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
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#91428
No description provided.