# qpow-hip — AMD GPU miner for the Quantus pool

A native AMD (ROCm/HIP) miner for QPoW. On an RX 7900 XTX it does **~175 MH/s**, versus **~96 MH/s**
for the official miner and quanpool on the same card — both of which fall back to a generic
wgpu/Vulkan path because neither has a native AMD kernel.

## Which file do I download?

**Two builds are published. They are not interchangeable — pick the one matching your ROCm.**

    rocm --version      # or:  ls -d /opt/rocm*   |   apt list --installed 2>/dev/null | grep rocm

| your ROCm | download | speed on RX 7900 XTX |
| --- | --- | ---: |
| **5.x** (e.g. Ubuntu 24.04 `apt install hipcc`) | `qpow-hip-linux-x86_64-rocm5` | **175 MH/s** |
| **6.x** (AMD's `amdgpu-install --usecase=rocm`) | `qpow-hip-linux-x86_64-rocm6` | **130 MH/s** |

The ROCm 5 build is ~34 % faster. That is a property of the ROCm *runtime*, not the kernel — the
identical source compiled against 6.4 runs slower. If you have a choice, ROCm 5.x is worth it.

### "It won't start"

If you picked the wrong one you will see, before the miner prints anything:

    ./qpow-hip-linux-x86_64-rocm5: error while loading shared libraries:
    libamdhip64.so.5: cannot open shared object file: No such file or directory

**That means you have ROCm 6 — download the `-rocm6` build** (and vice versa for `libamdhip64.so.6`).
This happens in the dynamic loader before the program runs, so the miner cannot warn you itself.

## Requirements

- **Linux x86_64**, glibc >= 2.38 (Ubuntu 24.04+, Debian 13+, Fedora 39+)
- **ROCm runtime installed** (the binary is ~1 MB and links against it; it is not self-contained)
- **AMD RDNA3 GPU — gfx1100 only**: RX 7900 XTX / XT / GRE.
  Other AMD GPUs are *not* supported by this build and will report a gfx mismatch.
- **`/dev/kfd` present.** Check with `ls -l /dev/kfd`. If missing, ROCm cannot open the GPU.
  In Docker you must pass:
  `--device=/dev/kfd --device=/dev/dri --group-add video --group-add render`
- Your user in the `render` and `video` groups (`id | grep -E "render|video"`).

The miner runs a preflight check and prints a specific checklist if any of this is wrong.

## Usage

    ./qpow-hip-linux-x86_64-rocm5 pool ws://quantusminer.com:9901 <YOUR_PAYOUT_ADDRESS> <worker-name>

Optional trailing args: `[nonces_per_thread] [threads_per_block]` (defaults `32 512`).

Other modes:

| mode | what it does |
| --- | --- |
| `version` | build + runtime ROCm version and detected device |
| `verify < big_vectors.txt` | 8,000-vector known-answer test against the reference hash |
| `sharecheck <n>` | proves submitted nonces re-hash correctly (share validity) |
| `benchsparse <secs>` | offline hashrate benchmark |

## Correctness

Every published build passes three gates:

- **VERIFY 8000/8000** — matches the reference implementation's known-answer vectors exactly.
- **sparsecheck** — the optimised sparse first-round path equals the straightforward path
  over 1,048,576 nonces, 0 wrong.
- **sharecheck** — a winning nonce, reconstructed and re-hashed through the verified full-hash
  path, matches the mining path over 262,144 cases, 0 wrong. This is what proves shares validate.

Measured on the pool: **1,248 of 1,255 shares accepted** over a 44-minute run; the 7 rejects were
stale shares during the initial vardiff ramp, none after it settled.

## Is it worth running?

Honestly: only if you already own the card. At ~175 MH/s an RX 7900 XTX is beaten by a ~$350
RTX 5060 at 265 MH/s. QPoW is dominated by 64-bit integer multiplies, which RDNA3 emulates.
This exists so AMD owners can mine at all — not because AMD is competitive here.
