Skip to content

Commit ac1f4c8

Browse files
MTSistemiclaude
andcommitted
ai-panel: fix Ollama CPU fallback (#14) + add user to docker group (#13)
DEFAULT_COMPOSE sets OLLAMA_VULKAN=1 + OLLAMA_IGPU_ENABLE=1 (+flash-attention) so the BC-250 iGPU is used instead of CPU. Setup wizard adds the desktop user to docker and runs the first compose up via pkexec so it works before re-login; prompts to re-login. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 004349e commit ac1f4c8

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

apps/ai-panel/skillfish-ai-panel

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@ DEFAULT_COMPOSE = """services:
226226
image: ollama/ollama:rocm
227227
container_name: skillfish-ollama
228228
restart: unless-stopped
229+
environment:
230+
# BC-250 (gfx1013): use the Vulkan backend and allow the integrated GPU,
231+
# otherwise Ollama silently falls back to slow CPU inference.
232+
- OLLAMA_VULKAN=1
233+
- OLLAMA_IGPU_ENABLE=1
234+
- OLLAMA_FLASH_ATTENTION=1
235+
- OLLAMA_KEEP_ALIVE=30m
229236
devices:
230237
- /dev/kfd
231238
- /dev/dri
@@ -326,19 +333,27 @@ class InstallPage(QWizardPage):
326333
def _append(self, s): self.log.append(s)
327334
def run(self):
328335
self.btn.setEnabled(False); self.bar.show()
336+
user = os.environ.get("USER") or os.environ.get("LOGNAME") or "skillfish"
329337
steps = []
330338
if not docker_ok():
331339
steps.append("pkexec sh -c 'apt-get update && apt-get install -y docker.io docker-compose-v2 && systemctl enable --now docker'")
340+
# add the desktop user to the docker group so `docker` works without sudo (needs re-login)
341+
steps.append(f"pkexec usermod -aG docker {user}")
332342
steps.append(f"pkexec mkdir -p {STACK_DIR}" if not os.access(os.path.dirname(STACK_DIR), os.W_OK) else f"mkdir -p {STACK_DIR}")
333343
if not stack_present():
334344
# write a default compose if the SkillFishOS one is absent (needs root for /opt)
335345
tgt = os.path.join(STACK_DIR, "compose.yaml")
336346
steps.append("pkexec sh -c " + repr(f"cat > {tgt} <<'EOF'\n{DEFAULT_COMPOSE}EOF\n"))
337-
steps.append(f"sh -c 'cd {STACK_DIR} && docker compose up -d'")
347+
# run compose as root: the docker group membership above only applies after re-login,
348+
# so the very first start must not rely on it (this is the fix for the perm-denied bug)
349+
steps.append(f"pkexec sh -c 'cd {STACK_DIR} && docker compose up -d'")
338350
self._queue = steps; self._next()
339351
def _next(self):
340352
if not self._queue:
341-
self._append(L("\n✓ Stack avviato.", "\n✓ Stack started."))
353+
self._append(L("\n✓ Stack avviato. Esci e rientra nella sessione perché l'accesso "
354+
"a Docker senza sudo diventi effettivo.",
355+
"\n✓ Stack started. Log out and back in so passwordless Docker "
356+
"access takes effect."))
342357
self.bar.hide(); self.ok = True; self.completeChanged.emit(); return
343358
cmd = self._queue.pop(0)
344359
self._append("$ " + (cmd[:90] + ("…" if len(cmd) > 90 else "")))

0 commit comments

Comments
 (0)