ui/gpu: show split tag in model list; fix AMD vs NVIDIA VRAM unit mismatch

- Model list: a model with cross-GPU split now tags as "<lead> ⇄split 📌" (with a
  tooltip naming the lead card + ratio/auto), so the list makes "loads here, spills
  onto the other GPU(s)" visible instead of looking like a plain pin.
- gpu_detect._amd_stats reported VRAM in decimal GB (bytes/1e9) while _nvidia_stats
  used GiB (MiB/1024). That made the two cards ~7% out of step in the dashboard and
  in any cross-card free/total sum. AMD now reports GiB to match, so free-VRAM is
  consistent and comparable across both cards.
Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
parent 0490e2c9
......@@ -1997,6 +1997,16 @@ function _engineTagHtml(m, s){
const color = (lc.includes('nv')) ? '#76b900'
: (lc.includes('rad') || lc.includes('amd')) ? '#ed1c24'
: 'var(--text-3)';
// Cross-GPU split: the model runs on `eng` (its lead card) but spills onto the
// other GPU(s) for extra VRAM. Show it in the tag so the list makes the split
// visible, e.g. "nvidia ⇄split 📌".
const split = !!(s && s.gpu_split);
if(split){
const ratio = ((s && s.tensor_split) || '').trim();
const title = 'Loads on ' + eng + ', split across all GPUs ('
+ (ratio ? ('ratio ' + ratio) : 'auto by free VRAM') + ')';
return `<span class="badge" title="${esc(title)}" style="font-size:9px;padding:.05rem .3rem;margin:.1rem .1rem 0 0;vertical-align:middle;border:1px solid ${color};color:${color};background:transparent">${esc(eng)} ⇄split${pinned?' 📌':''}</span>`;
}
const title = pinned ? ('Pinned to engine: ' + eng) : ('Runs on: ' + eng + ' (auto)');
return `<span class="badge" title="${esc(title)}" style="font-size:9px;padding:.05rem .3rem;margin:.1rem .1rem 0 0;vertical-align:middle;border:1px solid ${color};color:${color};background:transparent">${esc(eng)}${pinned?' 📌':''}</span>`;
}
......
......@@ -336,8 +336,11 @@ def _amd_stats() -> list:
"vendor": "amd", "index": int(base[4:]),
"name": _amd_gpu_name(dev, base),
"util": float(busy) if busy and busy.isdigit() else None,
"mem_used": round(int(used) / 1e9, 2) if used and used.isdigit() else None,
"mem_total": round(int(total) / 1e9, 2) if total and total.isdigit() else None,
# GiB (binary) to MATCH _nvidia_stats (which divides nvidia-smi MiB by
# 1024). Mixing GiB and decimal-GB made the two cards' VRAM ~7% out of
# step in the dashboard and any cross-card total.
"mem_used": round(int(used) / (1024 ** 3), 2) if used and used.isdigit() else None,
"mem_total": round(int(total) / (1024 ** 3), 2) if total and total.isdigit() else None,
"temp": temp})
return cards
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment