[Unit] Description=Swictation Voice-to-Text Daemon After=graphical-session.target Wants=swictation-ui.service [Service] Type=simple ExecStart=__INSTALL_DIR__/swictation-daemon Restart=on-failure RestartSec=5 # Environment variables (CRITICAL for GPU acceleration and correct model operation) Environment="RUST_LOG=info" # ORT_DYLIB_PATH: Points to ONNX Runtime library (CRITICAL - without this, model produces blank output) # Note: postinstall.js will replace __ORT_DYLIB_PATH__ with detected path, defaulting to bundled GPU library Environment="ORT_DYLIB_PATH=__ORT_DYLIB_PATH__" # LD_LIBRARY_PATH: CUDA runtime + ONNX Runtime CUDA providers (for GPU acceleration) # Without this: 14x performance regression (43s vs 3-6s expected for 57s audio) # postinstall.js dynamically detects cuDNN library paths and replaces this placeholder Environment="LD_LIBRARY_PATH=__LD_LIBRARY_PATH__" # CUDA_HOME: Helps CUDA libraries find additional resources at runtime Environment="CUDA_HOME=/usr/local/cuda" # Import full user environment for PulseAudio/PipeWire session # This ensures all audio devices are detected properly (4 devices instead of 1) # Required for microphone access in user session ImportEnvironment=PATH XDG_RUNTIME_DIR # Resource limits (commented out - let daemon use what it needs) # Uncomment and adjust if needed for production deployments # MemoryMax=8G # CPUQuota=200% [Install] WantedBy=default.target