-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtinyagentos-rknn-sd.service
More file actions
41 lines (34 loc) · 1.33 KB
/
tinyagentos-rknn-sd.service
File metadata and controls
41 lines (34 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
[Unit]
Description=TinyAgentOS RKNN Stable Diffusion server (RK3588 NPU)
After=network.target
Wants=network.target
# Want to start after tinyagentos.service so the main app registers the
# backend in BackendCatalog as soon as this comes up, not before.
After=tinyagentos.service
[Service]
Type=simple
User=jay
WorkingDirectory=/home/jay/tinyagentos
# Default backend: ez_rknn_async (tp_mode=all on unet/vae_decoder).
# To revert to rknn-toolkit-lite2 / darkbit1001's rknnlcm.py, add:
# Environment=RKNN_SD_LEGACY_WRAPPER=1
Environment=RKNN_SD_MODEL_DIR=/home/jay/.local/share/tinyagentos/rknn-sd/model
Environment=RKNN_SD_WRAPPER=/home/jay/.local/share/tinyagentos/rknn-sd/rknnlcm.py
Environment=RKNN_SD_HOST=127.0.0.1
Environment=RKNN_SD_PORT=7863
Environment=PYTHONPATH=/home/jay/tinyagentos
Environment=PYTHONUNBUFFERED=1
# The wrapper loads 2.3 GB of RKNN weights onto the NPU at startup,
# which takes ~20s on the RK3588. Give systemd time before it assumes
# the unit is dead.
TimeoutStartSec=90
ExecStart=/usr/local/bin/python3.12 -m tinyagentos.services.rknn_sd_server
Restart=always
RestartSec=5
StandardOutput=append:/home/jay/tinyagentos/data/rknn-sd-server.log
StandardError=inherit
# The UNet alone is 1.8 GB and the full pipeline peaks around 5.6 GB
# during inference. Leave some headroom.
MemoryMax=7G
[Install]
WantedBy=multi-user.target