Repository navigation
Check free VRAM before starting the engine, with a system protection setting (D-58) - #40
Merged
Merged
Conversation
…setting (D-58) engine_start now compares the model's estimated memory (file x 1.1 + 512 MiB) with the free memory of the device it loads on (speech devices --json), counting what the running engine holds as free. 設定 → システム保護 picks the strength: off, low (file size only), standard (estimate, default) and strict (estimate + 1.5 GiB). Below strict a shortfall asks before starting instead of refusing, so a load that would fit is never blocked outright. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Before
engine_startstops the running worker and starts the new one, it checks that the model will fit in the free memory of the device it loads on (src-tauri/src/memguard.rs, D-58).speech devices --json(about 0.15 s) with the profile's speech.exe and device (auto/empty → first GPU, else CPU;gpu;cpu; a name). A CPU profile is checked against main memory.memoryGuardin settings.json; an unknown value reads asstandard):engine_startnow returns{status: "started" | "confirm" | "blocked", check}and takesconfirmed. The UI asks withconfirm()and starts again on yes.blockedignoresconfirmedand shows a notice.Why
The user wants to avoid freezing the PC by loading a model over VRAM another program is using, without refusing loads that would fit. So the estimate stays close to the measured figure, a shortfall asks instead of refusing below 強, and the strength is a setting.
Notes for review
speech devicesfails, the device isn't listed, the file can't be read), it is skipped and the engine starts as before.experts_on_cpumay still run when the estimate doesn't fit (some experts are computed on the CPU); 標準 then asks first.memguard.rs: 5,src/store/app.test.ts: 4).npm run checkpasses.🤖 Generated with Claude Code