Vulkan - Constantly increasing shared memory/RAM usage as frames are rendered - Recent NVIDIA drivers #127225
Labels
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, 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
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
Core
Module
Development Management
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
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#127225
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.22631-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 4090 NVIDIA Corporation 560.94.0.0
Blender Version
Broken: version: 4.3.0 Alpha, branch: main, commit date: 2024-09-06 06:32, hash:
792c29e52f3d
Worked: Never as Vulkan was only recently enabled.
Short description of error
As frames are rendered in EEVEE, GPU shared memory/RAM increases until Blender crashes. See attached video for demonstration.
Exact steps for others to reproduce the error
Edit -> Preferences
from the top of Blender.System
tab change the backend to Vulkan.Hmm, I am not able to reproduce this one (or 127267 which is similar). The only difference here is that I'm using driver version 551.61.0.0
I can confirm the downgrading to NVIDIA GPU driver 551.61.0.0 resolves the issue
Vulkan - EEVEE sees increasing shared memory/RAM usage as frames are rendered.to Vulkan - EEVEE sees increasing shared memory/RAM usage as frames are rendered - Recent NVIDIA driversSo updated to latest game ready driver 560.94 but unable to confirm the memory usage or a leak.
@Alaska hi, is it resolved already in today's main?
I can still reproduce the issue in latest main, both in a local build and the latest from the build bot
System Information
Operating system: Windows-10-10.0.22631-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 4090 NVIDIA Corporation 560.94.0.0
Local version: 4.3.0 Alpha, branch: main, commit date: 2024-09-10 12:55, hash:
3fdc9e9637b5
Build bot version: 4.3.0 Alpha, branch: main, commit date: 2024-09-09 22:55, hash:
72a0be0944f9
JFYI, I can reproduce the same issue in Wireframe / Solid viewport modes as well.
With Vulkan backend?
Yes
Vulkan - EEVEE sees increasing shared memory/RAM usage as frames are rendered - Recent NVIDIA driversto Vulkan - Constantly increasing shared memory/RAM usage as frames are rendered - Recent NVIDIA driversCC @Jeroen-Bakker so you know about this issue.
The issue is that discarded resources (
VKResourcePool::discard_pool
) are not being destroyed:(I'm printing the total elements in the discarded pool)
This reduces a little, but not the right fix:
However still some resources are not being released with the fix diff, leaving a animation playing slowly increases memory usage
The idea of the discard pool is similar to what we have for OpenGL. Background rendering cannot free resources as they may still be in use by other threads. When Blender is started with UI these resources should be picked up and put in the swap chain resource list. After a swap chain image is used again we know for sure these resources can be removed.
device.debug_print()
inswap_buffers_pre_handler
can help to track this design. I will review the code to find missing parts.I see whats happening:
Nividia drivers tries to use
Vulkan/OpenGL present method = Prefer layered on DXGI Swapchain
and seems to fails to cycle between swap-chain images,vkAcquireNextImageKHR
always set returnsImageIndex=0
(at high fps seem that sometimes it does cycles correctly), soswap_buffers_pre_handler
would never free resources with this checkassign_if_different(thread_data.resource_pool_index, swap_chain_data.swap_chain_index)
since always will be 0. (Maybe isvkQueuePresentKHR
what is failing, they some open reports about)With
Vulkan/OpenGL present method = Prefer Native
swap-chain images cycle correctly and memory usage still increases but not as fast (50MB/s vs 400-500 MB/s withPrefer layered on DXGI Swapchain
).@Alaska Could you try this setting?
@guishe Swapping to
Prefer Native
does seem to slow down the memory leakAccording to some Vulkan experts we have made an incorrect assumption on the swap chain index.
So there are multiple things in play here: