Hi HN! I built AXON to study GPU and accelerator architecture from the hardware/software boundary up—specifically how host software offloads compute kernels, batches commands, and manages DMA/interrupts across PCIe without needing physical FPGA or GPU hardware.
It runs self-contained on Apple Silicon Macs (macOS + patched aarch64 QEMU with HVF) booting a Linux aarch64 guest.
What’s inside:
- Custom QEMU PCIe device (BAR0 MMIO, 64-entry SQ/CQ descriptor rings, 64-bit DMA, MSI + legacy INTx) implementing COPY, VADD, DOT, and MATMUL kernels
- Linux PCI driver (/dev/axonX) with both legacy ioctls and an async UAPI (SUBMIT / WAIT / KICK with multiple outstanding commands and deferred doorbells) to model command-processor submission and doorbell batching
- C SDK, userspace examples, and benchmarks comparing queue depths (depth 1 vs. depth 8)
- Hardware/ABI specification (spec/axon-hw-interface.md) and an implementation/debugging journal (docs/journal.md)
On an Apple Silicon Mac with Homebrew, `./scripts/run-e2e.sh` rebuilds QEMU, boots the Linux aarch64 VM, loads the driver, and runs the selftests and benchmarks end-to-end.
I’d love feedback on the command-ring ABI, async UAPI design, or next GPU-inspired features to explore (like mmap zero-copy rings or multi-queue scheduling)!
fongang777•6m ago
It runs self-contained on Apple Silicon Macs (macOS + patched aarch64 QEMU with HVF) booting a Linux aarch64 guest.
What’s inside: - Custom QEMU PCIe device (BAR0 MMIO, 64-entry SQ/CQ descriptor rings, 64-bit DMA, MSI + legacy INTx) implementing COPY, VADD, DOT, and MATMUL kernels - Linux PCI driver (/dev/axonX) with both legacy ioctls and an async UAPI (SUBMIT / WAIT / KICK with multiple outstanding commands and deferred doorbells) to model command-processor submission and doorbell batching - C SDK, userspace examples, and benchmarks comparing queue depths (depth 1 vs. depth 8) - Hardware/ABI specification (spec/axon-hw-interface.md) and an implementation/debugging journal (docs/journal.md)
On an Apple Silicon Mac with Homebrew, `./scripts/run-e2e.sh` rebuilds QEMU, boots the Linux aarch64 VM, loads the driver, and runs the selftests and benchmarks end-to-end.
I’d love feedback on the command-ring ABI, async UAPI design, or next GPU-inspired features to explore (like mmap zero-copy rings or multi-queue scheduling)!