From ac77f054c280d18f3cfab9a3e936ea05d2c60610 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Sun, 19 Jul 2026 17:57:39 +0200 Subject: [PATCH] systemd: add llama-server-qwen3-4b-npu.service (NPU Qwen3-4B on :8091) Boot-persistent rk-llama.cpp rknpu2 backend for qwen3-4b-2507-npu. Kernel gate matches any *npu* kernel (was pinned to the retired 6.1.75-npu-port; current boltzmann kernel is 7.0.0-rc3-npuclk+). LimitNOFILE=65536 for librknnrt dmabuf fds. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01EWpfhDgYNA21tETDP9ueBE --- systemd/llama-server-qwen3-4b-npu.service | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 systemd/llama-server-qwen3-4b-npu.service diff --git a/systemd/llama-server-qwen3-4b-npu.service b/systemd/llama-server-qwen3-4b-npu.service new file mode 100644 index 0000000..b40cbe6 --- /dev/null +++ b/systemd/llama-server-qwen3-4b-npu.service @@ -0,0 +1,27 @@ +[Unit] +Description=rk-llama.cpp NPU backend: Qwen3 4B Q8_0 on RK3588 NPU (port 8091) +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple + +# Kernel gate: only run under an NPU-capable kernel (rkopnu present; matches *npu*). +ExecCondition=/bin/sh -c 'case "$(uname -r)" in *npu*) exit 0;; *) exit 1;; esac' + +LimitNOFILE=65536 + +WorkingDirectory=/home/mfritsche/npu +ExecStart=/home/mfritsche/src/rk-llama.cpp/build/bin/llama-server\ + -m /home/mfritsche/models/Qwen3-4B-Instruct-2507-Q8_0.gguf\ + --alias qwen3-4b-2507-npu\ + -c 65536 -t 4 --cache-type-k q8_0 --cache-type-v q8_0\ + --host 0.0.0.0 --port 8091 + +Restart=on-failure +RestartSec=5 + +TimeoutStartSec=180 + +[Install] +WantedBy=default.target