Llama.cpp: Unterschied zwischen den Versionen
Die Seite wurde neu angelegt: „=== Beschreibung === === Download === === Installation === ==== Vulkan Build ==== [https://vulkan.lunarg.com/sdk/home Vulkan SDK] herunterladen entpacken, ins Verzeichnis wechseln und source setup-env.sh ausführen. Dann ins Verzeichnis wechseln wo llama.cpp installiert werden soll. Dort dann <syntaxhighlight lang="bash" line="1"> git clone https://github.com/ggml-org/llama.cpp cd llama.cpp cmake -B build -DGGML_VULKAN=1 </syntaxhighlight> ==== ROCm Bu…“ |
KKeine Bearbeitungszusammenfassung |
||
| (23 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
'''Hinweis:''' Alle Pfade beziehen sich auf <code>/home/hendrik/Programme/llama.cpp/</code> als Installationsverzeichnis. Bitte entsprechend anpassen. | |||
=== Download == | == Beschreibung == | ||
'''llama.cpp''' ist eine C/C++ Implementierung für Inference von Large Language Models (LLMs). Es unterstützt verschiedene Backends (CPU, Vulkan, ROCm, CUDA) und ermöglicht das Ausführen von quantisierten Modellen im GGUF-Format. | |||
'''ik_llama.cpp''' ist ein optimierter Fork von llama.cpp mit zusätzlichen Performance-Verbesserungen und Unterstützung für neuere GPU-Architekturen (z.B. gfx1151 / Strix Halo). | |||
== Download == | |||
'''llama.cpp:''' | |||
<syntaxhighlight lang="bash" line="1"> | <syntaxhighlight lang="bash" line="1"> | ||
git clone https://github.com/ggml-org/llama.cpp | git clone https://github.com/ggml-org/llama.cpp ~/Programme/llama.cpp | ||
cd llama.cpp | cd ~/Programme/llama.cpp | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== ROCm Build ==== | |||
gfx906 = | '''ik_llama.cpp:''' | ||
<syntaxhighlight lang="bash" line="1"> | |||
git clone https://github.com/ikawrakow/ik_llama.cpp ~/Programme/llama.cpp | |||
cd ~/Programme/llama.cpp | |||
</syntaxhighlight> | |||
== Installation == | |||
=== Voraussetzungen === | |||
<syntaxhighlight lang="bash" line="1"> | |||
sudo dnf install libcurl-devel -y | |||
</syntaxhighlight> | |||
{| class="wikitable" | |||
|- | |||
! GPU !! Architektur !! Standard-Target | |||
|- | |||
| RX 7900 XTX || gfx1100 || '''ja''' | |||
|- | |||
| Strix Halo || gfx1151 || '''ja''' | |||
|- | |||
| MI50 / MI60 || gfx906 || separater Build (siehe unten) | |||
|} | |||
=== Vulkan Build === | |||
''Gilt für llama.cpp und ik_llama.cpp.'' | |||
[https://vulkan.lunarg.com/sdk/home Vulkan SDK] herunterladen, entpacken, ins Verzeichnis wechseln und <code>source setup-env.sh</code> ausführen. Dann ins llama.cpp-Verzeichnis wechseln: | |||
<syntaxhighlight lang="bash" line="1"> | |||
source ~/Programme/Vulkan_SDK/1.4.335.0/setup-env.sh | |||
cd ~/Programme/llama.cpp/ | |||
rm -R build-vulkan | |||
cmake -B build-vulkan -DGGML_VULKAN=1 -DGGML_RPC=ON # llama.cpp | |||
# cmake -B build-vulkan -DLLAMA_VULKAN=on -DGGML_RPC=ON # ik_llama.cpp | |||
cmake --build build-vulkan --config Release -- -j $(nproc) | |||
</syntaxhighlight> | |||
=== ROCm Build (getestet mit ROCm 6.4.3 und 7.1.0) === | |||
==== ROCm Quick-Install ==== | |||
Alle Befehle von der [https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html ROCm Quick-Start Seite] ausführen. | |||
'''Wichtig für MI50 (gfx906) mit ROCm 6.4:'''<br> | |||
Vor dem Reboot die rocblas-Bibliothek aus dem AUR ergänzen: | |||
# [https://archlinux.org/packages/extra/x86_64/rocblas/ rocblas aus dem AUR] herunterladen (Version 6.4) | |||
# Entpacken | |||
# Alle Tensor-Dateien mit <code>gfx906</code> im Namen von <code>rocblas-…/opt/rocm/lib/rocblas/library</code> nach <code>/opt/rocm/lib/rocblas/library</code> kopieren | |||
# Reboot | |||
# Prüfen: <code>sudo update-alternatives --display rocm</code> | |||
==== ROCm Umgebung einrichten (optional, bei Fehlern) ==== | |||
<syntaxhighlight lang="bash" line="1"> | <syntaxhighlight lang="bash" line="1"> | ||
echo 'export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH' >> ~/.bashrc | echo 'export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH' >> ~/.bashrc | ||
echo 'export HSA_OVERRIDE_GFX_VERSION=9.0.6' >> ~/.bashrc # Für MI50/MI60 | |||
source ~/.bashrc | source ~/.bashrc | ||
sudo dnf install rocwmma-devel -y | |||
</syntaxhighlight> | |||
==== llama.cpp kompilieren (ROCm) ==== | |||
cd llama.cpp | |||
HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" | <syntaxhighlight lang="bash" line="1"> | ||
cd ~/Programme/llama.cpp/ && git pull && rm -R build-rocm-old && cp -R build-rocm build-rocm-old | |||
HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" cmake -B build-rocm -DGGML_HIP=ON -DGGML_RPC=ON -DAMDGPU_TARGETS=gfx1100,gfx1151 -DCMAKE_BUILD_TYPE=Release | |||
cmake --build build-rocm --config Release -- -j 16 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
'''Für MI50 (gfx906) — separater Build:''' | |||
=== | <syntaxhighlight lang="bash" line="1"> | ||
cd ~/Programme/llama.cpp/ && rm -R build-rocm-old && cp -R build-rocm build-rocm-old | |||
HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" cmake -B build-rocm -DGGML_HIP=ON -DGGML_RPC=ON -DAMDGPU_TARGETS=gfx906 -DCMAKE_BUILD_TYPE=Release | |||
cmake --build build-rocm --config Release -- -j 16 | |||
</syntaxhighlight> | |||
==== ik_llama.cpp kompilieren (ROCm) ==== | |||
<syntaxhighlight lang="bash" line="1"> | |||
cd ~/Programme/llama.cpp/ && rm -R build-rocm-old && cp -R build-rocm build-rocm-old | |||
HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" cmake -B build-rocm -DGGML_HIP=ON -DGGML_RPC=ON -DAMDGPU_TARGETS=gfx1100,gfx1151 -DCMAKE_BUILD_TYPE=Release | |||
cmake --build build-rocm --config Release -- -j 16 | |||
</syntaxhighlight> | |||
=== Build prüfen === | |||
<syntaxhighlight lang="bash" line="1"> | <syntaxhighlight lang="bash" line="1"> | ||
./build/bin/llama-server --version | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== | == Konfiguration == | ||
=== | === llama-server als systemd Service einrichten === | ||
'''Service-Datei erstellen:''' | |||
<syntaxhighlight lang="bash" line="1"> | |||
sudo nano /etc/systemd/system/llama-server.service | |||
</syntaxhighlight> | |||
'''Service-Datei Inhalt (Multi-GPU mit ROCm):''' | |||
<syntaxhighlight lang="ini" line="1"> | |||
[Unit] | |||
Description=Llama.cpp ROCm Multi-GPU Server | |||
After=network.target | |||
[Service] | |||
Type=simple | |||
User=hendrik | |||
Group=hendrik | |||
WorkingDirectory=/home/hendrik/Programme/llama.cpp/build/bin | |||
# Multi-GPU Konfiguration | |||
Environment="HIP_VISIBLE_DEVICES=0,1" | |||
Environment="HSA_OVERRIDE_GFX_VERSION=9.0.6" | |||
Environment="PATH=/opt/rocm/bin:/usr/local/bin:/usr/bin:/bin" | |||
Environment="LD_LIBRARY_PATH=/opt/rocm/lib" | |||
# Server mit optimalen Multi-GPU Einstellungen | |||
ExecStart=/home/hendrik/Programme/llama.cpp/build/bin/llama-server \ | |||
-m /home/hendrik/models/model.gguf \ | |||
--split-mode row \ | |||
--tensor-split 0.5,0.5 \ | |||
-ngl 99 \ | |||
-fa 1 \ | |||
--host 0.0.0.0 \ | |||
--port 8080 \ | |||
-c 32768 \ | |||
-b 2048 \ | |||
-ub 2048 \ | |||
--threads 8 \ | |||
--parallel 1 \ | |||
--jinja | |||
Restart=always | |||
RestartSec=10 | |||
LimitNOFILE=65535 | |||
LimitMEMLOCK=infinity | |||
StandardOutput=journal | |||
StandardError=journal | |||
SyslogIdentifier=llama-server | |||
[Install] | |||
WantedBy=multi-user.target | |||
</syntaxhighlight> | |||
'''Service aktivieren und starten:''' | |||
<syntaxhighlight lang="bash" line="1"> | |||
sudo systemctl daemon-reload | |||
sudo systemctl enable llama-server # Auto-Start beim Boot | |||
sudo systemctl start llama-server | |||
sudo systemctl status llama-server # Status prüfen | |||
sudo journalctl -u llama-server -f # Logs verfolgen | |||
</syntaxhighlight> | |||
'''Service verwalten:''' | |||
<syntaxhighlight lang="bash" line="1"> | |||
sudo systemctl stop llama-server # Stoppen | |||
sudo systemctl restart llama-server # Neustarten | |||
sudo systemctl disable llama-server # Autostart deaktivieren | |||
</syntaxhighlight> | |||
=== Manuelle Server-Starts === | |||
'''Multi-GPU (ROCm) — optimal:''' | |||
<syntaxhighlight lang="bash" line="1"> | |||
HIP_VISIBLE_DEVICES=0,1 ./llama-server \ | |||
-m ~/models/model.gguf \ | |||
--split-mode row \ | |||
--tensor-split 0.5,0.5 \ | |||
-ngl 99 \ | |||
-fa 1 \ | |||
--host 0.0.0.0 \ | |||
--port 8080 \ | |||
-c 32768 \ | |||
-b 2048 \ | |||
-ub 2048 \ | |||
--threads 8 \ | |||
--parallel 1 \ | |||
--jinja | |||
</syntaxhighlight> | |||
=== RPC — Verteiltes Inference über mehrere Hosts === | |||
Mit <code>-DGGML_RPC=ON</code> wird der <code>rpc-server</code> mitgebaut, der es ermöglicht, die Inferenz über das Netzwerk auf mehrere Maschinen zu verteilen. Jeder Remote-Host stellt seine GPU(s) über einen rpc-server zur Verfügung; der Main-Host verbindet sich darüber mit <code>--rpc</code>. | |||
'''Voraussetzung:''' Auf '''allen''' Hosts muss llama.cpp mit <code>-DGGML_RPC=ON</code> kompiliert sein (siehe Build-Abschnitte oben). Die Netzwerkverbindung zwischen den Hosts muss bestehen. | |||
==== 1. RPC-Server auf allen Remote-Hosts starten ==== | |||
Auf jedem Host, der seine GPU zur Verfügung stellen soll: | |||
<syntaxhighlight lang="bash" line="1"> | |||
cd ~/Programme/llama.cpp/ | |||
./build/bin/rpc-server --host 0.0.0.0 | |||
</syntaxhighlight> | |||
Standardmäßig lauscht der rpc-server auf Port '''50052'''. Mit <code>--port</code> kann ein anderer Port gewählt werden. | |||
==== 2. llama-server auf dem Main-Host starten ==== | |||
Auf dem Host, der die Inferenz koordiniert: | |||
<syntaxhighlight lang="bash" line="1"> | |||
./llama-server \ | |||
--model ~/.lmstudio/models/unsloth/Step-3.7-Flash-GGUF/Step-3.7-Flash-UD-IQ4_XS-00001-of-00003.gguf \ | |||
-ngl 99 \ | |||
--rpc localhost:50052,192.168.1.19:50052 | |||
</syntaxhighlight> | |||
Dabei ist <code>localhost:50052</code> die lokale GPU und <code>192.168.1.19:50052</code> die Remote-GPU. | |||
==== rpc-server als systemd Service (Remote-Host) ==== | |||
'''Service-Datei erstellen:''' | |||
<syntaxhighlight lang="bash" line="1"> | |||
sudo nano /etc/systemd/system/llama-rpc.service | |||
</syntaxhighlight> | |||
'''Service-Datei Inhalt:''' | |||
<syntaxhighlight lang="ini" line="1"> | |||
[Unit] | |||
Description=Llama.cpp RPC Server (Remote GPU) | |||
After=network.target | |||
[Service] | |||
Type=simple | |||
User=hendrik | |||
Group=hendrik | |||
WorkingDirectory=/home/hendrik/Programme/llama.cpp/build/bin | |||
Environment="HIP_VISIBLE_DEVICES=0" | |||
Environment="PATH=/opt/rocm/bin:/usr/local/bin:/usr/bin:/bin" | |||
Environment="LD_LIBRARY_PATH=/opt/rocm/lib" | |||
ExecStart=/home/hendrik/Programme/llama.cpp/build/bin/rpc-server --host 0.0.0.0 | |||
Restart=always | |||
RestartSec=10 | |||
StandardOutput=journal | |||
StandardError=journal | |||
SyslogIdentifier=llama-rpc | |||
[Install] | |||
WantedBy=multi-user.target | |||
</syntaxhighlight> | |||
'''Aktivieren:''' | |||
<syntaxhighlight lang="bash" line="1"> | |||
sudo systemctl daemon-reload | |||
sudo systemctl enable --now llama-rpc | |||
</syntaxhighlight> | |||
== Update == | |||
<syntaxhighlight lang="bash" line="1"> | |||
cd ~/Programme/llama.cpp | |||
git pull | |||
cmake --build build --config Release -- -j $(nproc) | |||
# Services neu starten falls aktiv | |||
sudo systemctl restart llama-server | |||
sudo systemctl restart llama-rpc # falls RPC-Service läuft | |||
</syntaxhighlight> | |||
== | == Parameter-Referenz == | ||
== | {| class="wikitable" | ||
|- | |||
! Parameter !! Beschreibung | |||
|- | |||
| <code>-ngl 99</code> || Alle Layer auf GPU auslagern (Langform: <code>--gpu-layers</code>) | |||
|- | |||
| <code>-fa 1</code> || Flash Attention aktivieren | |||
|- | |||
| <code>-c 32768</code> || Kontextfenster-Größe | |||
|- | |||
| <code>-b 2048</code> || Batch-Size | |||
|- | |||
| <code>-ub 2048</code> || Physical USB batch size | |||
|- | |||
| <code>--split-mode row</code> || Tensor-Split-Modus (Multi-GPU) | |||
|- | |||
| <code>--tensor-split 0.5,0.5</code> || Gleichmäßige Aufteilung auf 2 GPUs | |||
|- | |||
| <code>--parallel 1</code> || Anzahl paralleler Sequenzen | |||
|- | |||
| <code>--jinja</code> || Jinja-Template-Support für Chat | |||
|- | |||
| <code>--rpc host:port,…</code> || RPC-Backends für verteiltes Inference | |||
|- | |||
| <code>-DGGML_RPC=ON</code> || CMake-Flag: RPC-Support einkompilieren | |||
|} | |||
Aktuelle Version vom 3. Juni 2026, 14:43 Uhr
Hinweis: Alle Pfade beziehen sich auf /home/hendrik/Programme/llama.cpp/ als Installationsverzeichnis. Bitte entsprechend anpassen.
Beschreibung
llama.cpp ist eine C/C++ Implementierung für Inference von Large Language Models (LLMs). Es unterstützt verschiedene Backends (CPU, Vulkan, ROCm, CUDA) und ermöglicht das Ausführen von quantisierten Modellen im GGUF-Format.
ik_llama.cpp ist ein optimierter Fork von llama.cpp mit zusätzlichen Performance-Verbesserungen und Unterstützung für neuere GPU-Architekturen (z.B. gfx1151 / Strix Halo).
Download
llama.cpp:
git clone https://github.com/ggml-org/llama.cpp ~/Programme/llama.cpp
cd ~/Programme/llama.cppik_llama.cpp:
git clone https://github.com/ikawrakow/ik_llama.cpp ~/Programme/llama.cpp
cd ~/Programme/llama.cppInstallation
Voraussetzungen
sudo dnf install libcurl-devel -y| GPU | Architektur | Standard-Target |
|---|---|---|
| RX 7900 XTX | gfx1100 | ja |
| Strix Halo | gfx1151 | ja |
| MI50 / MI60 | gfx906 | separater Build (siehe unten) |
Vulkan Build
Gilt für llama.cpp und ik_llama.cpp.
Vulkan SDK herunterladen, entpacken, ins Verzeichnis wechseln und source setup-env.sh ausführen. Dann ins llama.cpp-Verzeichnis wechseln:
source ~/Programme/Vulkan_SDK/1.4.335.0/setup-env.sh
cd ~/Programme/llama.cpp/
rm -R build-vulkan
cmake -B build-vulkan -DGGML_VULKAN=1 -DGGML_RPC=ON # llama.cpp
# cmake -B build-vulkan -DLLAMA_VULKAN=on -DGGML_RPC=ON # ik_llama.cpp
cmake --build build-vulkan --config Release -- -j $(nproc)ROCm Build (getestet mit ROCm 6.4.3 und 7.1.0)
ROCm Quick-Install
Alle Befehle von der ROCm Quick-Start Seite ausführen.
Wichtig für MI50 (gfx906) mit ROCm 6.4:
Vor dem Reboot die rocblas-Bibliothek aus dem AUR ergänzen:
- rocblas aus dem AUR herunterladen (Version 6.4)
- Entpacken
- Alle Tensor-Dateien mit
gfx906im Namen vonrocblas-…/opt/rocm/lib/rocblas/librarynach/opt/rocm/lib/rocblas/librarykopieren - Reboot
- Prüfen:
sudo update-alternatives --display rocm
ROCm Umgebung einrichten (optional, bei Fehlern)
echo 'export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
echo 'export HSA_OVERRIDE_GFX_VERSION=9.0.6' >> ~/.bashrc # Für MI50/MI60
source ~/.bashrc
sudo dnf install rocwmma-devel -yllama.cpp kompilieren (ROCm)
cd ~/Programme/llama.cpp/ && git pull && rm -R build-rocm-old && cp -R build-rocm build-rocm-old
HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" cmake -B build-rocm -DGGML_HIP=ON -DGGML_RPC=ON -DAMDGPU_TARGETS=gfx1100,gfx1151 -DCMAKE_BUILD_TYPE=Release
cmake --build build-rocm --config Release -- -j 16Für MI50 (gfx906) — separater Build:
cd ~/Programme/llama.cpp/ && rm -R build-rocm-old && cp -R build-rocm build-rocm-old
HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" cmake -B build-rocm -DGGML_HIP=ON -DGGML_RPC=ON -DAMDGPU_TARGETS=gfx906 -DCMAKE_BUILD_TYPE=Release
cmake --build build-rocm --config Release -- -j 16ik_llama.cpp kompilieren (ROCm)
cd ~/Programme/llama.cpp/ && rm -R build-rocm-old && cp -R build-rocm build-rocm-old
HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" cmake -B build-rocm -DGGML_HIP=ON -DGGML_RPC=ON -DAMDGPU_TARGETS=gfx1100,gfx1151 -DCMAKE_BUILD_TYPE=Release
cmake --build build-rocm --config Release -- -j 16Build prüfen
./build/bin/llama-server --versionKonfiguration
llama-server als systemd Service einrichten
Service-Datei erstellen:
sudo nano /etc/systemd/system/llama-server.serviceService-Datei Inhalt (Multi-GPU mit ROCm):
[Unit]
Description=Llama.cpp ROCm Multi-GPU Server
After=network.target
[Service]
Type=simple
User=hendrik
Group=hendrik
WorkingDirectory=/home/hendrik/Programme/llama.cpp/build/bin
# Multi-GPU Konfiguration
Environment="HIP_VISIBLE_DEVICES=0,1"
Environment="HSA_OVERRIDE_GFX_VERSION=9.0.6"
Environment="PATH=/opt/rocm/bin:/usr/local/bin:/usr/bin:/bin"
Environment="LD_LIBRARY_PATH=/opt/rocm/lib"
# Server mit optimalen Multi-GPU Einstellungen
ExecStart=/home/hendrik/Programme/llama.cpp/build/bin/llama-server \
-m /home/hendrik/models/model.gguf \
--split-mode row \
--tensor-split 0.5,0.5 \
-ngl 99 \
-fa 1 \
--host 0.0.0.0 \
--port 8080 \
-c 32768 \
-b 2048 \
-ub 2048 \
--threads 8 \
--parallel 1 \
--jinja
Restart=always
RestartSec=10
LimitNOFILE=65535
LimitMEMLOCK=infinity
StandardOutput=journal
StandardError=journal
SyslogIdentifier=llama-server
[Install]
WantedBy=multi-user.targetService aktivieren und starten:
sudo systemctl daemon-reload
sudo systemctl enable llama-server # Auto-Start beim Boot
sudo systemctl start llama-server
sudo systemctl status llama-server # Status prüfen
sudo journalctl -u llama-server -f # Logs verfolgenService verwalten:
sudo systemctl stop llama-server # Stoppen
sudo systemctl restart llama-server # Neustarten
sudo systemctl disable llama-server # Autostart deaktivierenManuelle Server-Starts
Multi-GPU (ROCm) — optimal:
HIP_VISIBLE_DEVICES=0,1 ./llama-server \
-m ~/models/model.gguf \
--split-mode row \
--tensor-split 0.5,0.5 \
-ngl 99 \
-fa 1 \
--host 0.0.0.0 \
--port 8080 \
-c 32768 \
-b 2048 \
-ub 2048 \
--threads 8 \
--parallel 1 \
--jinjaRPC — Verteiltes Inference über mehrere Hosts
Mit -DGGML_RPC=ON wird der rpc-server mitgebaut, der es ermöglicht, die Inferenz über das Netzwerk auf mehrere Maschinen zu verteilen. Jeder Remote-Host stellt seine GPU(s) über einen rpc-server zur Verfügung; der Main-Host verbindet sich darüber mit --rpc.
Voraussetzung: Auf allen Hosts muss llama.cpp mit -DGGML_RPC=ON kompiliert sein (siehe Build-Abschnitte oben). Die Netzwerkverbindung zwischen den Hosts muss bestehen.
1. RPC-Server auf allen Remote-Hosts starten
Auf jedem Host, der seine GPU zur Verfügung stellen soll:
cd ~/Programme/llama.cpp/
./build/bin/rpc-server --host 0.0.0.0Standardmäßig lauscht der rpc-server auf Port 50052. Mit --port kann ein anderer Port gewählt werden.
2. llama-server auf dem Main-Host starten
Auf dem Host, der die Inferenz koordiniert:
./llama-server \
--model ~/.lmstudio/models/unsloth/Step-3.7-Flash-GGUF/Step-3.7-Flash-UD-IQ4_XS-00001-of-00003.gguf \
-ngl 99 \
--rpc localhost:50052,192.168.1.19:50052Dabei ist localhost:50052 die lokale GPU und 192.168.1.19:50052 die Remote-GPU.
rpc-server als systemd Service (Remote-Host)
Service-Datei erstellen:
sudo nano /etc/systemd/system/llama-rpc.serviceService-Datei Inhalt:
[Unit]
Description=Llama.cpp RPC Server (Remote GPU)
After=network.target
[Service]
Type=simple
User=hendrik
Group=hendrik
WorkingDirectory=/home/hendrik/Programme/llama.cpp/build/bin
Environment="HIP_VISIBLE_DEVICES=0"
Environment="PATH=/opt/rocm/bin:/usr/local/bin:/usr/bin:/bin"
Environment="LD_LIBRARY_PATH=/opt/rocm/lib"
ExecStart=/home/hendrik/Programme/llama.cpp/build/bin/rpc-server --host 0.0.0.0
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
SyslogIdentifier=llama-rpc
[Install]
WantedBy=multi-user.targetAktivieren:
sudo systemctl daemon-reload
sudo systemctl enable --now llama-rpcUpdate
cd ~/Programme/llama.cpp
git pull
cmake --build build --config Release -- -j $(nproc)
# Services neu starten falls aktiv
sudo systemctl restart llama-server
sudo systemctl restart llama-rpc # falls RPC-Service läuftParameter-Referenz
| Parameter | Beschreibung |
|---|---|
-ngl 99 |
Alle Layer auf GPU auslagern (Langform: --gpu-layers)
|
-fa 1 |
Flash Attention aktivieren |
-c 32768 |
Kontextfenster-Größe |
-b 2048 |
Batch-Size |
-ub 2048 |
Physical USB batch size |
--split-mode row |
Tensor-Split-Modus (Multi-GPU) |
--tensor-split 0.5,0.5 |
Gleichmäßige Aufteilung auf 2 GPUs |
--parallel 1 |
Anzahl paralleler Sequenzen |
--jinja |
Jinja-Template-Support für Chat |
--rpc host:port,… |
RPC-Backends für verteiltes Inference |
-DGGML_RPC=ON |
CMake-Flag: RPC-Support einkompilieren |