Initial extraction from isis: direct /dev/kfd GPU compute

AMD RDNA3 GPU driver via raw KFD ioctls. No ROCm, no OpenCL.

- Device discovery and topology queries
- VRAM/GTT/Userptr memory with shared address space
- PM4 compute queue and kernel dispatch
- Hand-written RDNA3 ASM kernels: matmul (3100 GFLOP/s), matvec, superlinear
- Tile-safe buffer padding for OOB protection
- Event-based interrupt wait (no CPU polling)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 20:38:10 +07:00
commit 66a9edb898
75 changed files with 5858 additions and 0 deletions

12
Cargo.toml Normal file
View File

@@ -0,0 +1,12 @@
[package]
name = "kfd"
version = "0.1.0"
edition = "2021"
description = "Direct /dev/kfd GPU compute for AMD RDNA3 — no ROCm, no OpenCL, just ioctl"
license = "MIT OR Apache-2.0"
repository = "https://git.rotko.net/tommi/kfd"
[dependencies]
libc = "0.2"
[dev-dependencies]