feat: optimize for Intel Core Ultra 5 and 8GB LPDDR5x 8733MT/s (zram, 2B AI stack, Spotlight prompt, mold dev)

Cette révision appartient à :
theog a révisé 2026-09-15 22:00:28 +02:00
1 Parent 848df76ffa
révision bcfcebdc58
8 fichiers modifiés
+447 -14

Aucun fichier ne correspond à votre recherche

+44
Voir le fichier
@@ -0,0 +1,44 @@
#!/sbin/openrc-run
# Gastinel OOM Protection Service
# Protects the Gastinel Desktop session and AI inference engine from rogue memory spikes.
description="Gastinel OOM Priority and Memory Protection Guard"
depend() {
after gastinel
}
start() {
ebegin "Activation de la protection OOM Gastinel"
# 1. Protéger le serveur graphique Gastinel Desktop (oom_score_adj = -900)
PID_DESKTOP=$(pgrep -f "gastinel-desktop" 2>/dev/null || true)
if [ -n "$PID_DESKTOP" ]; then
for pid in $PID_DESKTOP; do
echo -900 > /proc/$pid/oom_score_adj 2>/dev/null || true
done
fi
# 2. Protéger seatd et les pilotes graphiques
PID_SEATD=$(pgrep -f "seatd" 2>/dev/null || true)
if [ -n "$PID_SEATD" ]; then
for pid in $PID_SEATD; do
echo -950 > /proc/$pid/oom_score_adj 2>/dev/null || true
done
fi
# 3. Accorder une priorité de sécurité au serveur LLM local (oom_score_adj = -500)
PID_LLAMA=$(pgrep -f "llama-server|ollama" 2>/dev/null || true)
if [ -n "$PID_LLAMA" ]; then
for pid in $PID_LLAMA; do
echo -500 > /proc/$pid/oom_score_adj 2>/dev/null || true
done
fi
eend 0
}
stop() {
ebegin "Désactivation du guard OOM"
eend 0
}
+49
Voir le fichier
@@ -0,0 +1,49 @@
#!/sbin/openrc-run
# Gastinel zram initialization for Intel Core Ultra 5 (8GB LPDDR5x)
# Sets up ultra-fast RAM compression (lz4/zstd) providing 6GB of virtual swap in RAM.
description="Gastinel High-Speed LPDDR5x zram swap service"
depend() {
before localmount
after modules
}
start() {
ebegin "Initialisation du pool zram Gastinel (6 Go LPDDR5x)"
# Charger le module zram
modprobe zram num_devices=1 2>/dev/null || true
if [ ! -b /dev/zram0 ]; then
eerror "Périphérique /dev/zram0 introuvable"
return 1
fi
# Réinitialiser si déjà actif
swapoff /dev/zram0 2>/dev/null || true
echo 1 > /sys/block/zram0/reset 2>/dev/null || true
# Sélectionner lz4 pour latence minimale absolue à 8733 MT/s (ou zstd si supporté)
if grep -q "lz4" /sys/block/zram0/comp_algorithm 2>/dev/null; then
echo lz4 > /sys/block/zram0/comp_algorithm
elif grep -q "zstd" /sys/block/zram0/comp_algorithm 2>/dev/null; then
echo zstd > /sys/block/zram0/comp_algorithm
fi
# Allouer 6 Go de swap compressé en RAM (6144M)
echo 6144M > /sys/block/zram0/disksize
# Initialiser et activer le swap zram avec priorité maximale (32767)
mkswap -L zram0 /dev/zram0 >/dev/null 2>&1
swapon -p 32767 /dev/zram0
eend $?
}
stop() {
ebegin "Arrêt du pool zram Gastinel"
swapoff /dev/zram0 2>/dev/null || true
echo 1 > /sys/block/zram0/reset 2>/dev/null || true
eend $?
}