Setup nachbauen
Von 2026-07-Absturz bis laufender GPU-Benchmark. Elf Schritte, alle Fallstricke dokumentiert.
Das Grundprinzip
Daraus folgt die einzige Regel:
Immer MoE-Modelle, niemals Dense.
Ollama installieren
Installation losgelöst von der Sitzung starten (mit nohup)
Fertig, wenn diese drei Prüfungen passen:
$curl -fsSL https://ollama.com/install.sh | sh
$systemctl list-unit-files | grep ollama
$systemctl is-active ollama
$curl -s -o /dev/null -w "%{http_code}\n" http://localhost:11434/api/tags # 200 = OK
Automatischen Ruhezustand abschalten
Zurücknehmen (falls der Rechner später doch schlafen soll):
War es passiert? Prüfen mit:
$sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
$sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
$journalctl -b -u systemd-suspend | tail
Das richtige Modell auswählen
gpt-oss:120b (~65 GB, MoE ~5B aktiv).Immer vorher verifizieren: https://ollama.com/library/qwen3-coder/tags
| Tag | Größe | Passt in 94 GB? |
|---|---|---|
| qwen3-coder:30b | 19 GB | ja — die Wahl|
| qwen3-coder:480b | 290 GB | nein|
| 80B-Coder | — | existiert nicht
Modell laden (abbruchsicher)
Skript anlegen /tmp/pull_models.sh
Starten (entschepelt von der Sitzung):
Fortschritt prüfen:
$#!/bin/bash
$LOG=/tmp/ollama_pull.log
$for M in qwen3-coder:30b; do
$ echo "=== PULL $M ===" >> "$LOG"
$ ollama pull "$M" >> "$LOG" 2>&1
$ echo "EXIT $M = $?" >> "$LOG"
$done
$chmod +x /tmp/pull_models.sh && nohup /tmp/pull_models.sh > /dev/null 2>&1 &
$ollama list
$grep -a "EXIT\|=== PULL" /tmp/ollama_pull.log # nur Statuszeilen
$sudo du -sh /usr/share/ollama/.ollama/models # gewachsene Größe
Prüfen, ob die GPU wirklich genutzt wird
Erwartete Zeile aus dem Log:
Liegt das Modell komplett auf der GPU? Spalte PROCESSOR muss "100% GPU" zeigen:
$journalctl -u ollama -b | grep -iE "inference compute|library|gpu"
$msg="inference compute" library=ROCm compute=gfx1151 name=ROCm0
$description="AMD Radeon 8060S Graphics" type=iGPU total="47.0 GiB" available="87.6 GiB"
$ollama ps
Geschwindigkeit messen
| Feld | Bedeutung |
|---|---|
| eval_count / eval_duration | Texterzeugung — die Zahl, die zählt |
| prompt_eval_* | Eingabeverarbeitung, deutlich schneller |
$curl -s http://localhost:11434/api/generate -d '{
$ "model":"qwen3-coder:30b",
$ "prompt":"Erklaere kurz was eine Hashmap ist.",
$ "stream":false,
$ "options":{"num_predict":250}
$}' | python3 -c "
$import sys,json
$d=json.load(sys.stdin)
$ec=d.get('eval_count',0); ed=d.get('eval_duration',1)
$print(f'{ec} Tokens in {ed/1e9:.1f}s = {ec/(ed/1e9):.1f} tok/s')"
Optimieren — und was tatsächlich hilft
Override anlegen:
Kontrolle, ob die Variablen wirklich greifen:
$sudo mkdir -p /etc/systemd/system/ollama.service.d
$sudo tee /etc/systemd/system/ollama.service.d/override.conf <<'EOF'
$[Service]
$Environment="OLLAMA_FLASH_ATTENTION=1"
$Environment="OLLAMA_CONTEXT_LENGTH=32768"
$EOF
$sudo systemctl daemon-reload && sudo systemctl restart ollama
$journalctl -u ollama -b | grep -oE "OLLAMA_FLASH_ATTENTION:[a-z]+|OLLAMA_CONTEXT_LENGTH:[0-9]+"
| Konfiguration | tok/s | Bewertung |
|---|---|---|
| Standard (ctx 4096, kein FA) | 68,3 | Ausgangswert |
| FlashAttention an, ctx 4096 | 68,7 | minimal besser |
| ctx 32768, kein FA | 69,0 | gut|
| FlashAttention + ctx 32768 | 69,1 | beste Kombination|
| + KV-Cache q8_0 | 63,7 | −8 % verworfen
Endstand
qwen3-coder:30b · ROCm gfx1151 · ctx 32K · FA on · KV fp16 — ~69 tok/s ✏️ / ~380 tok/s 📥Anbindung eines zweiten Rechners (remote)
Hintergrund: local_llm.py auf der Client-Seite ist fertig — kann Einzel- (ask) und Mehrfachaufgaben (ask_many, ThreadPool). Basis für verteilte Agenten.
Override erweitern (/etc/systemd/system/ollama.service.d/override.conf):
Client freigeben (firewalld, nur für eine IP):
Auf dem Client in der eigenen Konfiguration:
$Environment="OLLAMA_HOST=0.0.0.0:11434"
$sudo systemctl daemon-reload && sudo systemctl restart ollama
$sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address=<IP-DES-CLIENTS>/32 port port=11434 protocol=tcp accept'
$sudo firewall-cmd --reload
$LOCAL_LLM_URL=http://<IP-DES-SERVERS>:11434
$LOCAL_LLM_MODEL=qwen3-coder:30b
$LOCAL_LLM_WORKERS=3
Nützliche Befehle im Alltag
$ollama list # installierte Modelle
$ollama ps # was liegt im Speicher — CPU oder GPU?
$ollama run qwen3-coder:30b # interaktiv testen
$ollama rm <modell> # Platz schaffen
$systemctl status ollama # Dienststatus
$journalctl -u ollama -f # Live-Log
$radeontop # GPU-Auslastung (separat installieren)