mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #881] [Windows / AMD] RX 6800M (gfx1031) runs with a self-built HIP engine — plus 2 Windows bugs found (packaging encoding, vision vcvars) #387
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#387
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 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/881
Following
docs/AMD_HIP.md("the ready-made zip itself has not run a model on a discrete card yet — please report" / "Reporting a Windows AMD run"), here is one — on a card the current prebuilt engine does not cover.Hardware / software
32.0.21045.5002(Windows reports PCI1002:73DF)0.1.39, engine0.1.39, ROCm10.2.0a20260930(TheRock)--max-context 32768,--kv int8,--resident-experts(low-RAM mode)1.
setup.pyrefuses the card, for two independent reasonsSTART-HERE.bat --backend hipprints:_WIN_AMD_DIDhas no0x73DFentry (only0x73BF/0x73AF/0x73A5 → gfx1030)._WIN_AMD_NAME's fallback deliberately excludes the mobile part:RX\s*6800(?!\s*[MS]).Reason (2) is correct in spirit — the mobile 6800M is Navi 22 = gfx1031, while desktop 6800/6900 are Navi 21 = gfx1030. But it may bite users: the README's "RX 6800 / 6900 series" reads as covering the 6800M, and the prebuilt Windows zip does not contain gfx1031 either, so the card is refused twice over:
2. What worked: self-build for gfx1031
rocm-sdk-device-gfx1031exists in the TheRock index, so I mapped0x73DF → gfx1031in_WIN_AMD_DIDand built the engine myself (tools/hip/build_windows.batwithSTRATA_HIP_ARCHS=gfx1031) — no other source change needed for the engine itself. ThenSTART-HERE.bat --backend hip --prebuilt dist\.strata-device.exe --selftest:Running (Coder IQ1_M, low-RAM mode, GPU holds ~30 % of the experts):
As expected for RDNA2, setup reports no hipBLASLt table → plain hipBLAS for prompt GEMMs.
3. Bug:
tools/hip/package_windows.pyfails on a non-UTF-8 locale (compile succeeds, packaging always fails)Line ~145/146 call
Path.read_text()without an encoding, so the locale codec is used. On a Chinese Windows (GBK)CMakeLists.txtcannot be decoded:⇒ the engine compiles and then the zip is never produced. Fix: pass
encoding="utf-8"(2 call sites here;setup.pyhas ~31 more unprotectedread_text()calls that are exposed to the same class of failure — running setup withPYTHONUTF8=1works around all of them).4. Bug: the CPU vision encoder can never be built on Windows (
vcvars=None)build_vision_cpu()calls:On Windows
cmake_build()writes a batch file whose first line iscall "{vcvars}"— withvcvars=Nonethat iscall "None", so the build always fails. The NVIDIA path passes a realvcvars(setup.py:2323), so this only shows up if the HIP path ever reaches it.It currently cannot: the "engine has no encoder → compile it" branch is guarded by
if eng is not None and not hip, so the Windows-HIP prebuilt path never builds or installs an encoder at all — even ifhip_vision()were changed to allow--vision cpu.5. …but the CPU image encoder does work on Windows
hip_vision()refuses--vision cpuon Windows with "the CPU image encoder is Linux-only for now (… has no image encoder)". As far as I can tell that is a packaging/plumbing gap rather than a capability one:tools/visionis a standalone CMake project (add_executable(strata-vision strata_vision.cpp), links llama.cpp'smtmd+llama), not a HIP/CUDA target;CMakeLists.txthas an explicit MSVC branch (if(STRATA_PORTABLE AND MSVC)), andstrata_vision.cppcontains#ifdef _WIN32;strata-vision.exe(PROGRAMS = ("strata.exe", "strata-device.exe")).I built it with MSVC + Ninja (
-DSTRATA_VISION_CUDA=OFF -DSTRATA_PORTABLE=ON), dropped it intoengine\, recordedvision: "cpu"+vision_srcinengine/BUILD.json, downloaded themmproj, and added the config section. It starts and reports:Then
--vision+ the config'svisionblock work: a generated 720x360 image of large digits is read correctly, and a 3-red-circles/2-blue-squares image is counted correctly. (Note the defaultVISION["cpu"]["max_tokens"] = 300is below the 1024 the encoder itself warns about — fine for coarse tasks, worth knowing for grounding.)So on Windows+AMD the encoder looks buildable from source today; only the packaging and the two guards above stand in the way.
6. One deliberate deviation worth a look
For
--vision cpuI did not pass--vram-reserve-mib, although setup appendsVISION[vision]["reserve_mib"](700) for any non-none vision. Ingenerate.cpp,vram_reserve_mibalready defaults to 700, and passing it explicitly setsvram_reserve_given = true, which disables the automatic lowering of the reserve when the expert cache would get too small (#496). Since a CPU encoder uses no VRAM, keeping the automatic fallback is strictly better on a 12 GB card in low-RAM mode. If that reasoning is right, appending--vram-reserve-mibforvision == "cpu"may be unnecessary.Summary
package_windows.py's missing encoding (build OK → package always fails on non-UTF-8 locales), andbuild_vision_cpu()'svcvars=None.Happy to send logs (
strata-coder-iq1_m.log, build output) or test a patch if useful.@Niko1221 commented on GitHub (Oct 6, 2026):
Fixed in 0.1.40: package_windows.py and setup.py read their files as UTF-8, the CPU image encoder build finds the Visual Studio environment like the CUDA path, and PCI id 73DF (RX 6700 XT / 6800M) is gfx1031 with a hint to self-build the engine.
@Hugua700 commented on GitHub (Oct 6, 2026):
Thanks for 0.1.40 — verified on the RX 6800M machine from this report (Windows 11, Chinese locale, R9 5900HX + RX 6800M / gfx1031, 31 GB RAM).
What I confirmed here, with a self-built HIP engine (
STRATA_HIP_ARCHS=gfx1031):setup.pynow maps0x73DFtogfx1031natively.START-HERE.bat --checkprints[ok] GPU: AMD Radeon RX 6800M, 12.0 GB VRAM, gfx1031where it previously saidnot supported ... unknown (PCI 73DF). My local patch for that is retired.tools/hip/build_windows.batnow compiles and packages on this GBK-locale Windows with noencoding patch —
Done: dist\strata-windows-x64-hip.zip, engine 0.1.40, gfx1031. That one isretired too.
call "None".Much better than the silent breakage I hit.
Two things still block the CPU image encoder on this machine, both on the Windows-AMD path — noting
them in case they are not intentional:
(a)
hip_vision()still returns"none"for--vision cpuwhenWIN. The encoder itself isfine here:
tools/visionwith-DSTRATA_VISION_CUDA=OFFand MSVC builds and runs, I install it intoengine/by hand and/healthreports"images": true, images work. So the "Linux-only for now"gate looks like the only thing in the way.
(b) Even with (a) opened,
find_vcvars()returnsNoneon this box. It restricts to-version "[16.0,18.0)"(VS 2019/2022) — the comment says that is for CUDA 13 — but this machine hasonly VS 2026 Build Tools (18.4.11605).
cmake_build()then stops withthe Visual Studio C++ build tools were not foundeven though VS 18 is installed and builds thistarget fine; I build the encoder by calling
...\18\BuildTools\VC\Auxiliary\Build\vcvars64.batdirectly. The CUDA-13 range does not apply to a
STRATA_VISION_CUDA=OFFbuild, so maybe the rangecould be relaxed for non-CUDA targets, or
find_vcvars()could take an override.If a build to test either of those would help, I am happy to run it and report back. Machine details
are in the first post;
/v1/chat/completionswith tools also works on 0.1.40 (returns propertool_calls), for what it is worth.@nencinif commented on GitHub (Oct 6, 2026):
Confirming (a) on a second Windows-AMD machine, this time Strix Halo: the CPU image encoder works with the ready-made 0.1.40 HIP engine once
hip_vision()stops rejecting--vision cpuon Windows.Machine: Windows 11, Ryzen AI Max+ 395 / Radeon 8060S (gfx1151), BIOS split 48 GB GPU / 16 GB OS, ready-made
strata-windows-x64-hip.zip0.1.40, IQ3_XXS.What I did:
cmake -G Ninja -S tools/vision -B build-vision -DLLAMA_DIR=third_party/llama.cpp -DSTRATA_VISION_CUDA=OFFwith VS 2026 Community'svcvars64.bat, then copiedstrata-vision.exetoengine/.if asked == "cpu" and WIN:branch ofhip_vision()insetup.py.START-HERE.bat --setup --yes --family qwen --model IQ3_XXS --vision cpu --no-startthen printedimages: on (encoder on the CPU), downloaded the mmproj and wrote the start script.Result:
/healthreports"images": true; a 400x200 test image (red circle, blue square, text) was described correctly in 5.6 s through/v1/chat/completions.Two build notes, in case they help (b):
find_vcvars()picked my VS 2019 Build Tools (inside[16,18)), but that install is missingmspdbcore.dlland the compile fails with C1356. VS 2026 Community built fine.ninjadefault parallelism dies withC1060: compiler is out of heap spaceinmtmd;--parallel 2fixed it.Unrelated but possibly useful for gfx1151 on Windows: with
tune_hipblasltbuilt frombuild_windows.bat(run with the DLLs/kpacks shipped next to the engine; run against the venv's ROCm it failed withhipErrorInvalidDeviceFunction), I calibrated a hipBLASLt 100500 table for gfx1151. Setup picked it up, and a ~6.3K-token prompt went from ~322 to ~550 tok/s; decode unchanged (~41 tok/s). Happy to open a PR with the table if that's wanted.