ROCm Doctor
Given a "ROCm / PyTorch / llama.cpp isn't working on my AMD GPU" complaint,
identify which known misconfiguration is the cause and either fix it (with
consent) or hand back the exact next step.
This skill does not probe or reason on its own. The rocm CLI owns the
probe, the closed failure-mode catalog, and the fixes; the skill just drives it
and relays the results. The catalog is a closed list — if the symptom
doesn't match a known mode, route the user upstream instead of guessing.
Scope gate — check before anything else
Read the user's symptom and answer one question first: is this an AMD GPU on
native Linux or Windows?
If it is not — an NVIDIA / Intel / Apple GPU, or anything running under
WSL2 — then stop and decline:
- Say plainly that it is out of scope for this skill and why (not an AMD GPU
/ WSL2 is a separate platform).
- Give no troubleshooting for it: no commands to run, no driver or CUDA
advice, no diagnostic checklist, no "try this first" — not even generic GPU
suggestions. Point at the vendor's own docs (or AMD's ROCm-on-WSL guide) and
stop there.
- Do not run
rocm examine / rocm diagnose / rocm fix.
Being helpful here means being honest about the boundary — confidently-wrong
advice for a stack this skill does not cover is worse than no advice. Only
continue past this gate when the GPU is AMD and the platform is native Linux or
Windows. See Out of scope.
Prerequisites
- The
rocm CLI. This skill is only a driver over it; Phase 0 below installs
it with the user's consent if rocm --version fails. Nothing else here is
assumed — the CLI does the probing.
- Platform: native Linux (in-tree
amdgpu module + /dev/kfd) or Windows
(HIP SDK). WSL2, NVIDIA/Intel/Apple GPUs, and clean-machine installs are out of
scope (see Out of scope).
- No fixed ROCm version, GPU arch (
gfx…), or container image is assumed —
rocm examine/diagnose detect the installed ROCm, the GPU's gfx target, and
container context, and match fixes to what they find. Never hand-set
HSA_OVERRIDE_GFX_VERSION (or similar footgun env vars) yourself; let the CLI
decide.
Workflow
Only start here once the Scope gate
passes — the GPU is AMD and the platform is native Linux or Windows.
Ensure the rocm CLI is present. Everything below shells out to it, so
check first and install it if missing:
rocm --version
If that succeeds, skip to step 1. If it's not found, install it with the
user's consent (this fetches and runs an installer that drops the rocm and
rocmd binaries into ~/.local/bin). Only nightly builds are published
today, so install from the nightly channel:
- Linux / macOS:
curl -fsSL https://raw.githubusercontent.com/ROCm/rocm-cli/main/install.sh | sh -s -- nightly
- Windows (PowerShell):
$env:ROCM_CLI_CHANNEL = "nightly"
irm https://raw.githubusercontent.com/ROCm/rocm-cli/main/install.ps1 | iex
(Once rocm-cli cuts a stable release, drop the nightly channel — sh /
iex alone will pull the latest stable build.)
After install, confirm ~/.local/bin is on PATH and re-run rocm --version.
If it still isn't available, hand the user the install page
(https://github.com/ROCm/rocm-cli) and stop.
Diagnose. Pass the user's error text as the symptom:
rocm diagnose --symptom "<paste the exact error>" --json
Read the JSON:
matched[] — ranked causes, each with id, title, score (0–100),
evidence[], and a fix (with fix_id, summary, commands, verify,
notes, and the needs_sudo / needs_reboot / needs_relogin /
auto_applicable flags). score >= 75 = high confidence; 50–74 = likely
(confirm one more piece of evidence with the user first).
out_of_scope — when set (e.g. WSL2), do not diagnose. First, if the
user's symptom clearly names an app that ships its own runtime (Lemonade,
Ollama, LM Studio), route them to that app's tracker (see
Framework routing) — those trackers apply regardless
of platform. Otherwise relay the out_of_scope message and stop (see
Out of scope).
route_when_no_match — when matched is empty, hand the user this
upstream tracker; do not speculate. Note the CLI picks this target from
the host-detected framework, not from the symptom text — so for an app
named only in the symptom, route it yourself per
Framework routing.
Propose the fix. Show the top match's title, evidence, plan, and
verify command. Only propose applying it when the user is on board.
Apply with consent. For an auto-applicable fix:
rocm fix <fix-id> # auto fixes: prompt before changing anything
rocm fix <fix-id> --dry-run # show the exact change, touch nothing
rocm fix <fix-id> --yes # required to apply in a non-interactive shell
Only the four auto-applicable fixes prompt and mutate. The other 11 are
print-only (bootloader, kernel, reinstall, Windows driver, …): rocm fix <id> just prints the plan for the user to run themselves — no prompt, and the
CLI never performs those.
Verify. Have the user run the verify command from the diagnosis.
Use rocm examine (or rocm examine --json) when you only need the host state
(GPU, driver, ROCm install, groups, framework) without a diagnosis.
Framework routing
rocm diagnose covers frameworks that build against the system ROCm/HIP:
- PyTorch, llama.cpp — in scope; diagnose normally.
Apps that ship their own ROCm runtime aren't diagnosed here — route the user
to the right tracker. (The CLI's route_when_no_match also targets these, but
only when the host probe detects that app; when the app is named only in the
symptom, do the routing yourself using the list below.)
Out of scope
- WSL2 — a distinct platform (
/dev/dxg + the Windows host driver, not the
in-tree amdgpu module or /dev/kfd). rocm examine/diagnose detect it and
route out; relay that guidance and point at AMD's ROCm-on-WSL guide.
- NVIDIA / Intel / Apple Silicon GPUs, and fresh installs on a clean
machine (a setup task, not a diagnosis). Exit cleanly and say so.
Rules
- Never run the workflow — or offer any troubleshooting, generic GPU fixes
included — for a non-AMD GPU or a WSL2 setup. State it is out of scope and
stop.
- Never invent a fix. If
rocm diagnose returns no match, route upstream.
- Never run a mutating fix without the user's explicit OK; prefer
--dry-run
first. New failure modes are added to the CLI catalog, not improvised here.
See reference.md for the full closed catalog and the CLI
command/exit-code reference.
1---2name: rocm-doctor3description: Diagnoses why ROCm, the HIP SDK, PyTorch, or llama.cpp is broken on an AMD GPU on Linux or Windows, then applies a low-risk fix with consent or hands back the exact next step. Also routes Lemonade, LM Studio, and Ollama problems to the right upstream channel. Use when the user reports that ROCm or HIP "isn't working", torch.cuda.is_available() is False, rocminfo / hipInfo can't see the GPU, or hits hipErrorNoBinaryForGpu, HSA_STATUS_ERROR_INVALID_ISA, "invalid device function", "no kernel image is available", cannot open /dev/kfd, permission denied on /dev/kfd, "ROCk module is NOT loaded", a missing libamdhip64.so / amdhip64_6.dll / hipblas.dll / vcruntime140_1.dll, an HSA_OVERRIDE_GFX_VERSION page fault, an iGPU+dGPU crash, a container that can't see the GPU, or an amdgpu-install / DKMS failure. Backed by the `rocm` CLI (`rocm examine` / `rocm diagnose` / `rocm fix`); this skill is a thin driver over those commands, not a re-implementation.4---56# ROCm Doctor78Given a "ROCm / PyTorch / llama.cpp isn't working on my AMD GPU" complaint,9identify which **known misconfiguration** is the cause and either fix it (with10consent) or hand back the exact next step.1112This skill does **not** probe or reason on its own. The `rocm` CLI owns the13probe, the closed failure-mode catalog, and the fixes; the skill just drives it14and relays the results. The catalog is a **closed list** — if the symptom15doesn't match a known mode, route the user upstream instead of guessing.1617## Scope gate — check before anything else1819Read the user's symptom and answer one question first: **is this an AMD GPU on20native Linux or Windows?**2122If it is **not** — an **NVIDIA / Intel / Apple** GPU, or anything running under23**WSL2** — then **stop and decline**:2425- Say plainly that it is **out of scope** for this skill and why (not an AMD GPU26 / WSL2 is a separate platform).27- Give **no** troubleshooting for it: no commands to run, no driver or CUDA28 advice, no diagnostic checklist, no "try this first" — not even generic GPU29 suggestions. Point at the vendor's own docs (or AMD's ROCm-on-WSL guide) and30 stop there.31- Do **not** run `rocm examine` / `rocm diagnose` / `rocm fix`.3233Being helpful here means being honest about the boundary — confidently-wrong34advice for a stack this skill does not cover is worse than no advice. Only35continue past this gate when the GPU is AMD and the platform is native Linux or36Windows. See [Out of scope](#out-of-scope).3738## Prerequisites3940- **The `rocm` CLI.** This skill is only a driver over it; Phase 0 below installs41 it with the user's consent if `rocm --version` fails. Nothing else here is42 assumed — the CLI does the probing.43- **Platform:** native Linux (in-tree `amdgpu` module + `/dev/kfd`) or Windows44 (HIP SDK). WSL2, NVIDIA/Intel/Apple GPUs, and clean-machine installs are out of45 scope (see [Out of scope](#out-of-scope)).46- **No fixed ROCm version, GPU arch (`gfx…`), or container image is assumed** —47 `rocm examine`/`diagnose` detect the installed ROCm, the GPU's `gfx` target, and48 container context, and match fixes to what they find. Never hand-set49 `HSA_OVERRIDE_GFX_VERSION` (or similar footgun env vars) yourself; let the CLI50 decide.5152## Workflow5354Only start here once the [Scope gate](#scope-gate--check-before-anything-else)55passes — the GPU is AMD and the platform is native Linux or Windows.56570. **Ensure the `rocm` CLI is present.** Everything below shells out to it, so58 check first and install it if missing:5960 ```61 rocm --version62 ```6364 If that succeeds, skip to step 1. If it's not found, install it **with the65 user's consent** (this fetches and runs an installer that drops the `rocm` and66 `rocmd` binaries into `~/.local/bin`). Only nightly builds are published67 today, so install from the `nightly` channel:6869 - **Linux / macOS:**70 ```71 curl -fsSL https://raw.githubusercontent.com/ROCm/rocm-cli/main/install.sh | sh -s -- nightly72 ```73 - **Windows (PowerShell):**74 ```75 $env:ROCM_CLI_CHANNEL = "nightly"76 irm https://raw.githubusercontent.com/ROCm/rocm-cli/main/install.ps1 | iex77 ```7879 (Once rocm-cli cuts a stable release, drop the `nightly` channel — `sh` /80 `iex` alone will pull the latest stable build.)8182 After install, confirm `~/.local/bin` is on `PATH` and re-run `rocm --version`.83 If it still isn't available, hand the user the install page84 (https://github.com/ROCm/rocm-cli) and stop.85861. **Diagnose.** Pass the user's error text as the symptom:8788 ```89 rocm diagnose --symptom "<paste the exact error>" --json90 ```9192 Read the JSON:93 - `matched[]` — ranked causes, each with `id`, `title`, `score` (0–100),94 `evidence[]`, and a `fix` (with `fix_id`, `summary`, `commands`, `verify`,95 `notes`, and the `needs_sudo` / `needs_reboot` / `needs_relogin` /96 `auto_applicable` flags). `score >= 75` = high confidence; `50–74` = likely97 (confirm one more piece of evidence with the user first).98 - `out_of_scope` — when set (e.g. WSL2), do **not** diagnose. First, if the99 user's symptom clearly names an app that ships its own runtime (Lemonade,100 Ollama, LM Studio), route them to that app's tracker (see101 [Framework routing](#framework-routing)) — those trackers apply regardless102 of platform. Otherwise relay the `out_of_scope` message and stop (see103 [Out of scope](#out-of-scope)).104 - `route_when_no_match` — when `matched` is empty, hand the user this105 upstream tracker; **do not speculate**. Note the CLI picks this target from106 the *host-detected* framework, not from the symptom text — so for an app107 named only in the symptom, route it yourself per108 [Framework routing](#framework-routing).1091102. **Propose the fix.** Show the top match's `title`, `evidence`, plan, and111 `verify` command. Only propose applying it when the user is on board.1121133. **Apply with consent.** For an auto-applicable fix:114115 ```116 rocm fix <fix-id> # auto fixes: prompt before changing anything117 rocm fix <fix-id> --dry-run # show the exact change, touch nothing118 rocm fix <fix-id> --yes # required to apply in a non-interactive shell119 ```120121 Only the four auto-applicable fixes prompt and mutate. The other 11 are122 **print-only** (bootloader, kernel, reinstall, Windows driver, …): `rocm fix123 <id>` just prints the plan for the user to run themselves — no prompt, and the124 CLI never performs those.1251264. **Verify.** Have the user run the `verify` command from the diagnosis.127128Use `rocm examine` (or `rocm examine --json`) when you only need the host state129(GPU, driver, ROCm install, groups, framework) without a diagnosis.130131## Framework routing132133`rocm diagnose` covers frameworks that build against the **system** ROCm/HIP:134135- **PyTorch**, **llama.cpp** — in scope; diagnose normally.136137Apps that ship their **own** ROCm runtime aren't diagnosed here — route the user138to the right tracker. (The CLI's `route_when_no_match` also targets these, but139only when the host probe *detects* that app; when the app is named only in the140symptom, do the routing yourself using the list below.)141142- **Lemonade** → https://github.com/lemonade-sdk/lemonade/issues143- **Ollama** → https://github.com/ollama/ollama/issues144- **LM Studio** → in-app support (no public repo)145- Anything else with no catalog match → ROCm core:146 https://github.com/ROCm/ROCm/issues (this is what `route_when_no_match`147 returns by default).148149## Out of scope150151- **WSL2** — a distinct platform (`/dev/dxg` + the Windows host driver, not the152 in-tree `amdgpu` module or `/dev/kfd`). `rocm examine`/`diagnose` detect it and153 route out; relay that guidance and point at AMD's ROCm-on-WSL guide.154- **NVIDIA / Intel / Apple Silicon GPUs**, and **fresh installs on a clean155 machine** (a setup task, not a diagnosis). Exit cleanly and say so.156157## Rules158159- Never run the workflow — or offer *any* troubleshooting, generic GPU fixes160 included — for a non-AMD GPU or a WSL2 setup. State it is out of scope and161 stop.162- Never invent a fix. If `rocm diagnose` returns no match, route upstream.163- Never run a mutating fix without the user's explicit OK; prefer `--dry-run`164 first. New failure modes are added to the CLI catalog, not improvised here.165166See [reference.md](reference.md) for the full closed catalog and the CLI167command/exit-code reference.