Added libgomp1

This commit is contained in:
John Doe
2026-03-10 23:25:56 -04:00
parent e4dab890fb
commit 61e05210be
2 changed files with 110 additions and 1 deletions
+9 -1
View File
@@ -20,7 +20,8 @@ $STD apt-get install -y \
vulkan-tools \
libvulkan1 \
mesa-vulkan-drivers \
pciutils
pciutils \
libgomp1
msg_ok "Installed Dependencies"
# Create directories
@@ -175,6 +176,13 @@ systemctl restart llamacpp
## Troubleshooting
If you see "no CPU backend found" error:
1. Ensure libgomp1 is installed: apt-get install -y libgomp1
2. Verify CPU backend libraries load: ldd /opt/llamacpp/bin/libggml-cpu-haswell.so
3. Check all libraries are present: ls -la /opt/llamacpp/bin/libggml-*.so
4. Backend libraries MUST be in the same directory as the executable
5. See: https://github.com/ggml-org/llama.cpp/issues/17491
If you see "no backends are loaded" error:
1. Backend libraries MUST be in the same directory as the executable
2. Check all libraries are present: ls -la /opt/llamacpp/bin/*.so
+101
View File
@@ -0,0 +1,101 @@
# Fix Plan: llama.cpp CPU Backend Missing
## Problem Summary
The llama.cpp service fails to start with the error:
```
llama_model_load: error loading model: make_cpu_buft_list: no CPU backend found
```
## Root Cause Analysis
### Initial Hypothesis (INCORRECT)
Initially suspected that CPU backend files were missing from the installation.
### Actual Root Cause (CONFIRMED)
The CPU backend files **ARE present** in `/opt/llamacpp/bin/`, but they fail to load due to a **missing dependency**:
```
$ ldd /opt/llamacpp/bin/libggml-cpu-haswell.so
libgomp.so.1 => not found <-- MISSING!
```
**`libgomp.so.1`** (GNU OpenMP runtime library) is required by the CPU backend libraries but is not installed in the container.
### Why RPC and Vulkan Backends Load Successfully
- `libggml-rpc.so` - No `libgomp` dependency ✅
- `libggml-vulkan.so` - No `libgomp` dependency ✅
- `libggml-cpu-*.so` - **Requires `libgomp.so.1`** ❌
## Solution
### Fix: Install libgomp1 Package
Add `libgomp1` to the dependencies in [`install/llamacpp-install.sh`](install/llamacpp-install.sh):
```bash
msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
wget \
ca-certificates \
vulkan-tools \
libvulkan1 \
mesa-vulkan-drivers \
pciutils \
libgomp1 # <-- Add this package
msg_ok "Installed Dependencies"
```
### Why This Works
- `libgomp1` provides `libgomp.so.1` (GNU OpenMP runtime)
- CPU backends use OpenMP for parallel processing
- Without this library, the dynamic linker fails to load `libggml-cpu-*.so`
## Verification Steps
After installing `libgomp1`, verify the fix:
```bash
# 1. Verify libgomp is installed
ldd /opt/llamacpp/bin/libggml-cpu-haswell.so | grep gomp
# Expected: libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x...)
# 2. Verify CPU backend loads
/opt/llamacpp/bin/llama-server --version
# Expected output should include:
# load_backend: loaded RPC backend from ...
# load_backend: loaded Vulkan backend from ...
# load_backend: loaded CPU backend from .../libggml-cpu-*.so <-- This should now appear
# 3. Test model loading
systemctl start llamacpp
journalctl -u llamacpp -f
# Should no longer show "no CPU backend found" error
```
## Implementation
### File to Modify
[`install/llamacpp-install.sh`](install/llamacpp-install.sh) - Line 16-23
### Change Required
```diff
msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
wget \
ca-certificates \
vulkan-tools \
libvulkan1 \
mesa-vulkan-drivers \
pciutils \
+ libgomp1
msg_ok "Installed Dependencies"
```
## References
- [GitHub Issue #17491: CPU backend loader does not respect LD_LIBRARY_PATH](https://github.com/ggml-org/llama.cpp/issues/17491)
- [GitHub Issue #14691: make_cpu_buft_list: no CPU backend found](https://github.com/ggml-org/llama.cpp/issues/14691)
- [GNU OpenMP (libgomp) Documentation](https://gcc.gnu.org/onlinedocs/libgomp/)