mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3502] [Other] tuning always fails: a CUDA-init failure in the bench run is recorded as OOM, and that command is then never retried #1433
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1433
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tcw-znjt on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3502
Area
[Other] (the tuning/calibration search in strata-control)
Desktop app, Terminal or source?
Desktop app (Windows)
What happened
On this PC the app's model tuning ("调优") fails every time now, and it fails at the very first measurement of my current settings ("base"). What I saw:
ggml_cuda_init: failed to initialize CUDA: no CUDA-capable device is detectedand exits.%APPDATA%\Strata\presets\history.jsonlwith"status": "OOM"(RAM was fine: the same line saysavailable 51.2 GiB), notFAIL_BOOT.Two separate things are involved:
The trigger (my environment). The tuning starts a second, full engine process to measure. When I ran it, the served model still held most of the 16 GB card. In the same session a normal engine start also failed with
no VRAM is left for the expert cache: it needs at least 274 slots (695 MiB), about 1615 MiB more than this card has free(exit 6,server_exited), andnvidia-smireportsdisplay_activeDisabled because the machine is driven through a remote-desktop virtual display. So the bench process could not get the card.The part that looks like a Strata bug.
strata_control/tune_session.py,failure_kind()(line 129-139): the OOM test searches the whole output formemory guard, and the engine's informational linestrata generate: memory guard: limit 63.8 GiB (source: meminfo), current 12.6 GiB ... available 51.2 GiBwas present in all 7 failed runs. So a run that died at CUDA initialisation is stored asOOMinstead ofFAIL_BOOT, and the reason line is a 3-line mixture of the CUDA error and two informational lines.strata_control/presets.py,bad_signatures()(line 510-521): a signature recorded asUNSUPPORTEDorOOMis "never retried". The poisoned signature here is the plain base command that had passed 4 times before with the samehwhash,modeldigest andenginesha (c2335807…). One transient condition therefore permanently disables the baseline candidate.strata_control/autotune.py(line 469-475): anOOMresult setsstorm/stopand the whole search ends with "an engine ran out of memory; the search stopped (nothing was retried)". Since the baseline itself is what "OOMs", every later tuning ends immediately.Expected behaviour: a CUDA-init failure should be classified as
FAIL_BOOT/CUDA-unavailable with an actionable message (the model must be unloaded, or the card is busy), and a signature that previously passed on the same hardware/engine/model should not be blacklisted permanently by one laterOOM.Smallest steps or command that reproduce it
What I actually did (this is the observed sequence, not a minimal deterministic recipe — I cannot make the CUDA failure happen at will):
PASSrows inhistory.jsonl(decode 61.4-69.5 tok/s, prefill 1547.8-1585.1 tok/s), 2026-10-20 17:46-17:53 local.%LOCALAPPDATA%\Strata\tuning\recheck.jsonhas a pending entry with"reason": "engine_changed").OOMrow withggml_cuda_init: failed to initialize CUDA: no CUDA-capable device is detectedin the reason.Reproduction status
Reproduced locally (7 consecutive failed attempts observed, all 7 written to
history.jsonl). The suggested code change has not been tested, and I have not yet re-run tuning after removing the bad rows — I will report back in this issue.Strata version
Strata 0.2.1 (desktop app) · strata-control 0.1.46.2 (bundle commit
5b47f889b0f52f1b7b9cc4b0994193b85f4664b6) · engine 0.1.46windows-x86_64-cuda-cuda13, measured engine shac2335807a15b…Graphics card, memory and system
RTX 5060 Ti 16311 MiB · 64 GB RAM · Windows 11 Pro 10.0.26300 · driver 616.56 (CUDA UMD 13.4) ·
nvidia-smicompute_modeDefault,display_activeDisabled (the desktop is served by a remote-desktop virtual display adapter: Oray/GameViewer/Zako virtual display drivers are installed) · CPU i5-12600KModel, size and settings
Qwen3.8-Flash-Next GSQ-RCO IQ3_S (pack +
--ple-ggufsplit), MTPmtp\rt,--max-context 131072 --kv k8v4 --vision --spec 4 --spec-min-p 0.5 --expert-cache auto --prefill auto --vram-reserve-mib 2048, data dir on a separate SSD.Logs
%APPDATA%\Strata\presets\history.jsonl— 7PASSthen 7OOM, samesig, samehw/model/enginehashes:The
PASSandOOMrows above have the samesig(--vram-reserve-mib 2048), they differ only in the wall-clock time; 6 of the 7OOMrows used 2048 and the last one used--vram-reserve-mib 700(Strata chose the "no display attached" reserve becausedisplay_activeis Disabled). Thebasesignature itself passed 4 times before (base,base,base r2,base end).Engine log (
%LOCALAPPDATA%\Strata\install\strata-iq3_s.log), a plain (non-tuning) engine start at 03:32:12 in the same session, showing that the card really had no room for a second engine:The app's run record for that attempt (
%APPDATA%\Strata\profiles\.ops\app-1\.runs\641aa76c….json) says"error": "server_exited", "exit_code": 6, and the next start (03:32:48, with--resident-budget-gib 27) came up fine and is serving now.The same
ggml_cuda_init: failed to initialize CUDA: no CUDA-capable device is detectedstring appears 12 times in that log (always immediately before aload_hparams: Qwen-VL models require at minimum 1024 image tokens…line), so it comes from a second process trying to init CUDA while the served engine holds the card, not from a driver that is missing the device:nvidia-smion the same machine sees the card and reportscompute_mode Default. I did not determine which process wrote each of those 12 lines (the tuning bench and the vision encoder both write into this log);setup.pyline 1345-1354 already notes that the engine, the vision encoder and the tuning run cannot share the card.The full sanitized
strata-iq3_s.logand the originalhistory.jsonl(14 rows) are available on request.Suggested small fixes (not tested)
failure_kind(): check the fatal line first.ggml_cuda_init: failed to initialize CUDA,no CUDA-capable deviceandCUDA-capable device(s) is/are busy or unavailableshould beFAIL_BOOT/CUDA-unavailable, with a message pointing at unloading the model or the busy card. KeepOOMfor allocation failures only, and consider not letting the informationalmemory guard:line decide the status.bad_signatures(): do not blacklist permanently when the same signature has a later (or earlier)PASSwith the samehw/model/engine, and clear the blacklist on the re-check events thattuning/recheck.jsonalready records ("reason": "engine_changed").tuning.leasemarker only blocks other tuning jobs, it does not look at the card.Workaround I used
Stopped/unloaded the model and other GPU users before tuning, and moved the 7
OOMrows out ofhistory.jsonl(kept a backup ashistory.jsonl.bak-20261021) so the base signature is not skipped. I have not yet confirmed that tuning succeeds after this — I will add the result here.Searched before posting
CUDA-capable,tuning,calibration. #3144 (Windows calibration fails,verify: an earlier window never finished on the GPU), #3490 and #3459 (tuning hangs /startup_wait_expired) are tuning failures too, but none of them covers theOOMmisclassification and the permanent signature blacklist.@Niko1221 commented on GitHub (Oct 21, 2026):
Fixed for 0.2.2, the next release (not out yet). Thanks for the exact trace. The "memory guard" line is only information; it no longer decides the status. A CUDA init failure is now FAIL_BOOT with "unload the model and tune again". A command that passed on the same PC, engine and model is no longer switched off for good by a later failure. Not changed yet: the tuning engine starting while the served model holds the card.