Repository navigation
Conversation
…error A V2EX user (t/1248449 #7) hit 'LiteRT: failed to create cpu engine' on Windows — the model is present but the prebuilt LiteRT-LM library needs AVX, same hard floor we mapped for Synology NAS boxes. Linux already pre-checks /proc/cpuinfo; Windows has no equivalent, so after both backends fail to create an engine we now ask IsProcessorFeaturePresent (PF_AVX_INSTRUCTIONS_AVAILABLE, trusted only on Win10 2004+ builds) and, if AVX is missing, flip the existing cpuUnsupported state: status bar / settings explain the situation, the indexer stops retrying, and OCR / face / filename / tag search keep working. Diagnosis runs only after failure, never preemptively — Hyper-V can mask AVX from the API on CPUs that have it, and older builds return false for unknown feature ids.
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.
Fixes the failure reported in V2EX t/1248449 reply #7:
LiteRT: failed to create cpu engineon Windows — model present, won't load, semantic search silently dead.Cause. The prebuilt LiteRT-LM library hard-requires AVX on x64 (the same floor we mapped for Synology: J4125/J4025/J3455/N5105 etc.). Linux pre-checks
/proc/cpuinfoand disables the semantic channel with an explanation; Windows had no check, so old CPUs got the raw engine error and no guidance.Fix. After both backends fail to create an engine on win32-x64, ask
IsProcessorFeaturePresent(PF_AVX_INSTRUCTIONS_AVAILABLE)via koffi — trusted only on build ≥ 19041 (Win10 2004, where the feature id was added). If AVX is missing, latch the existingcpuUnsupportedstate: status bar / settings / image-search notice explain it, the indexer skips the semantic channel, OCR / face / filename / tag search keep working, and the provider is dropped so nothing keeps retrying.Deliberately diagnosis-after-failure, never a preemptive block: Hyper-V can mask AVX from this API on CPUs that do have it (e.g. reports of Ryzen 3950X reading false), and pre-2004 builds return false for unknown ids — a false 'no AVX' here can only relabel an already-failing machine, never disable a working one.
Tests.
cpu.test.tsextended for the error classifier; typecheck + core suite pass (sprite.test.ts fails only without ffmpeg-static's postinstall binary, unrelated).