mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-11 17:26:57 +02:00
Windows : `jean llamacpp install` part de zéro et provisionne toute la chaîne sans intervention : - install Windows ajoute jean au PATH (copie dans %JEAN_HOME%\bin) - auto-install des outils manquants via winget (cmake, git, ninja) + refresh du PATH du process depuis le registre - compilateur MSVC Build Tools auto-installé ; générateur Visual Studio (localise MSVC sans Developer Prompt) ; binaire multi-config (Release\) - détection GPU + auto-install du CUDA Toolkit quand une carte NVIDIA est vue sans nvcc ; CUDA_PATH/CUDA_PATH_Vx_y injectés pour MSBuild ; DLL runtime CUDA (bin + bin\x64) ajoutées au PATH de llama-server - console UTF-8 + VT pour un affichage correct Multi-OS : - auto-install des outils aussi sous Unix (apt/dnf/pacman/brew) - désactive l'UI web embarquée de llama-server (LLAMA_BUILD_UI=OFF + LLAMA_USE_PREBUILT_UI=OFF) : supprime la dépendance npm/HuggingFace qui cassait le build ; jean fournit sa propre UI - build CUDA allégé (sans FA_ALL_QUANTS) : bien plus rapide - sortie de build propre : configure/build passent par un runner qui écrit le détail dans un log fichier et n'affiche qu'un spinner animé + le compteur de fichiers (formats MSBuild et Make/Ninja) + les erreurs réelles ; tests unitaires du filtre Validé en exécution réelle : Windows (GTX 1650 Ti, sm_75) et serveur Linux multi-GPU (sm_75;120) jusqu'au serveur GPU opérationnel.
52 lines
1.9 KiB
Go
52 lines
1.9 KiB
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func TestCompiledFile(t *testing.T) {
|
|
cases := map[string]string{
|
|
` Compiling CUDA source file ..\..\..\..\ggml\src\ggml-cuda\acc.cu...`: "acc.cu",
|
|
` ggml-threading.cpp`: "ggml-threading.cpp",
|
|
` ggml-quants.c`: "ggml-quants.c",
|
|
// Make (Linux) et Ninja.
|
|
`[ 45%] Building CXX object src/CMakeFiles/llama.dir/llama.cpp.o`: "llama.cpp",
|
|
`[123/456] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/acc.cu.o`: "acc.cu",
|
|
// La ligne de commande nvcc géante ne doit PAS être prise pour un fichier.
|
|
` C:\...\nvcc.exe -x cu ... -o ggml-cuda.dir\Release\acc.obj "C:\...\acc.cu"`: "",
|
|
`Building Custom Rule C:/ProgramData/jean/...`: "",
|
|
`-- UI: running npm install`: "",
|
|
}
|
|
for in, want := range cases {
|
|
if got := compiledFile(in); got != want {
|
|
t.Errorf("compiledFile(%q) = %q, want %q", in, got, want)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestBuildError(t *testing.T) {
|
|
keep := []string{
|
|
`acc.cu(12): error C2065: 'foo': undeclared identifier`,
|
|
`LINK : fatal error LNK1104: cannot open file`,
|
|
// gcc/clang (Linux).
|
|
`/x/ggml.cpp:42:9: error: 'foo' was not declared in this scope`,
|
|
}
|
|
drop := []string{
|
|
// Les warnings ne doivent PAS remonter (bruit tiers).
|
|
`ggml.cpp(10): warning C4244: conversion`,
|
|
`LINK : warning LNK4098: conflit entre la bibliothèque ...`,
|
|
// Contient -D_CRT_SECURE_NO_WARNINGS mais n'est pas un diagnostic.
|
|
`nvcc.exe ... -D_CRT_SECURE_NO_WARNINGS -DGGML_SHARED ... -o acc.obj`,
|
|
`Compiling CUDA source file acc.cu...`,
|
|
`C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.3\bin\nvcc.exe`,
|
|
}
|
|
for _, l := range keep {
|
|
if !reBuildError.MatchString(l) {
|
|
t.Errorf("erreur attendue mais ratée: %q", l)
|
|
}
|
|
}
|
|
for _, l := range drop {
|
|
if reBuildError.MatchString(l) {
|
|
t.Errorf("fausse erreur: %q", l)
|
|
}
|
|
}
|
|
}
|