From cf6e19794dc4ab318a01b73d5eb41056588341be Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Wed, 19 Aug 2026 07:21:21 +0200 Subject: [PATCH] =?UTF-8?q?Journal=20moteur=20:=20un=20crash-loop=20s'affi?= =?UTF-8?q?che=20=C2=AB=20erreur=20=C2=BB,=20plus=20=C2=AB=20chargement=20?= =?UTF-8?q?=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Un llama-server qui plantait au démarrage (backtrace __libc_start_main dans le journal) laissait la pastille sur « chargement 0 % » pour l'éternité : aucun des motifs de modelLoadError ne reconnaissait un crash. Ajoutés : backtrace (signal, segfault, abort), mémoire GPU insuffisante (out of memory / cudaMalloc failed — avec le conseil de réduire CTX), et erreur CUDA (GPU indisponible après un redémarrage du serveur). Pas de motif « libggml » : les logs de chargement normaux citent les .so. Co-Authored-By: Claude Opus 5 --- internal/loki/web_api.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/internal/loki/web_api.go b/internal/loki/web_api.go index 56db339..60eb3c3 100644 --- a/internal/loki/web_api.go +++ b/internal/loki/web_api.go @@ -115,6 +115,27 @@ func modelLoadError() string { if reason == "" { reason = "échec du chargement du modèle" } + case strings.Contains(low, "out of memory"), + strings.Contains(low, "cudamalloc failed"), + strings.Contains(low, "failed to allocate"): + // Prioritaire sur l'échec générique : la cause mémoire doit gagner. + reason = "mémoire GPU insuffisante (VRAM) — réduis le contexte (CTX) ou prends une quantification plus petite" + case strings.Contains(low, "ggml_cuda error"), strings.Contains(low, "cuda error"): + if reason == "" { + reason = "erreur CUDA — GPU indisponible ? (après un redémarrage du serveur : docker restart loki)" + } + // Backtrace = le moteur a PLANTÉ, pas « il charge encore ». Les motifs + // couvrent le dump de llama.cpp (signal + pile libc) : sans eux, un + // crash-loop s'affichait « chargement… » pour l'éternité. PAS de motif + // « libggml » : les logs de chargement normaux citent les .so + // (« loaded CUDA backend from /app/libggml-cuda.so »). + case strings.Contains(low, "__libc_start_main"), + strings.Contains(l, "SIGSEGV"), strings.Contains(l, "SIGABRT"), + strings.Contains(low, "segmentation fault"), + strings.Contains(low, "aborted (core dumped)"): + if reason == "" { + reason = "le moteur a planté au démarrage (backtrace dans le journal)" + } } } if loaded || reason == "" {