OpenGL/Nvidia Performance on windows #70167

Closed
opened 2019-09-22 21:19:37 +02:00 by Ray molenkamp · 4 comments
Member

While profiling the openXR branch where even the default cube only runs at a disappointing 45 fps i stumbled upon drw_engine_init running every frame and doing some rather expensive operations every single frame which is 'not great'

we recently removed one of those operations from the GP init but there's still plenty of others left

A quick profile shows the following flame graph

image.png

Both GPU_Draw_List_Init and GPU_Buf_Alloc seem to trigger behavior in the nvidia driver that causes it to spin off a thread and wait for it to exit, not something you'd want to do every frame (or multiple times a frame, hard to tell from a flame graph)

Discussed on chat and you requested a task low prio task for this for further investigation

CC : @fclem , @brecht

While profiling the openXR branch where even the default cube only runs at a disappointing 45 fps i stumbled upon `drw_engine_init` running every frame and doing some rather expensive operations every single frame which is 'not great' we recently removed one of those operations from the GP init but there's still plenty of others left A quick profile shows the following flame graph ![image.png](https://archive.blender.org/developer/F7770702/image.png) Both `GPU_Draw_List_Init` and `GPU_Buf_Alloc` seem to trigger behavior in the nvidia driver that causes it to spin off a thread and wait for it to exit, not something you'd want to do every frame (or multiple times a frame, hard to tell from a flame graph) Discussed on chat and you requested a task low prio task for this for further investigation CC : @fclem , @brecht
Jeroen Bakker was assigned by Ray molenkamp 2019-09-22 21:19:37 +02:00
Author
Member

Added subscribers: @fclem, @brecht, @LazyDodo

Added subscribers: @fclem, @brecht, @LazyDodo
Member

The workbench creates a UBO for AO samples And world data.

Samples UBO

Dont think it is related to the TAA/AO samples. These are being guarded, but might not that is not cached when multiple viewports with different settings are active. If that is the case the second view will re-validate the cache created by the first view and vise versa.

https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/engines/workbench/workbench_deferred.c$548-567

World UBO

The world UBO is generated on every draw call. It is not guarded. It is 304 bytes. This data is best cacheable per viewport and not globally. Otherwise it there is a slight chance of a cache hit between viewports.

Draw list

The draw list can be huge (mesh data) so that is not something I want to mess with.

Improvements

I would expect we can cache the World UBO per viewport

The workbench creates a UBO for AO samples And world data. ## Samples UBO Dont think it is related to the TAA/AO samples. These are being guarded, but might not that is not cached when multiple viewports with different settings are active. If that is the case the second view will re-validate the cache created by the first view and vise versa. https://developer.blender.org/diffusion/B/browse/master/source/blender/draw/engines/workbench/workbench_deferred.c$548-567 ## World UBO The world UBO is generated on every draw call. It is not guarded. It is 304 bytes. This data is best cacheable per viewport and not globally. Otherwise it there is a slight chance of a cache hit between viewports. ## Draw list The draw list can be huge (mesh data) so that is not something I want to mess with. ## Improvements I would expect we can cache the World UBO per viewport

I guess this is hitting a driver slow path.
Draw list : We should maybe use SSBO + Persistent mapping instead of creating / freeing potentially lots of UBOs.
Workbench : All UBOs are rather small. I agree they should use update instead of being re-specified every time if it does not add too much complexity.

I guess this is hitting a driver slow path. Draw list : We should maybe use SSBO + Persistent mapping instead of creating / freeing potentially lots of UBOs. Workbench : All UBOs are rather small. I agree they should use update instead of being re-specified every time if it does not add too much complexity.
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
3 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#70167
No description provided.