GPU clustering: `metadata_staging_pending_buffers` grows by one buffer every frame
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- performance
Direzione di ricerca
Leggi crates/bevy_pbr/src/cluster/gpu.rs, in particolare ViewClusteringReadbackData::get_or_create_staging_buffer e schedule_readback_buffer_map; l’issue segnala un vettore di buffer in attesa su cui si scrive soltanto e il callback che ricicla i buffer. Controlla i test esistenti del clustering GPU oppure esegui l’esempio della scena 3D per un periodo prolungato. Il lavoro è completato quando gli staging buffer non si accumulano più e la memoria rimane stabile durante il carico di lavoro segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bevy version and features
- Bevy 0.20.0 (also 0.19.1; the code is unchanged on
mainas of 84e2d2c) - Features:
bevy_render,bevy_core_pipeline,bevy_pbr, default GPU clustering
Relevant system information
- macOS 27 on Apple M1 Max, Metal backend (also seen on iOS 27 / iPadOS 27 devices: A20 Pro, M5)
- Log:
GPU clustering is supported on this device.
What you did
Ran a small 3D scene (one DirectionalLight with shadows, a plane and a few meshes, one Camera3d) for 15–60 minutes. examples/3d/3d_scene.rs should show the same.
What went wrong
Memory grows for as long as the app runs, about 150 KB per minute at 60 fps (twice that at 120 Hz). Over 60 minutes the process footprint grew 304 → 308 MB (release) and 310 → 317 MB (debug), still rising at the end.
A heap analysis with MallocStackLogging shows a single block that keeps being reallocated to a larger size, allocated from bevy_pbr::cluster::gpu::cluster_on_gpu.
ViewClusteringReadbackData::get_or_create_staging_buffer (crates/bevy_pbr/src/cluster/gpu.rs) pushes every staging buffer into metadata_staging_pending_buffers:
self.metadata_staging_pending_buffers
.push(staging_buffer.clone());
Nothing ever removes entries from that Vec. The map callback in schedule_readback_buffer_map only pushes the recycled buffer into metadata_staging_free_buffers, so metadata_staging_pending_buffers gains one Buffer per view per frame for the lifetime of the app. The field is never read.
Additional information
- The iOS simulator is not affected because GPU clustering is disabled there (
target_abi = "sim"). - Workaround: set
GlobalClusterSettings::gpu_clusteringtoNoneafterPbrPlugin::finish(we do it in aStartupsystem). With CPU clustering the growing block is gone and the heap stays flat over 30 minutes. - Possible fix: remove
metadata_staging_pending_buffersentirely (it is write-only), or remove the buffer from it in the map callback.
- Lingua principale
- Rust
- Stelle
- 49.7k
- Fork
- 5k
- Merge medio
- 3g 19h
- PR unite (30g)
- 134
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bevyengine/bevy
-
C-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bevyengine/bevy#26536 ·
I maintainer di solito rispondono entro 2 giorni
-
Placeholder has no defaultForse già presa Una pull request collegata a questa issue è aperta o già unita. ApertaC-Feature S-Needs-Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
bevyengine/bevy#26532 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
C-Feature S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bevyengine/bevy#26500 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
C-Feature S-Needs-Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
bevyengine/bevy#26499 ·
I maintainer di solito rispondono entro 2 giorni
-
`compute_histogram` in auto exposure writes past the end of the 64-bin histogramForse già presa @dev-matru l’ha presa 3 giorni fa. ApertaA-Rendering C-Bug D-Straightforward S-Ready-For-Implementation X-Uncontroversial
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
bevyengine/bevy#26479 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di bevyengine/bevy
Issue simili
-
bug UI
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
wardian-app/Wardian#1746 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
jlcodes99/cockpit-tools#3125 ·
I maintainer di solito rispondono entro 2 giorni
-
bug user-sprint
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Vondor/KassenSturz#967 ·
I maintainer di solito rispondono entro 1 giorno
-
area/ci
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Incremental sync warns "no stored highest_uid" on every round for folders with no new mailApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
rustmailer/bichon#411 ·