fix(2.0): GPU-Metrik findet Strix-Halo-Card dynamisch (card1) + GTT

Real-Box-Befund: GPU ist card1 (nicht hardcoded card0), Connector-Dirs
uebersprungen. Zusaetzlich GTT (echter Unified-Memory-Pool) statt nur
VRAM-Carve-out. Frontend zeigt GTT bevorzugt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-06-25 08:33:29 +02:00
parent 1b332f86e6
commit 2e6655c398
5 changed files with 38 additions and 21 deletions
+18 -9
View File
@@ -23,16 +23,25 @@ def _read_int(path: str) -> int | None:
def _gpu_sysfs() -> dict | None:
"""AMD-GPU-Auslastung + VRAM via sysfs (Linux). None, wenn nicht vorhanden."""
base = "/sys/class/drm/card0/device"
if not os.path.isdir(base):
"""AMD-GPU-Auslastung + Speicher via sysfs (Linux). Findet die Basis-Card
dynamisch (Strix Halo ist oft card1, nicht card0) und überspringt die
Connector-Verzeichnisse (card1-DP-1 …). Strix Halo nutzt Unified Memory →
GTT ist der eigentliche große Pool; VRAM ist nur der kleine Carve-out."""
for dev in sorted(glob.glob("/sys/class/drm/card*/device")):
card = dev.split("/")[-2] # z.B. "card1" oder "card1-DP-1"
if "-" in card: # Connector-Dir → kein GPU-Device
continue
busy = _read_int(f"{dev}/gpu_busy_percent")
if busy is None:
continue
return {
"busy_percent": busy,
"vram_used": _read_int(f"{dev}/mem_info_vram_used"),
"vram_total": _read_int(f"{dev}/mem_info_vram_total"),
"gtt_used": _read_int(f"{dev}/mem_info_gtt_used"),
"gtt_total": _read_int(f"{dev}/mem_info_gtt_total"),
}
return None
busy = _read_int(f"{base}/gpu_busy_percent")
vram_used = _read_int(f"{base}/mem_info_vram_used")
vram_total = _read_int(f"{base}/mem_info_vram_total")
if busy is None and vram_used is None:
return None
return {"busy_percent": busy, "vram_used": vram_used, "vram_total": vram_total}
def _temps() -> dict | None:
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -6,7 +6,7 @@
<meta name="theme-color" content="#0d1117" />
<link rel="manifest" href="/manifest.webmanifest" />
<title>Mission Control 2.0</title>
<script type="module" crossorigin src="/assets/index-BYe3GDjZ.js"></script>
<script type="module" crossorigin src="/assets/index-CDBFzDBf.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CatWSvf4.css">
</head>
<body>
+7 -1
View File
@@ -83,7 +83,13 @@ export interface RoutingResp {
export interface SystemStatus {
cpu: { percent: number; cores: number | null }
ram: { total: number; used: number; percent: number }
gpu: { busy_percent: number | null; vram_used: number | null; vram_total: number | null } | null
gpu: {
busy_percent: number | null
vram_used: number | null
vram_total: number | null
gtt_used?: number | null
gtt_total?: number | null
} | null
temp: { cpu?: number; gpu?: number } | null
disk: { total: number; used: number; percent: number } | null
}
+3 -1
View File
@@ -74,7 +74,9 @@ export function SystemView() {
label="GPU"
percent={s.gpu.busy_percent}
detail={
s.gpu.vram_used != null && s.gpu.vram_total != null
s.gpu.gtt_used != null && s.gpu.gtt_total
? `${gb(s.gpu.gtt_used)} / ${gb(s.gpu.gtt_total)} GB (GTT/unified)`
: s.gpu.vram_used != null && s.gpu.vram_total
? `${gb(s.gpu.vram_used)} / ${gb(s.gpu.vram_total)} GB VRAM`
: undefined
}