Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

berthd --gpu-backend amd exits at startup on a desktop session: "process VRAM exceeds card usage"

Offen
#196 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

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
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
go, linux
Bereich
backend, devtools

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

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus T-Crypt/berth

Alle Issues in T-Crypt/berth

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.