You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d05fe71
Browse filesBrowse the repository at this point in the historyBrowse files
- Added a dedicated Kernels screen for GitHub release discovery, compressed kernel downloads, local archive import, activation, and deletion.
6
+
- Added kernel version metadata, persistence, bundled fallback registration, package validation, and missing-library warnings.
7
+
- Updated downloaded kernel extraction to accept both `llama-server` and `libllama-server.so`, storing executables as `bin/libllama-server.so`.
8
+
- Fixed Android `error=13` launch failures by launching downloaded `.so` executables through `/system/bin/linker64` and launching bundled/reverted executables from Android's native library directory.
9
+
- Reworked kernel activation to clear stale active binaries/libraries before switching and to re-apply executable permissions whenever a kernel is activated or prepared.
10
+
- Fixed Hexagon startup by using semicolon-separated `ADSP_LIBRARY_PATH` entries and including app, native library, RFSA, and DSP search paths.
11
+
- Added a one-shot CPU fallback for Hexagon session-open failures so the server can recover when CDSP/HTP access fails.
12
+
- Updated runtime detection for newer llama-server logs that report `server is listening on ...`.
13
+
- Updated documentation for the new kernel packaging, activation, launch, and DSP library-path behavior.
14
+
15
+
### Verification
16
+
17
+
- Built signed release APK with `llama-android-builder:latest`.
18
+
- Installed and launched on device `3B15AV008YH00000`.
19
+
- Verified downloaded and bundled kernel launch paths no longer fail with `error=13`.
20
+
- Verified HTP0 startup after the ADSP path fix: model loaded and `llama-server` listened on `http://127.0.0.1:8080`.
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ It also copies `bin/llama-server` as:
83
83
app/src/main/jniLibs/arm64-v8a/libllama-server.so
84
84
```
85
85
86
-
This rename is intentional: Android automatically packages and extracts `.so` files from `jniLibs`, so the executable is stored with a library-style filename during packaging and restored to `llama-server` at runtime.
86
+
This rename is intentional: Android automatically packages and extracts `.so` files from `jniLibs`, so the executable is stored with a library-style filename during packaging. Bundled kernels launch directly from Android's native library directory; downloaded kernels keep the same `libllama-server.so` name and are launched through Android's dynamic linker.
87
87
88
88
## Building the APK
89
89
@@ -160,6 +160,7 @@ At app startup, `MainActivity` opens the Compose UI:
160
160
MainActivity
161
161
└── MainScreen
162
162
├── Config tab -> AllConfigScreen
163
+
├── Kernels tab -> KernelScreen
163
164
└── Runtime tab -> RuntimeScreen
164
165
```
165
166
@@ -169,27 +170,28 @@ When the user starts the server:
169
170
RuntimeScreen
170
171
└── RuntimeViewModel.startServer()
171
172
└── ServerProcessManager.startServer(config)
173
+
├── KernelRepository.prepareActiveVersion()
172
174
├── BinaryExtractor.ensureAllAvailable(context)
173
175
├── build llama-server command line
174
176
├── configure process environment
175
177
├── ProcessBuilder(...).start()
176
178
└── read stdout/stderr for server status
177
179
```
178
180
179
-
`BinaryExtractor`restores runtime files under app-private storage:
181
+
`BinaryExtractor`stages active runtime files under app-private storage:
180
182
181
183
```text
182
-
filesDir/bin/llama-server
183
-
filesDir/lib/*.so
184
+
filesDir/bin/libllama-server.so # only for downloaded kernels
185
+
filesDir/lib/*.so # active kernel libraries
184
186
```
185
187
186
-
It first attempts to create symlinks from Android's extracted native library directory. If symlinking fails, it copies the files. The executable is marked with `chmod 755`.
188
+
For bundled kernels, the process launches `libllama-server.so` directly from Android's extracted native library directory. For downloaded kernels, Android does not reliably allow direct `execve` of app-private downloaded files, so the app launches `/system/bin/linker64 filesDir/bin/libllama-server.so ...`. The staged executable is still marked with `chmod 755` each time a kernel is activated or prepared.
187
189
188
190
`ServerProcessManager` configures library search paths before launching the process:
@@ -220,7 +222,7 @@ The active configuration is persisted as JSON at runtime by `ConfigRepositoryImp
220
222
The generated command has this general shape:
221
223
222
224
```text
223
-
filesDir/bin/llama-server
225
+
<nativeLibraryDir>/libllama-server.so
224
226
--model <model-path>
225
227
--poll 1000
226
228
--ctx-size <context-size>
@@ -240,6 +242,8 @@ filesDir/bin/llama-server
240
242
[--predict <tokens>]
241
243
```
242
244
245
+
Downloaded kernels use the same arguments with `/system/bin/linker64 <filesDir>/bin/libllama-server.so` as the command prefix.
246
+
243
247
The app treats stdout/stderr as the process status channel. It marks the server as running when output contains messages such as `HTTP server is listening` or `llama server listening`.
0 commit comments