DEV Community

the truth
the truth

Posted on

I got mass mass mass tired of lspci, so I wrote a hardware monitor that also has a brain

hwmonitor

Every hardware info tool on Linux does the same thing: spawn lspci, pray the output format hasn't changed, regex the hell out of it, and call it a day.

I wanted something that just asks the kernel directly. No middleman. So I wrote hwmonitor in pure C — it reads /sys and /proc raw, spits out structured JSON, and runs in under a millisecond.
Then I gave it a brain.

hwmonitor --gpu -A "Can I run a 70B model locally on this hardware?"
╭─ AI Hardware Analysis (Groq)
| With 8GB VRAM on your RTX 5060 a 70B model won't fit even with
| INT4 quantization. You'd need ~35GB VRAM. Stick to 7B-13B models,
| or offload layers to your 32GB RAM at the cost of ~4x slower
| inference.
╰─
Enter fullscreen mode Exit fullscreen mode

You ask your hardware a question. It answers. From the terminal.
CPU, GPU, RAM, Storage, Mainboard, Battery — all discovered, all JSON-serializable, all without a single fork().

~2000 lines of C. One dependency.

MIT licensed. Zero leaks.

hwmonitor: https://github.com/th0truth/hwmonitor

What hardware questions would you ask?

Top comments (0)