-
-
Notifications
You must be signed in to change notification settings - Fork 0
synapd
The local LLM inference daemon (llama.cpp). It owns the model — every other component reaches it over a Unix socket rather than linking llama.cpp itself. See Architecture for the protocol.
systemctl status synapdThe default ISO embeds Mistral 7B Instruct (Q4_K_M, ~4.1 GB), so the AI is
live on first boot with nothing to configure. ISOs built --no-model are ~4 GB
smaller and fetch it on first boot via syn-firstboot.
To drop one in by hand:
cp your-model.gguf /var/lib/synapd/models/synapse.gguf
systemctl restart synapdAny GGUF that llama.cpp can load works. Mistral 7B Instruct is what the prompts are tuned against — swapping models may need prompt work.
Packaged as synapse-llama / synapse-llama-cuda, which provides +
conflicts each other — so pacman refuses a silent downgrade to the CPU
build. That design exists because of the bug below.
grep -c nvidia /proc/$(pidof synapd)/maps # 0 = you are on the CPUA log line claiming GPU offload is not evidence. Check the mapped libraries of the running process.
synapd ran on the CPU for the entire life of the project while appearing to be on the GPU. Rebuilding CUDA alone would not have fixed it. There were three stacked silent failures:
-
Unowned
.sofiles in/usr/lib— hand-cp'd at some point, owned by no package, silently winning theld.socache over the real build. -
ld.so.confpointed at$HOME— so even the right libraries resolved from the wrong place. -
detect_gpu_layers()returned a hardcoded28, derived from anlspciprobe rather than from the GPU. This is why it stayed invisible: the number looked plausible, so nothing ever contradicted the assumption.
The lesson is #3. A plausible hardcoded value is worse than a crash — it produces a system that lies to you consistently.
llama.cpp pinned at b8272, with a CCCL 3.4 cub patch (CUDA 13 broke the
API). Verified clean with gcc 16 + nvcc 13.3.
The ISO ships a CPU build on purpose. A CUDA-linked
synapdneedslibcuda.so.1, which doesn't exist on a machine with no NVIDIA driver — it would fail to start on most hardware.build.sh --no-gpu(the ISO default) builds CPU-only withGGML_NATIVE=OFFso it runs on baseline x86-64. See Building and Packaging.
Game mode (Super+G) stops synapd to hand its VRAM to
the game. Two bugs worth knowing, both silent:
- The stop failed on polkit —
synapdis a system unit and the stop was a fire-and-forget spawn, so it silently did nothing and synapd kept the VRAM. Now usessudo -nwith a dedicated/etc/sudoers.d/synapd-gamemode. - Stopping
synapdalso killedsynnet, which hasRequires=synapd.
Per-process VRAM is visible in the task manager
(Ctrl+Alt+Delete), which reads NVML via dlopen — no CUDA headers needed at
build time.
The control panel's (and Super+Escape menu's) "AI backend" row cycles
synapd between GPU → CPU → off. It runs synui-ai-backend, which rewrites
synapd's --gpu-layers via a systemd drop-in, restarts it, and records the
choice in /run/synapd/backend (which the row reads back for its label):
synui-ai-backend gpu # --gpu-layers -1 (auto-detect; offload to the GPU)
synui-ai-backend cpu # --gpu-layers 0 (force CPU-only)
synui-ai-backend off # stop synapd — frees all its RAM/VRAM
synui-ai-backend toggle # cycle to the next state
synui-ai-backend status # print the current deviceSame privilege story as game mode: the compositor runs as the session user with
no polkit agent, so the helper self-escalates with sudo -n for the
mutating verbs, allowed by a scoped /etc/sudoers.d/synapd-backend rule. Without
it the row was silently stuck reading "auto" — nothing to select. (status
stays unprivileged; it only reads a world-readable file.)
chibi (the assistant) has an optional synapd backend in llm_client.py
that talks straight to the Unix socket instead of an HTTP LLM server — verified
live. It's the reference example of writing a synapd client.
See also: Architecture, Troubleshooting.
Using it
- Installation
- Updating
- Software
- Files
- Keybindings
- Commands
- Nix
- Gaming
- DaVinci Resolve
- Secure Boot
- Troubleshooting
Customising it
Components
Apps
Hacking on it