#2113·SurfSense

[idea] Docker 13/14: Refuse a CUDA image with no GPU

Author: AnishSarkar22Created Oct 1, 2026Updated Oct 1, 2026
Labelsenhancementhelp wanteddesktopdocker

Which part? Desktop app

What would you like?

Step 13 of 14 of #2100: running SurfSense in Docker. Depends on #2112; start once it is merged.

Stop the most common GPU mistake: starting a CUDA image without giving it the card, which silently runs on the CPU.

Design: GPU images, A CUDA image with no GPU

What to change

  • surfsense_local/electron/src/headless/gpu-check.ts: on a CUDA image, run llama-server --list-devices before boot; with no CUDA device, exit with a message naming the fix.
  • SURFSENSE_ALLOW_CPU=1 skips the refusal.

Done when

  • A -cuda image started without --gpus exits with the message.
  • With SURFSENSE_ALLOW_CPU=1 it starts on the CPU.
  • The CPU image never runs the check.
  • CI checks both cases on a runner without a GPU.

Scope: code and tests only. Don't edit docs/ or AGENTS.md, except to fix a link this change breaks; the maintainers update the docs when the Docker work ships.

Why would it help?

Each step leaves something that runs, so the Docker image is built and reviewed one piece at a time.