Skip to content

GPU: training, tagging and embedding runs make the card busy, not only games - #364

Merged
Randomname653 merged 1 commit into
mainfrom
claude/gpu-foreign-python
Nov 15, 2026
Merged

Randomname653 merged 1 commit into
mainfrom
claude/gpu-foreign-python

Conversation

@Randomname653

Copy link
Copy Markdown
Owner

Curatarr now steps aside for training, tagging and embedding runs, not only for games.

On the owner's PC a training run took 20 minutes instead of 7: the curator loaded next to it, and a chat waited 10 minutes for the card and then timed out.

I measured the PC with the Windows GPU engine counters on 2026-11-15, the same counters Task Manager and the PC agent read:

Work Process Share of the 3D engine (where CUDA work shows) Own VRAM
Tagging python.exe 80–88 % 6.5 GB
SigLIP embedding python.exe (new pid) 71–74 % –
Training python.exe (new pid) 82–92 % over 20 readings 0.8 GB

Three gaps hid these runs:

  1. python.exe was in SYSTEM_PROCESSES, so the per-program check threw it away. This was the main cause.
  2. The full-card gate looks at overall load (≥ 85 %) and free memory (< 2.5 GB). The training run left plenty of memory free, and the overall load was swinging (45 % at the moment of reading).
  3. Any Ollama model loaded at the time excused the load as Curatarr's own.

Change

  • gpu_engine.per_process reports each program's pids, and the PC agent reports its own pid as own_pids.
  • process_monitor.foreign_compute looks for an interpreter (python.exe, pythonw.exe or python3.exe) that is not one of Curatarr's own processes. If it draws ≥ 30 % (GPU_PROC_BUSY_PCT) on 2 readings in a row (GPU_PROC_POLLS), pc_busy marks the PC busy and gives the reason as "python.exe computes on the card".
  • A desktop install reads its own card through the same counters (local_foreign_compute, called from is_game_running).
  • Interpreters never get the "is this a game?" question. It is one name for every script, and an answer would hide every later run.
  • These do not count:
    • Python processes that are not using the GPU, or using it under 30 %.
    • Spikes shorter than two readings.
    • CPU load.
    • A process that only holds VRAM. The full-card gate still covers that case.

Tests

  • test_gpu_game_detection +10:
    • the three measured profiles;
    • Curatarr's own pid never counts;
    • light use does not count;
    • the card is free again once the run ends;
    • python.exe never gets the game question;
    • the desktop path;
    • the agent reports its own pid.
  • test_llm_lane pins the extra cause in its no-short-circuit check.
  • Battery: 356/357. test_loop_free_probes timed out under parallel load. It passes on its own, and it also failed that way earlier today, before this change.
  • Live check: a python.exe job running at 58–66 % was detected on the second reading.

Rollout

  • The NAS needs the new image. The tray's PC agent updates through the bell.
  • An older agent that sends no pids still works. Every python process on the card then counts as foreign, and no Curatarr process runs Python on the GPU anyway.

🤖 Generated with Claude Code

…embeddings

The owner's training run took 20 minutes instead of 7 while the curator
loaded beside it, and a chat waited 10 minutes for the card. Measured on
the 4090 (Windows GPU engine counters, 2026-11-15): tagging 80-88 %, a
SigLIP embedding 71-74 %, training 82-92 % of the 3D engine (where CUDA
work shows), the training with 0.8 GB of VRAM. Three gaps hid them:
python.exe was a 'system process', the full-card gate saw free memory and
a swinging overall load, and any loaded Ollama model excused the load.

- gpu_engine.per_process reports each program's pids; the PC agent reports
  its own pid (own_pids).
- process_monitor.foreign_compute: an interpreter (python.exe / pythonw /
  python3) that is not Curatarr's own process, drawing GPU_PROC_BUSY_PCT
  (30 %) or more for GPU_PROC_POLLS (2) readings, makes pc_busy say so
  ('python.exe computes on the card'); a desktop install reads its own card
  through the same counters (local_foreign_compute in is_game_running).
- Interpreters stay out of the 'is this a game?' question: one name, every
  script; an answer would hide every later run.

Live: Don's running python job at 58-66 % detected on the second reading.
tests: test_gpu_game_detection +10 (the three measured profiles, own pid,
light use, run ends, never a game question, desktop path, agent own pid);
test_llm_lane pins the extra cause in the no-short-circuit check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Randomname653
Randomname653 merged commit cebc79e into main Nov 15, 2026
9 checks passed
@Randomname653
Randomname653 deleted the claude/gpu-foreign-python branch November 15, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant