# Troubleshooting

Start with the CLI. It reports every problem it finds as a check with a stable ID:

```
fastflow doctor --json      # package, driver, device, and runtime health
fastflow self-test --json   # doctor, then a real dispatch on the NPU
```

Find each check whose `status` is `fail` or `error` below. After installing or changing an NPU driver, reboot before you debug further: a driver switch without a reboot can leave the device unhealthy even though the operating system reports the new driver.

| Check | What it verifies |
| --- | --- |
| [`invocation.arguments`](<#invocation-arguments>) | The command line parsed: a known command, valid options, and valid arguments. |
| [`internal.error`](<#internal-error>) | The command ran to completion without an unhandled error. |
| [`package.manifest`](<#package-manifest>) | The installed product manifest exists, its version matches the `fastflow` executable, and every declared file matches its size and SHA-256. |
| [`device.enumeration`](<#device-enumeration>) | Windows only: the operating system's device enumeration API answered. |
| [`device.present`](<#device-present>) | At least one AMD NPU is visible to the operating system. |
| [`device.access`](<#device-access>) | The current user can open at least one NPU device read/write. |
| [`device.ioctl`](<#device-ioctl>) | Linux only: an opened NPU answered the diagnostic ioctls (DRM version, firmware version, AIE metadata, power mode). |
| [`runtime.library.present`](<#runtime-library-present>) | An HRX runtime library file exists at one of the candidate paths. |
| [`runtime.library.load`](<#runtime-library-load>) | The HRX runtime library loaded into the process. |
| [`runtime.symbols`](<#runtime-symbols>) | Every public HRX C symbol the CLI needs resolved in the loaded library. |
| [`runtime.abi`](<#runtime-abi>) | The loaded HRX runtime's major and minor ABI version match the headers the CLI was built with. |
| [`runtime.initialize`](<#runtime-initialize>) | HRX initialized. |
| [`runtime.device_count`](<#runtime-device-count>) | HRX reports one or more NPU devices. |
| [`runtime.shutdown`](<#runtime-shutdown>) | HRX shut down cleanly after the doctor checks. |
| [`self_test.prerequisites`](<#self-test-prerequisites>) | Every doctor check passed, so the self-test can dispatch. |
| [`self_test.fixture`](<#self-test-fixture>) | The device is NPU2 and the packaged self-test fixture is intact and matches its provenance hashes. |
| [`self_test.load`](<#self-test-load>) | The self-test could read its XADX and load the HRX runtime. |
| [`self_test.dispatch`](<#self-test-dispatch>) | The packaged XADX loaded on the device and its dispatch completed. |
| [`self_test.cleanup`](<#self-test-cleanup>) | Every buffer, executable, and device the self-test created was released. |
| [`self_test.output`](<#self-test-output>) | The output bytes match the packaged golden result exactly. |
| [`powermode.arguments`](<#powermode-arguments>) | The requested power mode is one of default, powersaver, balanced, performance, or turbo. |
| [`powermode.support`](<#powermode-support>) | The platform's power-mode backend is available. |
| [`powermode.device_present`](<#powermode-device-present>) | At least one NPU was found to query or set. |
| [`powermode.query`](<#powermode-query>) | Every detected NPU reported its current power mode. |
| [`powermode.set`](<#powermode-set>) | Every detected NPU reached the requested mode, confirmed by a second query. |
| [`plugin.discovery`](<#plugin-discovery>) | Plugin discovery finished; the message gives the number of `fastflow-*` executables found. |
| [`plugin.dispatch`](<#plugin-dispatch>) | An external `fastflow-<name>` plugin was found and started. |

## `invocation.arguments`

The command line parsed: a known command, valid options, and valid arguments.

Reported by: any command.

Run `fastflow --help` for the accepted commands and options. Global options (`--json`, `--runtime <path>`, `--verbose`) can come before or after the command. `plugin` accepts only `list`, `powermode` accepts at most one mode, and the other built-in commands take no positional arguments. Exit status is 2.

## `internal.error`

The command ran to completion without an unhandled error.

Reported by: any command.

The message carries the error text. Rerun with `--verbose --json` and file an issue with the full report.

## `package.manifest`

The installed product manifest exists, its version matches the `fastflow` executable, and every declared file matches its size and SHA-256.

Reported by: `fastflow doctor`, `fastflow self-test`.

A missing manifest or a mismatch means the install is incomplete, modified, or mixes files from different releases. Reinstall one release into a clean environment, for example `python -m pip install "fastflow-sdk==<version>"` (for a development build, add `--only-binary=:all: --extra-index-url https://rocm.github.io/FastFlow-SDK/simple`), or use a freshly extracted archive. Do not copy `fastflow` between installs.

## `device.enumeration`

Windows only: the operating system's device enumeration API answered.

Reported by: `fastflow probe`, `fastflow doctor`, `fastflow self-test`.

`SetupDiGetClassDevsW` or `SetupDiEnumDeviceInfo` failed, so no device facts could be read. The details carry the Windows error code. Run from a normal (non-sandboxed) PowerShell session and retry. If it persists, reboot.

## `device.present`

At least one AMD NPU is visible to the operating system.

Reported by: `fastflow doctor`, `fastflow self-test`.

On Linux, no `amdxdna` accelerator node exists under sysfs: check that the `amdxdna` kernel module is loaded (`lsmod | grep amdxdna`) and that `dmesg` shows it probing the NPU. On Windows, check that the NPU appears in Device Manager with the AMD NPU driver installed. The NPU can also be disabled in firmware setup. See [Hardware and drivers](<https://rocm.github.io/FastFlow-SDK/reference/hardware/index.md>) for the drivers each release was qualified on.

## `device.access`

The current user can open at least one NPU device read/write.

Reported by: `fastflow doctor`, `fastflow self-test`.

On Linux, the `/dev/accel/accel<N>` node exists but cannot be opened, or does not match its sysfs entry. The device's `access_error` in `fastflow probe --json` gives the reason. For a permission error, check the node's group with `ls -l /dev/accel/` and add your user to that group, then log in again. On Windows, update the NPU driver and reboot.

## `device.ioctl`

Linux only: an opened NPU answered the diagnostic ioctls (DRM version, firmware version, AIE metadata, power mode).

Reported by: `fastflow doctor`, `fastflow self-test`.

The check passes when the device is usable even if some optional diagnostic ioctls are unavailable; `details.diagnostics_complete` says which case applies. It fails only when no accessible device accepted ioctls: update the `amdxdna` driver, then reboot.

## `runtime.library.present`

An HRX runtime library file exists at one of the candidate paths.

Reported by: `fastflow doctor`, `fastflow self-test`.

The loader tries `--runtime`, then `HRX_LIBHRX`, then the packaged path next to the executable (`lib/libhrx.so.0` on Linux, `bin/hrx.dll` on Windows), then the system library path. `fastflow probe --json` lists the candidates under `data.runtime.candidates`. Reinstall the release, or point `--runtime` or `HRX_LIBHRX` at an existing library.

## `runtime.library.load`

The HRX runtime library loaded into the process.

Reported by: `fastflow doctor`, `fastflow self-test`.

`details.errors` has the loader's error for each candidate. Common causes are a missing dependency of the library, an architecture mismatch, or a stale `HRX_LIBHRX` pointing at another build. Unset `HRX_LIBHRX` to use the packaged runtime. An explicit `--runtime` is authoritative; the CLI does not fall back to another candidate.

## `runtime.symbols`

Every public HRX C symbol the CLI needs resolved in the loaded library.

Reported by: `fastflow doctor`, `fastflow self-test`.

`details.missing` lists the absent symbols. The loaded library is from a different HRX build than this CLI. Use the runtime that ships with the same release.

## `runtime.abi`

The loaded HRX runtime's major and minor ABI version match the headers the CLI was built with.

Reported by: `fastflow doctor`, `fastflow self-test`.

`details.required` and `details.actual` show both versions. Install the CLI and runtime from the same release, or remove an `HRX_LIBHRX` or `--runtime` override that selects another HRX.

## `runtime.initialize`

HRX initialized.

Reported by: `fastflow doctor`, `fastflow self-test`.

The message carries the HRX status. A failing `device.*` check in the same report usually explains it; fix that first. After a driver install or change, reboot and rerun `fastflow doctor`.

## `runtime.device_count`

HRX reports one or more NPU devices.

Reported by: `fastflow doctor`, `fastflow self-test`.

The OS sees an NPU but HRX does not. Check that the driver is one this release was qualified on ([Hardware and drivers](<https://rocm.github.io/FastFlow-SDK/reference/hardware/index.md>)); then reboot and rerun `fastflow doctor`.

## `runtime.shutdown`

HRX shut down cleanly after the doctor checks.

Reported by: `fastflow doctor`, `fastflow self-test`.

The message carries the HRX status. Rerun `fastflow doctor`. If it repeats, file an issue with `fastflow doctor --json --verbose` output.

## `self_test.prerequisites`

Every doctor check passed, so the self-test can dispatch.

Reported by: `fastflow self-test`.

Fix the failing checks reported by `fastflow doctor` first.

## `self_test.fixture`

The device is NPU2 and the packaged self-test fixture is intact and matches its provenance hashes.

Reported by: `fastflow self-test`.

The packaged fixture targets NPU2 (XDNA2). On NPU1, `probe` and `doctor` still apply but no self-test fixture ships. On NPU2, a fixture error means the files under `share/fastflow-sdk/self-test` are damaged or from another release: reinstall.

## `self_test.load`

The self-test could read its XADX and load the HRX runtime.

Reported by: `fastflow self-test`.

Reinstall when `kernel.xadx` is missing or empty. If HRX could not be loaded, follow the `runtime.library.load` guidance.

## `self_test.dispatch`

The packaged XADX loaded on the device and its dispatch completed.

Reported by: `fastflow self-test`.

The message names the failing HRX operation. After installing or changing a driver, reboot and retry: a package switch without a reboot can leave the device unhealthy even though the OS reports the new driver. If it persists, compare the driver with the qualified list in [Hardware and drivers](<https://rocm.github.io/FastFlow-SDK/reference/hardware/index.md>).

## `self_test.cleanup`

Every buffer, executable, and device the self-test created was released.

Reported by: `fastflow self-test`.

The details list the release errors. Rerun `fastflow self-test`; if it repeats, reboot and file an issue with `fastflow self-test --json --verbose` output.

## `self_test.output`

The output bytes match the packaged golden result exactly.

Reported by: `fastflow self-test`.

The dispatch ran but produced wrong data. Reboot and rerun. A repeat failure on a qualified driver is a bug: file an issue with `fastflow self-test --json --verbose` and `fastflow probe --json` output.

## `powermode.arguments`

The requested power mode is one of default, powersaver, balanced, performance, or turbo.

Reported by: `fastflow powermode`.

Use one of `default`, `powersaver`, `balanced`, `performance`, `turbo`.

## `powermode.support`

The platform's power-mode backend is available.

Reported by: `fastflow powermode`.

On Windows this needs the native KMT interface of the AMD NPU driver; update the driver. The details carry the enumeration error.

## `powermode.device_present`

At least one NPU was found to query or set.

Reported by: `fastflow powermode`.

Follow the `device.present` guidance.

## `powermode.query`

Every detected NPU reported its current power mode.

Reported by: `fastflow powermode`.

Follow the `device.access` guidance, then retry.

## `powermode.set`

Every detected NPU reached the requested mode, confirmed by a second query.

Reported by: `fastflow powermode`.

Setting the power mode can need elevated privileges. On Linux the current `amdxdna` driver requires root, so run `sudo fastflow powermode <mode>`. On Windows, run from an elevated PowerShell.

## `plugin.discovery`

Plugin discovery finished; the message gives the number of `fastflow-*` executables found.

Reported by: `fastflow plugin`.

This check always passes. If an expected plugin is missing, put its directory on `FASTFLOW_SDK_PLUGIN_PATH` or `PATH`; `data.search_paths` shows where the CLI looked.

## `plugin.dispatch`

An external `fastflow-<name>` plugin was found and started.

Reported by: any command.

`fastflow <name>` runs the `fastflow-<name>` executable from `FASTFLOW_SDK_PLUGIN_PATH`, the CLI's directory, or `PATH`. Run `fastflow plugin list` to see what was found. `fastflow qualify` needs the `fastflow-sdk-qualification` package.
