berthd --gpu-backend amd exits at startup on a desktop session: "process VRAM exceeds card usage"
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Go
- Sterne
- 226
- Forks
- 20
- Ø Merge
- 51 Min.
- Gemergte PRs (30 T.)
- 225
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus T-Crypt/berth
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 42/100
T-Crypt/berth#204 · 11 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Lend part of a card from a running engine and get it back, without a park or a reloadEvtl. vergeben @T-Crypt hat das vor 7 Tagen übernommen. Offen
T-Crypt/berth#189 · 27 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
T-Crypt/berth#172 · 16 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Idea: Proxmox support in every layout (testers wanted)Evtl. vergeben @sharmis-tp hat das vor 3 Tagen übernommen. Offenenhancement help wanted
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
T-Crypt/berth#128 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
automation doc-healer documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Anthropic /v1/messages: only the last thinking block of an assistant message is keptEvtl. vergeben @Shayan12456 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
ollama/ollama#19415 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:recipes event:contribfest format:human-first source:agent status:needs-triage type:recipe
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
cadence-workflow/cadence-ai-samples#140 ·
Maintainer antworten meist innerhalb von 1 Tag
-
customer issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
dolthub/doltgresql#3716 ·
Maintainer antworten meist innerhalb von 1 Tag
-
ux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
evcc-io/evcc#35605 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag