VRAM leak: orphaned DMA-BUFs sized to physical monitor accumulate while streaming a virtual headless output (wlr capture, NVENC)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- cpp, linux
調査の方向性
Start by tracing Sunshine's wlr capture entry point and its zwlr_screencopy_manager_v1 DMA-BUF lifecycle while reproducing the headless-output case with the measurements described. Compare allocation and release behavior during streaming, disconnect, and Sunshine restart; done means unattributed VRAM and orphaned DMA-BUF counts remain flat and return to baseline after disconnect.
索引モデルが issue の本文から書いたものです。
説明
Describe the Bug
Streaming from a virtual headless output leaks VRAM as orphaned DMA-BUFs that
are visible in neither nvidia-smi's process list nor any process's fd table.
The leak accumulates continuously (~1.3 GB/h) while a stream is active, and
survives client disconnect — only restarting Sunshine frees it.
Measured on an RTX 5090 32GB over two sessions:
- ~30 GB VRAM unaccounted for after ~2 days of intermittent streaming
- 24.9 GB leaked after one overnight session; freed instantly by
systemctl --user restart sunshine(24893 → 2723 MiB) - 1-hour instrumented run: unattributed VRAM grows 1819 → 2570 MiB while
streaming, stays flat after client disconnect, grows again on reconnect
Key observation: leaked buffers match the physical monitor, not the streamed one
/sys/kernel/debug/dma_buf/bufinfo (as root) shows thousands of leaked
buffers with refcount 2 and no attached devices:
size flags mode count exp_name ino name
39321600 00000002 02080007 00000002 drm 00974892 <none>
Attached Devices:
Total 0 devices attached
... (repeated ~800x, plus a second size class)
20971520 00000002 02080007 00000002 drm 00974746 <none>
- 39321600 bytes = exactly 3840×2560×4 → the physical monitor (BenQ RD280U)
- 20971520 bytes = 2048×2560×4 (aligned variant)
- The streamed output is a virtual headless monitor "SUNSHINE" at 1512×982
(output_name = SUNSHINE), i.e. the leaked buffers are the wrong size for
the capture target — they appear to be allocated per capture cycle against
the physical display and never released.
Config
capture = wlr
output_name = SUNSHINE
Hyprland (Wayland). Sunshine uses the zwlr_screencopy_manager_v1 path
("Screencasting with Wayland's protocol" in the log), NVENC encoder.
Environment
- Sunshine 2026.914.233613, commit 63d35f702ee9e362e43263742981836ec0710384
(includes #4757, #4588, #5023 — behavior persists) - Arch Linux, Hyprland (wlroots screencopy), NVIDIA RTX 5090
- Driver: nvidia-open-dkms 610.57.04
- Note: nvidia-open 610.x exposes no /sys/kernel/debug/nvidia client list, so
the leak is only visible via dma_buf/bufinfo and by diffing
nvidia-smi --query-gpu=memory.usedagainst the attributed process sum.
Reproduction
- Hyprland with one physical 4K monitor + one headless output (e.g.
hyprctl output create headless SUNSHINE), Sunshineoutput_name= the
headless output, capture = wlr - Stream for ~1 hour; periodically measure unattributed VRAM =
nvidia-smi --query-gpu=memory.usedminus the process sum - Disconnect the client — leak does not drop
systemctl --user restart sunshine— leak drops to baseline instantly
Expected behavior
DMA-BUFs used for capture should be released when the frame is consumed; VRAM
usage should stay flat (minus normal encoder buffers) for the session
lifetime and drop on client disconnect.
- 主要言語
- C++
- スター
- 42.5k
- フォーク
- 2.3k
- 平均マージ
- 21時間 16分
- マージ済み PR(30日)
- 113
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
LizardByte/Sunshine のほかの issue
-
Linux/NVIDIA: full-range 4:2:0 streams #FF0000 as green and #0000FF as dark green対応中かも @qqshfox が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
LizardByte/Sunshine#5953 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
LizardByte/Sunshine#5795 ·
メンテナーはふだん 1 日以内に返信
-
PIN pairing fails with "Missing CSRF token" - web UI never fetches/attaches the token再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
LizardByte/Sunshine#5467 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
LizardByte/Sunshine#5985 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
LizardByte/Sunshine#5979 ·
メンテナーはふだん 1 日以内に返信
LizardByte/Sunshine の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
notepad-plus-plus/notepad-plus-plus#18553 ·
メンテナーはふだん 1 日以内に返信
-
bug docs performance
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 3 日以内に返信
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
good first issue neural P2
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100