berthd --gpu-backend amd exits at startup on a desktop session: "process VRAM exceeds card usage"
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start by tracing the AMD GPU inventory path that reports “process VRAM exceeds card usage” and inspect how it reads and sums amdgpu fdinfo, especially purgeable and shared memory fields. Reproduce with the supplied desktop-session data and compare the per-process totals with card1's mem_info_vram_used. Done means the AMD observation can start on this workload and reports or handles overcounting safely; the issue does not name test files or source paths.
索引モデルが issue の本文から書いたものです。
説明
Version: berth 0.3.4 (linux-amd64, release binary, SHA256 verified) Backend: berth daemon --gpu-backend amd --gpu 1 --poll 2s (experimental Linux AMD path)
Environment
GPU: AMD Radeon AI PRO R9700, 32 GB, Navi 48 / gfx1201 (PCI 1002:7551 rev c0), DRM card1, pdev 0000:03:00.0
Second amdgpu device: Ryzen 9 7950X3D iGPU (1002:164e), DRM card0
OS / kernel: Ubuntu 26.04.1 LTS, 7.0.0-38-generic
Full GNOME desktop session on the same machine (gnome-shell, Xwayland, Chrome, several Electron apps), plus ComfyUI (PyTorch/ROCm) and a llama-server (Vulkan) on the R9700. No ROCm SDK tools needed or installed for Berth.
What happens
The daemon refuses to start and systemd restart-loops it:
[ERROR] gpu inventory: GPU observation unavailable: AMD: process VRAM exceeds card usage; memory changed during scan, retrying
It is not transient: it reproduces on every start, and under a manual foreground run (berth daemon --gpu-backend amd --gpu 1 --poll 2s --socket /tmp/x.sock).
Data
/sys/class/drm/card1/device/mem_info_vram_used = 29.27 GiB.
Summing amdgpu fdinfo across every process visible to my user (deduplicated per pid + drm-client-id, drm-pdev = the R9700 only):
Accounting Sum vs card used
drm-memory-vram (= drm-resident-vram) 43.78 GiB exceeds by 14.5 GiB
drm-total-vram 35.77 GiB exceeds by 6.5 GiB
drm-resident-vram minus drm-purgeable-vram 32.59 GiB exceeds by 3.3 GiB
None of these fit under the card total. Only my user's processes are visible, so the true sum would be higher still.
The largest contributor is the compositor. One fd of gnome-shell reports:
drm-total-vram: 1867012 KiB (1.78 GiB)
drm-shared-vram: 587136 KiB
drm-resident-vram: 11729968 KiB (11.19 GiB)
drm-purgeable-vram: 10440192 KiB (9.96 GiB)
drm-memory-vram: 11729968 KiB
For contrast, ComfyUI (PyTorch/ROCm) is consistent: total = resident = memory = 19047308 KiB, purgeable 0.
What I think is going on (not verified against the Berth source)
drm-memory-vram/resident includes a large purgeable portion for desktop clients (buffers the kernel may reclaim), so it is not "memory this process is holding hostage".
Even after discounting purgeable, a residual ~3 GiB remains. Buffers shared between clients (compositor + apps) are plausibly counted once per client.
Suggestion
On a desktop machine the invariant sum(process VRAM) <= card used cannot be assumed from fdinfo. Options that would let the probe run here:
subtract purgeable (and shared) from per-process figures, and
treat a residual overcount as a warning that clamps or scales the attribution, instead of making the whole observation unavailable and exiting.
A flag to downgrade the check would also work as a stopgap.
Why it matters
Machines with a discrete AMD card often also drive the desktop from it. This one is a single-GPU workstation that also runs ComfyUI and vision/text models, which is the case Berth is for. Happy to run a debug build or send more fdinfo dumps.
Side note
berth service install --harbor panicked (nil deref at internal/cli/service.go:183) when run from a shell with no user-session D-Bus (XDG_RUNTIME_DIR / DBUS_SESSION_BUS_ADDRESS unset), instead of printing an error. It wrote the unit files and worked once those variables were set.
- 主要言語
- Go
- スター
- 226
- フォーク
- 20
- 平均マージ
- 51分
- マージ済み PR(30日)
- 225
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
T-Crypt/berth のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
T-Crypt/berth#204 · コメント 11 件 ·
メンテナーはふだん 1 日以内に返信
-
Lend part of a card from a running engine and get it back, without a park or a reload対応中かも @T-Crypt が 6 日前に担当しました。 オープン
T-Crypt/berth#189 · コメント 26 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
T-Crypt/berth#172 · コメント 16 件 ·
メンテナーはふだん 1 日以内に返信
-
Idea: Proxmox support in every layout (testers wanted)対応中かも @sharmis-tp が 3 日前に担当しました。 オープンenhancement help wanted
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
T-Crypt/berth#128 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
ux
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
evcc-io/evcc#35605 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug report
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
nightgauge/nightgauge#2732 ·
メンテナーはふだん 1 日以内に返信
-
fix below CVEsオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 5 日以内に返信
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100