project-nomad/install
Chris Sherwood 0b25638a3e fix(AI): vendor-aware AMD HSA override + benchmark discrete-GPU detection
Closes #810.

## Bug A: HSA_OVERRIDE_GFX_VERSION=11.0.0 was unconditional

PR #804 set HSA_OVERRIDE_GFX_VERSION=11.0.0 for any AMD GPU. The inline comment
claimed this was harmless on supported discrete cards (gfx1030 RX 6800, etc.) — empirically false. With the override, Ollama crashes during GPU discovery on
gfx1030 and falls back to CPU silently. Affects every NOMAD user with an
RX 6800 or other RDNA 2 discrete card.

The correct value depends on the gfx version:
- gfx1030, gfx1100, gfx1101, gfx1102: officially supported by ROCm — no override
- gfx1031..gfx1036 (RDNA 2 variants + iGPUs like Rembrandt 680M): 10.3.0
- gfx1103, gfx1150, gfx1151 (Phoenix 780M, Strix 890M, Strix Halo): 11.0.0

### Resolution chain in `_resolveAmdHsaOverride()`

1. KV `ai.amdHsaOverride` — manual override; accepts 'none' to disable, or a
   semver-style value to force.
2. Marker file `/app/storage/.nomad-amd-gfx` — written by install_nomad.sh
   based on lspci codename. Mapped to override via `_mapGfxToHsaOverride()`.
3. Default: `11.0.0` — preserves prior behavior so existing iGPU users
   (780M / 890M, the dominant AMD population today) don't regress on upgrade.

Discrete RDNA 2 users on existing installs can opt out via
`ai.amdHsaOverride='none'` and force-reinstall AI Assistant, OR re-run
install_nomad.sh to refresh the marker file.

The helper is used in both `createContainer` (initial install) and
`updateContainer` (image update) paths, replacing the unconditional push.

## Bug B: BenchmarkService had no AMD discrete detection path

`BenchmarkService.getHardwareInfo()` had three GPU detection fallbacks:
1. `si.graphics()` — empty inside Docker for AMD
2. nvidia-smi — NVIDIA only
3. AMD APU regex from CPU model — integrated only

Result: AMD discrete cards (RX 6800, RX 7900 XTX, etc.) showed up as
"GPU: Not detected" on the leaderboard despite ROCm working. Corrupts
leaderboard data quality for that population.

Fix: after the existing fallbacks, call `SystemService.getSystemInfo()` and
read `graphics.controllers[0].model`. That path already handles AMD via the
marker file + Ollama log probe added in PR #804, so we're reusing existing
plumbing rather than duplicating detection logic.

## install_nomad.sh changes

The existing AMD detection block already runs lspci. Added a codename parse
step that maps Navi 21/22/23/24, Rembrandt, Phoenix1/Phoenix2, Strix/Strix
Point/Strix Halo, and Navi 31/32/33 to gfx versions, then writes
`/opt/project-nomad/storage/.nomad-amd-gfx`. Unknown codenames write nothing
(admin handles missing-marker case via the backward-compat default).

## Validation

Both bugs were originally surfaced and validated empirically on RX 6800 /
gfx1030 / Ubuntu 24.04 + kernel 6.17 + ollama/ollama:rocm during the #810
filing. Validation grid from that report:

| Run                                           | NOMAD Score | tok/s | GPU detected            |
|-----------------------------------------------|-------------|-------|-------------------------|
| Pre-fix (Bug A active)                        | n/a         | 0     | yes, but library=cpu    |
| HSA_OVERRIDE removed, Bug B unfixed           | 73.8        | 221.6 | "Not detected"          |
| Both fixes hot-patched (this PR's behavior)   | 73.7        | 216.0 | AMD Radeon RX 6800      |

Local checks: `npm run typecheck` clean, `npm run build` clean.
2026-05-05 12:11:56 -07:00
..
sidecar-disk-collector fix(disk-collector): fix storage reporting for NFS mounts 2026-04-17 12:15:43 -07:00
sidecar-updater fix: update channel flexibility 2026-03-05 04:06:56 +00:00
collect_disk_info.sh feat: disk info collection 2025-12-07 19:13:43 -08:00
entrypoint.sh feat: make Nomad fully composable 2026-03-20 11:46:10 -07:00
install_nomad.sh fix(AI): vendor-aware AMD HSA override + benchmark discrete-GPU detection 2026-05-05 12:11:56 -07:00
management_compose.yaml feat: gzip compression by default for all registered routes 2026-04-03 14:26:50 -07:00
migrate-disk-collector.md build: compose and install script updates for disk-collector sidecar 2026-03-14 19:54:51 -07:00
migrate-disk-collector.sh chore: add additional warnings to migrate-disk-collector 2026-03-15 03:19:52 +00:00
run_updater_fixes.sh fix: container update pattern in run_updater_fixes 2026-03-05 04:32:09 +00:00
start_nomad.sh feat(install): add start & stop helper scripts 2025-08-08 15:07:32 -07:00
stop_nomad.sh feat(install): add start & stop helper scripts 2025-08-08 15:07:32 -07:00
uninstall_nomad.sh ops: added a check for docker-compose version in Nomad utility scripts 2026-03-20 11:46:10 -07:00
update_nomad.sh ops: added a check for docker-compose version in Nomad utility scripts 2026-03-20 11:46:10 -07:00
wikipedia_en_100_mini_2025-06.zim fix(ZIM): host initial zim download in GH repo 2025-09-02 22:44:01 -07:00
wikipedia_en_100_mini_2026-01.zim build: add latest initial zim file 2026-03-24 02:08:18 +00:00