RAGFlow v0.24.0 on DGX Spark - working native ARM64 build with GPU-accelerated OCR
RAGFlow (the open-source RAG engine by InfiniFlow) does not ship ARM64 Docker images, so it does not run on DGX Spark out of the box. I got it working anyway, even tough it turned into a bigger project than expected, involving patching the Dockerfile, compiling onnxruntime-gpu from source for SM_121, fixing encoding bugs, etc. Eventually it worked well enough that I cleaned things up and published the build scripts on GitHub.
Please note: this is a rather fragile setup. The patches use exact string anchors tied to RAGFlow v0.24.0 and will likely break on any upstream update. But it does run, and it runs with GPU support, so DeepDoc OCR and embedding are reasonably fast.
The main challenges were:
- No upstream ARM64 Docker images (patched the Dockerfile at build time to remove BuildKit-only syntax)
- No prebuilt onnxruntime-gpu wheel for SM_121 / CUDA 13 (compiled from source inside a builder container which takes a while on first run, cached afterwards)
- Upstream OCR only supports Chinese PP-OCRv5 (replaced with a three-model cascade: Latin primary, Cyrillic secondary, Chinese tertiary, highest confidence wins per text box)
- find_codec() misdetects ISO-8859-1 as GBK, corrupting umlauts (fixed)
What else it does:
- Adds AVIF image support and fixes an IMAP connector crash (issue #13119)
- Embeds file metadata (filename, path, modification date) into every Elasticsearch chunk
- Deploys the full stack (Elasticsearch, MySQL, Redis, MinIO) on a shared Docker network, offline-capable at runtime
Please do not expect much experience from me yet. I only got it running recently and have been experimenting with different models and settings. The following configuration works reasonably well for me so far:
- Chat model: qwen3.5:35b-a3b (via Ollama)
- Embedding model: bge-m3 (knowledge base)
- Rerank model: bge-reranker-v2-m3
- Img2txt model: qwen3.5:35b-a3b
- Document parser: DeepDOC, chunk size 1024, overlap 12%
- Data source: WebDAV (Nextcloud)
One-time project, no ongoing maintenance. Use at your own risk.