Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24.09 Release - ProjectedShadowmapAtlas memory leak #18507

Open
MateuszWasilewski opened this issue Nov 25, 2024 · 1 comment
Open

24.09 Release - ProjectedShadowmapAtlas memory leak #18507

MateuszWasilewski opened this issue Nov 25, 2024 · 1 comment
Assignees
Labels
kind/bug-2409 Used for stabilization/24.09 issues sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio.

Comments

@MateuszWasilewski
Copy link
Contributor

Bug Description

When creating repeatedly entering Game Mode AttachmentImages ProjectedShadowmapAtlas.Main tend to accumulate and are not cleaned up. This results in GPU memory leak after each enter / exit Game Mode, size is propotional to number of lights on the scene.

Assets-Required

DefaultLevel from DefaultProject

Steps to Reproduce

  1. Create new Default Level
  2. Change Sun for Light - Spot Disk
  • Increase intensity to ~ 1000 lm
  • Enable shadows
  • Set shadowmap size to 2048
    image
  1. Note GPU memory usage - 637 MiB on my setup
  2. Enter Game Mode
  3. Exit Game Mode - 701 MiB on my setup

GPU memory increases after each game mode change.

Expected Behavior

GPU memory usage should return to original state after game mode exit.

Actual Behavior

GPU memory is still occupied after game mode exit.

Screenshots/Videos

GPU memory usage after starting Editor:
image

After several game mode changes memory looks similarly to:
image

Found In Branch

release tag 2410.1

Commit ID From

o3de/o3de - 2410.1
commit id: c602b49

Desktop/Device

Device: PC
OS: Ubuntu 22.04.5 LTS x86_64
CPU: 11th Gen Intel i7-11800H
GPU: NVIDIA GeForce RTX 3070 Mobile
Memory: 64GB

Additional Context

Issue also occurs in GameLauncher when using ILevelSystem::LoadLevel

@MateuszWasilewski MateuszWasilewski added kind/bug-2409 Used for stabilization/24.09 issues needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 25, 2024
@spham-amzn spham-amzn added sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 11, 2024
@moudgils
Copy link
Contributor

It seems like someone may still be holding on to a refcount for m_shadowBufferHandler. If I had to guess it is probably the ProjectedShadowFeatureProcessor that is holding on to the ref. This may be by design that the feature processor does not release the texture map as it can simply be re-used again. One way to track this is to see if ProjectedShadowFeatureProcessor::ReleaseShadow is called after the level is unloaded. This will require further investigation.

@moudgils moudgils removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-2409 Used for stabilization/24.09 issues sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio.
Projects
None yet
Development

No branches or pull requests

4 participants