hrx-rs
Rust APIs for AMD GPU and NPU execution, with an in-process
Loom compiler.
Targets Strix Halo (gfx1151) and its XDNA NPU on Linux x86-64.
- GPU buffers, streams, events and reusable execution graphs.
- Loom compilation, shared artifact caches, resource reports and sanitizers.
- GPU/NPU scheduling with shared memory and completion futures.
- Model composition, allocation budgets and residency management.
- Buffered and direct file I/O with GPU-authored storage queues.
Quick start
Requires Rust 1.91+. The Cargo package is hrx-rs; import it as hrx:
[]
= { = "hrx-rs", = "0.11.0" }
Use loom::Compiler for kernels and Stream::graph for reusable GPU work.
execution::Runtime coordinates GPU/NPU graphs. Enable the npu Cargo feature
for NPU execution. Native code loading, kernel dispatch and memory-access
contracts require caller validation at the unsafe API boundaries.
Install the CLI
HRX downloads a pinned runtime/compiler bundle; no ROCm SDK is needed to build. The host needs amdgpu/KFD access, glibc 2.43+ and compatible C/C++ libraries. NPU execution also needs the amdxdna driver and firmware. Setup, offline bundles and overrides.
Run independent GPU and NPU operations in one graph:
The example checks results against CPU references, compares sequential and concurrent execution, and writes a Chrome/Perfetto trace.
Projects using HRX
| Project | Model or workload |
|---|---|
| h3-hrx | MiniMax H3 video and audio generation |
| krea2-hrx | Krea 2 Turbo and Raw image generation |
| clef-hrx | Structured decisions from text and media |
| dinov3-hrx | Image embeddings and patch features |
| scrfd-hrx | Face detection and landmarks |
| arcface-hrx | Face alignment and embeddings |
| hrxdb | Vector search and custom scoring over resident corpora |
H3 videos and timings · Krea image gallery
Documentation
- GPU execution and model composition
- Loom compilation and diagnostics
- GPU/NPU scheduling
- Native storage
- Queue pool benchmarks
- Native builds and compiler patches
- API reference and changelog
Development
scripts/check-feature-matrix.sh checks feature combinations.
Hardware test commands are in the execution and storage guides.
License
Original Rust code is MIT licensed. Native component licenses and source provenance.