Hardware project · August 2026 – ongoing
One secondhand Huananzhi X99-BD4 board turned into a roughly $200 inference server that I keep extending: soldering its PCIe lanes, flashing its BIOS, waking it over the network, unlocking the mining GPUs, and running two NVIDIA cards on two different drivers at once, pooled for one model.
The second GPU slot now holds an AMD Radeon VII on ROCm, next to the unlocked CMP 40HX. The Tesla V100 goes back into that slot when I want the pooled VFIO setup, and the Radeon comes out.
Each chapter is a write-up of one change to the machine, in the order it happened.
Where the build started: mining GPUs turned into a local inference server, with a PCIe x16 capacitor mod, patched CUDA kernels, and KV cache reuse on Gemma 4 cutting time to first token from 54 s to 0.27 s.
Gemma 4 time to first token from 54 s to 0.27 s on this box, with a 17-line KV cache snapshot patch to mistral.rs.
Gemma 4 E4B and three Qwen models on schema-constrained extraction over 78 hand-labeled documents, run on the CMP. Gemma led at 95% precision.
A BIOS with no Wake on LAN, on Wi-Fi that isolates clients: a Python listener on an Orange Pi Zero validates magic packets over Tailscale and presses the X99's power button with a relay.
Inserting ReBarDxe into the X99-BD4 BIOS, and catching a 16-byte corruption UEFITool left in a volume I never touched.
Patched NVIDIA kernel modules lift the mining card's limits. FP16 went from 0.98 to 54 TFLOPS, generation doubled, and a manual root port retrain got Gen2 working on X99.
A Tesla V100 passed through to a KVM guest with vfio-pci so it can run the closed 580 driver, while the host keeps the patched 610 for the CMP. llama.cpp RPC pools both GPUs to serve Qwen3 32B at 24 tok/s.
The whole box as code: 7 Ansible roles distilled from 1,661 lines of shell history. It pins the NVIDIA open driver, rebuilds the patched CMP 40HX modules for every new kernel, and retrains the PCIe link to Gen2 at boot. Its verify step caught a kernel update that would have booted the stock driver.
| Part | What’s in it |
|---|---|
| Board | Huananzhi X99-BD4, AMI Aptio V 5.11 BIOS with ReBarDxe inserted |
| CPU | Intel Xeon E5-2678 v3 (Haswell-EP, 12 cores) |
| OS | Ubuntu 24.04, Linux 7.0 (HWE) |
| Network | Wi-Fi + Tailscale; powered on by an Orange Pi Zero relay |
| Slot | Card | Driver | Link | Notes |
|---|---|---|---|---|
| Root port 3 | CMP 40HX (TU106, 8 GB) | NVIDIA 610.57.04 open, patched by cmpunlocker | PCIe Gen2 x16, retrained at boot | FP16 unlocked, 8 GiB BAR1 |
| Root port 2 | Radeon VII (Vega 20, 16 GB HBM2) | amdgpu + ROCm 6.3.3 | PCIe 3.0 x16 | capped at 200 W (stock 250 W), 16 GiB BAR0 |
| Root port 2 (swap) | Tesla V100 SXM2 (16 GB HBM2) | NVIDIA 580 closed, inside a KVM guest | vfio-pci passthrough | replaces the Radeon VII for the pooled llama.cpp setup |
The whole box is described in X99-Recreation, an Ansible playbook that rebuilds it from a fresh Ubuntu install:
base, tailscale: packages, hostname, user groups, Tailscale SSH.nvidia_cmp40hx: installs the 610.57.04 userspace, pins and holds the driver packages, builds the cmpunlocker modules, and installs the boot units below.amdgpu_power: the Radeon VII power cap.ollama, cuda_toolkit, plus optional mistralrs and benchmarks roles.cmp40hx-gen2-retrain reprobes the driver so the card advertises Gen2, then retrains the link from the root port: 2.5 → 5 GT/s. It checks the PCI ID first, so it won’t touch a different card if the slots change.cap-cmp40hx locks the CMP’s idle clock to 300 MHz (cmp40hx-uncap releases it for inference).amdgpu-power-cap finds the Radeon VII by PCI ID and sets its cap to 200 W.The unlock is volatile and the patched modules are built per kernel, so a kernel hook rebuilds cmpunlocker for every new kernel before it’s booted.