mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1155] [Windows / AMD] --vision cpu is still unreachable: hip_vision()'s WIN gate, find_vcvars()'s VS-18 range, and no encoder in the ready-made engine #486
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#486
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 @Hugua700 on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1155
[Windows / AMD]
--vision cpuis still unreachable: thehip_vision()gate,find_vcvars()'s version range, and the ready-made engine installing no encoderFollow-up to #881 (closed as completed). 0.1.40 fixed the two bugs reported there — the
package_windows.pyencodingand the
call "None"batch file — but the two blockers listed in #881's follow-up commentwere not answered, and they still stand on
main(82f46a8, 0.1.40.1).--vision cpuon Windows + AMD cannot worktoday, on a ready-made engine or a self-built one.
Everything below was read from
main, not from memory of 0.1.39. The encoder itself is fine — it is a plain CPUprogram with an MSVC branch, and it builds and runs on two Windows-AMD machines when the gate is opened by hand
(an RX 6800M / gfx1031 and a Strix Halo / gfx1151). What is missing is the plumbing.
1.
hip_vision()refuses--vision cpuon Windows (setup.py:2212)There is nothing Linux-only about
tools/vision: it is a standalone CMake project (add_executable(strata-vision strata_vision.cpp), linking llama.cpp'smtmd+llama), not a HIP/CUDA target; itsCMakeLists.txthas an explicitif(STRATA_PORTABLE AND MSVC)branch andstrata_vision.cppcontains#ifdef _WIN32. The reason for the message isthe packaging gap in §4, not a capability gap.
2.
find_vcvars()cannot see Visual Studio 2026 (setup.py:1122)The range exists because CUDA 13 accepts VS 2019/2022 only, and that reasoning is right for the CUDA path. It is
applied to every caller, though, including the CUDA-less CPU encoder build. On a machine whose only C++ tools are
VS 2026 (version 18) this returns
None. Measured on the RX 6800M machine:Note that
tools/hip/build_windows.bat:55already calls vswhere without the range and builds the whole HIP enginewith VS 2026 — so the packaging path works on VS 18 while setup cannot even find it.
The other half of this, reported from the Strix Halo machine: with a range that matches, vswhere's
-latestcan pickan install that is present but broken (there, VS 2019 Build Tools without
mspdbcore.dll→C1356), with no way topoint setup at the one that works. Until 0.1.40 that was a silent failure; now it is a clean
fail(), which is animprovement but still a dead end.
3. The ready-made Windows-AMD engine never installs an encoder (setup.py:4656)
The
not hipin that condition means the whole vision block is skipped for Windows + AMD: the ready-made engine iskept,
build_engine_hip()is never reached, and no encoder is built or installed. This is the prediction in #881 §4 —"the Windows-HIP prebuilt path never builds or installs an encoder at all — even if
hip_vision()were changed toallow
--vision cpu" — still true after 0.1.40, and it is why the 0.1.40 fix inbuild_vision_cpu()(passingfind_vcvars(), which #881 asked for) is unreachable code on this platform.It also means opening the gate in §1 alone would be a regression rather than a fix, because
visionwould staycpuand setup.py:4911-4917 writes the model config's
visionblock pointing atengine/strata-vision.exe:— a path that nothing created. The server would then be configured for an encoder that is not there.
4. The ready-made zip carries no encoder (tools/hip/package_windows.py:36)
So even a user who is willing to let setup compile the encoder gets nothing from the prebuilt path, and a user without
the C++ build tools has no route to images at all.
What I did to confirm the encoder works (both machines, by hand)
Build it with MSVC + Ninja (VS 2026 Build Tools on the RX 6800M machine, VS 2026 Community on the Strix Halo one):
Copy
strata-vision.exeintoengine/, record"vision": "cpu"+vision_srcinengine/BUILD.json.Remove the
if asked == "cpu" and WIN:branch above, then runSTART-HERE.bat --setup --yes --family qwen --model <m> --vision cpu --no-start.Result on both machines: setup reports
images: on (encoder on the CPU),/healthreports"images": true, and atest image is described correctly through
/v1/chat/completions(5.6 s on gfx1151 for a 400x200 image; ~20 sincluding CPU encoding for a 720x360 one on gfx1031).
Note
-DSTRATA_PORTABLE=ONin that recipe: it gives the encoder the static MSVC runtime, like the engine in theready-made zip.
setup.py'sbuild_vision_cpu()does not pass it.Suggested fix
setup.pyhip_vision()and WINgate;--vision cpumeans the CPU encoder on every platformsetup.pyfind_vcvars()STRATA_VCVARSoverride for a broken or unusual installsetup.pybuild_vision_cpu()setup.pymain()tools/hip/package_windows.py+build_windows.batstrata-vision.exein the zip, so images work with no toolchain at all1-4 are enough for
--vision cputo work on Windows + AMD with the C++ build tools present; 5 additionally removes thetoolchain requirement. I have a branch with 1-4 written and a second commit for 5, and I am happy to open it as a PR if
that is wanted — and to test a build here (RX 6800M / gfx1031, Windows 11, Chinese locale, VS 2026 only) either way.
Machines: Windows 11, R9 5900HX + RX 6800M (gfx1031), 31 GB RAM, self-built 0.1.40 HIP engine — and nencinif's Strix
Halo (Ryzen AI Max+ 395 + Radeon 8060S / gfx1151) for §1 and §2.
@gt50 commented on GitHub (Oct 10, 2026):
Confirming on another Strix Halo under Windows: the CPU encoder works once it's built and wired in by hand.
Machine: GMKtec EVO-X2, Ryzen AI Max+ 395 / Radeon 8060S (gfx1151), Windows 11 Pro 10.0.26300, the ready-made
strata-windows-x64-hip.zip0.1.40.2, Unsloth UD-IQ4_XS.What I did, without running setup (so
setup.pystays unmodified):Built the encoder with VS 2022 Build Tools (17.14) and the Ninja from Strata's
.venv, the waybuild_vision_cpu()does (native CPU, so AVX-512 here):131 steps, no errors. I copied
build-vision\bin\strata-vision.exetoengine\. It runs outside the VS environment, with no missing DLLs.Downloaded the vision file setup uses for the Unsloth family:
mmproj-Qwen3.8-Flash-Next-BF16.gguffrom ISTA-DASLab at the pinned revisioned59f920…. The SHA-256 matches the publishedb1a82259….Added to the model config what setup writes for
--vision cpu:"vision"block:exe,mmproj,model= shard 00001,gpu: false,max_tokens: 300,threads: 16;--vision --vram-reserve-mib 700inargs.With the vision block alone,
/healthalready says"images": true, but every image request fails with400 this engine was started without --vision. So anyone wiring this up by hand needs both parts.Result:
/healthreports"images": true, and all 24,576 experts still fit in the cache (33 GB of VRAM free).Note: the encoder logs
Qwen-VL models require at minimum 1024 image tokens to function correctly on grounding tasksagainst setup's CPU default of 300 (max_tokens). Simple pictures were fine; dense documents and grounding may want more.So this machine agrees with the #1155 analysis: nothing in the encoder is Linux-only. What's missing is setup's Windows-AMD path (
hip_vision(), the ready-made zip) installing and enabling it.@gt50 commented on GitHub (Oct 10, 2026):
Follow-up to my comment above: the encoder also runs on the GPU on Windows AMD, built with llama.cpp's Vulkan backend, and it's much faster for documents.
Build. Same machine (Ryzen AI Max+ 395 / Radeon 8060S, Windows 11), with the Vulkan SDK installed (1.4.350, for
glslc). Its own folder, so the CPU build stays:GGML_CUDA, soGGML_VULKANpasses straight through (449 build steps, "Including Vulkan backend").engine\and set"gpu": truein the config'svisionblock, so the server passes--gpu. It loads in 1.1 s and warms up at 1024 image tokens in 1.8 s.Measured. UD-IQ4_XS, 1224 x 1584 phone photos of documents (tilted, softened), 1024 image tokens, the first read of each picture:
--vram-reserve-mib 700, all 24,576 experts still cached).Setup support for both builds is in #1789:
--vision cpuuses a hand-built encoder (frombuild-vision);--vision gpuuses the Vulkan build (frombuild-vision-vulkan);docs/AMD_HIP.md.Also noting #1322 on
main(the engine started with--visionwhen the config has a vision section), which fixes thethis engine was started without --visiongotcha from my previous comment.@Hugua700 commented on GitHub (Oct 10, 2026):
@gt50 — thank you. The Vulkan build is the better answer for this, and your numbers settle it: encoding ~23 s on the CPU against ~1 s on the GPU (31.7 s → 9.8 s on the settlement statement). Two things in your follow-up I had not considered at all: that
tools/vision's CMake file forces onlyGGML_CUDA, soGGML_VULKANpasses straight through; and that setup's CPU default of 300 tokens is too low for documents (32/44 amounts, 2026 read as 2008) — that is a quality bug on its own.#1789 supersedes my #1156 on this path, so I have closed #1156 rather than leave two overlapping PRs to review. #1789 covers
hip_vision(), placing the encoder after an engine update, the docs and the tests — more than mine did, plus the GPU path mine never had.Two things #1789 does not cover. I have kept them separate instead of folding them in:
1.
find_vcvars()cannot see Visual Studio 2026 — and that blocks #1789's own--vision cpu.#985's
cuda_vrelaxes the[16.0,18.0)range only for CUDA 13.3+. A non-CUDA caller still passes nocuda_v, so the range still applies, and a machine whose only C++ tools are Visual Studio 2026 (version 18) getsNoneback.build_vision_cpu()callsfind_vcvars()with no arguments, so on that machine the encoder cannot be built at all and--vision cpustays unreachable even with your gate open.That is the machine this issue came from (RX 6800M / gfx1031, Windows 11, Chinese locale, VS 2026 Build Tools 18.4.11605 the only C++ tools). Filed as its own small PR — #1792, one function, CUDA callers unchanged (
cuda_v=(13, 0)still refuses VS 18,cuda_v=(13, 3)still takes it) — because it is independent of the vision plumbing. It also addsSTRATA_VCVARS=<vcvars64.bat>for a vswhere that cannot be used.2. Shipping the encoder inside the ready-made zip.
The original point of this issue was that the ready-made Windows AMD engine carries no encoder, and #1789 (like my #1156) still leaves the user to install VS Build Tools or the Vulkan SDK and build by hand.
package_windows.pycould carry astrata-vision.exebuilt with-DSTRATA_PORTABLE=ON(AVX2 baseline + static CRT, so it runs on other people's machines), and setup would then need no toolchain at all. I measured it before closing #1156: the zip goes 120 → 122 MiB, itsBUILD.jsonrecords"vision": "cpu", and a build without an encoder packages exactly as before. That is a release-policy call rather than a bug, so I have not filed it — say the word and I will.And thank you for #1322 as well: the
"images": trueplus400 this engine was started without --visionmismatch I hit when wiring it up by hand is exactly that.@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
@Hugua700 commented on GitHub (Oct 14, 2026):
Re-checked on v0.1.44: the published Windows HIP engine still ships without
gfx1031, and still ships without any vision binary. Two things I could verify, in case they are useful.1. What the published engine actually contains
strata-windows-x64-hip.zip(604.2 MB, sha25671b8a531c3c54e59de3029a371787840d515591d63e04ccd5e94633af28470ae),BUILD.jsonread straight out of the archive:gfx1031is not inarchs.rocm/.kpackholdsgfx1030 gfx1100 gfx1101 gfx1102 gfx1151 gfx1200 gfx1201— nogfx1031.strata-vision.exe, nothing matchingvision|encoder|mmproj|clip.2. It is not a dead end on gfx1031 — both halves work here
Machine: ROG Strix G513QY, Ryzen 9 5900HX + Radeon RX 6800M (gfx1031), Windows 11 26300, official ROCm 10.2.0a20260930. Only 12 GB VRAM.
tools/hip/build_windows.batandSTRATA_HIP_ARCHS=gfx1031. It cross-compiles on a second machine that has no AMD GPU at all, so this is not something that needs your hardware. ResultingBUILD.json:"archs":["gfx1031"], and it runs.strata-vision.exeis 41,202,176 bytes, and vision works:/healthreports"images": true, and a synthetic 768x512 test image (red circle, blue square, green triangle, and bold blackSTRATA 2026 TEMP-TEST) is described correctly, including reading the text. A/B note: with our own binary theBUILD.json"vision"field makes no difference at all (noneandcpuproduced byte-identical answers), so the published"none"describes what ships, not what the code can do.Earlier notes on this machine, including the two-GPU Vulkan encoder behaviour from #1792: https://github.com/Hugua700/old-amd-local-ai
3. The asks
gfx1031be added to the published Windows HIP engine? It is the laptop member of the same Navi 22 family asgfx1030, which you do ship, and it is common (RX 6800M / 6700M / 6600M in ROG, Alienware, Legion laptops).I still have the machine and the logs, so I am happy to re-test on 0.1.44 / 0.1.44.1 the moment a gfx1031 build exists — including on the exact model that motivated the original report. Thanks for 0.1.43.1's long-prompt fix either way; that one matches something we hit on 12 GB cards.
@Hugua700 commented on GitHub (Oct 14, 2026):
Follow-up: I built v0.1.44 (
ed4773eb) from source forgfx1031, and it works. Posting it here since the earlier note in this thread said I would re-test once a gfx1031 build existed.tools/hip/build_windows.batandSTRATA_HIP_ARCHS=gfx1031, on a second machine that has no AMD GPU at all (pure cross-compile, so no gfx1031 hardware is needed to produce it).BUILD.jsonread straight out of the resulting archive:zip sha256
25e6371e03c8eec0ab75c8fa721de4d9d9fbd1c7a73fc520dcb0c37b904b0de4(126,934,139 bytes)./healthreports"images": true, and the synthetic 768x512 test image (red circle left, blue square middle, green triangle right, bold black captionSTRATA 2026 TEMP-TEST) is described correctly including reading the caption text.One thing that may be useful: v0.1.44's own
tools/hip/build_windows.batalready listsgfx1031in its defaultSTRATA_HIP_ARCHS(the comment there even cites #915 / #1078). So the source path handles gfx1031 fine -- it is only the published Windows engine that omits it.Nothing further needed from me on this issue; I am just closing the loop on the "re-test on 0.1.44" note above. Thanks for 0.1.44.
@ogwtak commented on GitHub (Oct 15, 2026):
I'm a Windows user in Japan, not a software engineer.
I'm running Strata on two Windows systems:
AMD Strix Halo (128GB)
64GB RAM + NVIDIA RTX 3070 (8GB VRAM)
On the latter system, I encountered an out-of-VRAM error when launching Strata after setup. I asked Codex to fix the issue, and it ended up replacing the image encoder with one that runs on the CPU.
Seeing this, I asked Codex to "make it work the same way on Strix Halo." After letting Codex modify the setup, I was able to use image recognition successfully on my Strix Halo system as well.
Adding a special workaround may not be the most elegant solution. However, it seems (probably!) that this could be handled with relatively minor changes to the setup script, without modifying the core engine.
Since CPU-based image encoding is already used in NVIDIA environments when VRAM is limited, I think offering the same option for Windows + AMD users would be a useful interim solution, especially for non-technical users like myself.
It would be great to have an option such as "Use Image Encoder on CPU (Slower, but saves VRAM)" during setup on Windows system.
Thanks to everyone involved in developing Strata!
@Hugua700 commented on GitHub (Oct 15, 2026):
Note that this issue is closed, so it may be missed here -- the live place for Windows image support is PR #1789 ("setup: images on Windows AMD with a hand-built encoder, CPU or Vulkan", by @gt50), which is still open and resolves this issue.
What you are asking for is essentially what that PR adds:
hip_vision()accepts--vision cpuon Windows when a hand-built encoder exists (it looks inengine\,build-vision\bin,engine\.previous,build-vision-vulkan\bin), and--vision gpuwhen the Vulkan build exists -- i.e. your "Use Image Encoder on CPU (slower, but saves VRAM)" option, as an opt-in flag rather than a setup prompt.place_windows_encoder()puts the chosen build beside the engine, including after an engine update replacesengine\-- that is the step that catches people who place the encoder by hand.Two things worth knowing before you rebuild:
tools/vision(-DGGML_VULKAN=ONfor the GPU build). That is why the PR is setup-only, and why this is not yet a one-click setup choice.find_vcvars(); that was fixed by #1792 (Hugua700, closed with the content folded in). If your copy predates that, update first.For your Strix Halo specifically: the Vulkan measurements in that PR (9.8 s vs 31.7 s per document photo) were taken on a Ryzen AI Max+ 395 / Radeon 8060S -- the same hardware you have -- so on that box the GPU encoder is both the tested route and by far the faster one. The CPU encoder is the fallback that matters on your 8 GB RTX 3070.
For the 8 GB side, there is also a recent community thread on an RTX 3070 Ti 8 GB (#2581) if you want numbers from that VRAM class.
I wrote the whole Windows + AMD route up in one place, including the traps (SPIRV-Headers_DIR on older Windows Vulkan SDKs) and how a hand-placed encoder behaves on a 12 GB gfx1031 card: https://github.com/Hugua700/old-amd-local-ai
@Hugua700 commented on GitHub (Oct 15, 2026):
One follow-up, since yours is the first report I have seen of this on a Windows AMD machine under VRAM pressure -- and it may be a different problem from the one the open PR solves.
If the Codex session is still around, could you paste what it actually changed (which files, or the diff)? It is worth capturing rather than leaving it local, for two reasons:
--vision cpu, but the encoder still has to be built by hand fromtools/visionfirst. If what Codex gave you is something more automatic -- a setup prompt, or falling back to CPU when the encoder does not fit beside the model -- then that is a different answer from what #1789 does today, and a better one for the "non-technical user" case you describe.No obligation -- if a diff is awkward, even a short note of which files it touched, plus the exact error text from before the fix, would be enough to tell which of the two it is.
@ogwtak commented on GitHub (Oct 16, 2026):
Thank you for your response. I understand that the main thread is moved to #1789 .
m(_ _)m
Separately, I asked Codex to prepare reports describing the work it performed on each PC, as requested. I’ve attached them here.
I hope they help clarify what was changed and prove useful for your investigation.
Strata_VRAM_fix_report_for_issue_1155.txt
Windows_AMDStrixHalo_CPU_Vision_Setup_Procedure_EN.txt