[PR #1768] [CLOSED] Windows AMD: image input on the CPU and on the GPU through Vulkan, te… #3661

Closed
opened 2026-11-07 15:29:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1768
Author: @WeisTekEng
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: windows-amd-vision


📝 Commits (8)

  • 66df2af Windows AMD: image input on the CPU and on the GPU through Vulkan, tested on RX9070xt Nitro+
  • 7c110d8 Windows AMD vision: review fixes (AVX2 encoder build, cmake lookup, keep images on re-run)
  • 4d282b2 Merge branch 'main' into windows-amd-vision
  • e0555d3 Merge branch 'main' into windows-amd-vision
  • 4de6502 Merge branch 'main' into windows-amd-vision
  • 4b7d090 Merge remote-tracking branch 'origin/windows-amd-vision' into windows-amd-vision
  • 886f322 Test: switching the AMD encoder mode (cpu to gpu) compiles the other encoder
  • baddd77 gitignore: the generated build-vision-vk.bat and build-vision-cpu.bat

📊 Changes

8 files changed (+258 additions, -53 deletions)

View changed files

📝 .gitignore (+2 -0)
📝 docs/AMD_HIP.md (+2 -2)
📝 setup.py (+109 -21)
📝 tools/strata_mcp.py (+0 -10)
📝 tools/test_setup_amd.py (+124 -6)
📝 tools/test_setup_choices.py (+3 -5)
📝 tools/test_strata_mcp.py (+6 -9)
📝 tools/vision/CMakeLists.txt (+12 -0)

📄 Description

Title

Windows AMD: image input on the CPU and on the GPU through Vulkan (tested on RX 9070 XT Nitro+)

Issue: N/A (AMD on Windows had no way to enable images)

Summary

AMD cards on Windows could not use images: setup refused --vision cpu, never asked the "Images?" question, and the ready-made HIP engine ships no strata-vision.exe. The encoder was also CUDA-only, so there was no GPU option on AMD. This PR lets AMD users on Windows (and Linux) choose no images, the CPU encoder, or a GPU encoder built with Vulkan, compiled locally once.

Tested on an RX 9070 XT Nitro+ (gfx1201), Windows, Ryzen 9 5900X, 80 GB RAM, Swift 1.5 IQ3_XXS, Visual Studio 2026 and the Vulkan SDK. Setup with --vision gpu compiled the encoder and the server started with images on. The model correctly read TS20 CP77 and QUADRA from a test picture. Text speed stayed at about 50 tok/s with a 70-76% expert-cache hit rate, with and without images. Unit tests pass (102 in test_setup_amd, test_setup_choices, test_strata_mcp).

What changed

  • setup.py
    • hip_vision() now accepts cpu on Windows and returns gpu for gpu/yes (Vulkan encoder) instead of refusing.
    • New win_hip_vision(): compiles the encoder once beside the ready-made AMD engine. If the Visual Studio C++ tools or the Vulkan SDK are missing it warns and continues with images off.
    • New build_vision_vulkan() and find_vulkan_sdk().
    • Windows AMD setup asks "Images?" (no / CPU / GPU through Vulkan).
    • build_engine_hip() dispatches to the CPU or Vulkan encoder build, and its readiness check compares the encoder mode so switching cpu to gpu rebuilds it.
    • The encoder builds call find_vcvars((13, 3)), because the Visual Studio version cap exists for CUDA and doesn't apply here. This lets Visual Studio 2026 work.
  • tools/vision/CMakeLists.txt: new STRATA_VISION_VULKAN option (builds ggml-vulkan).
  • tools/strata_mcp.py: removed the check that rejected --vision choices for the AMD backend.
  • tools/test_setup_amd.py, tools/test_setup_choices.py, tools/test_strata_mcp.py: updated and added tests.
  • docs/AMD_HIP.md: images are now supported on Windows AMD.
  • .gitignore: added the generated build-vision-vk.bat.

Extra Notes

  • Compiling needs the Visual Studio C++ tools, and for GPU vision the Vulkan SDK. The first build takes 10-20 minutes. --vision cpu needs no SDK.
  • Only tested on one machine. Not tested: Linux AMD with the Vulkan encoder, other Radeon cards, or a PC with an integrated GPU. On such a PC Vulkan may pick the wrong device, and GGML_VK_VISIBLE_DEVICES may help, but I haven't verified that.
  • The install tool in strata_mcp.py still rejects AMD on Windows. I left that out of this PR.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1768 **Author:** [@WeisTekEng](https://github.com/WeisTekEng) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `windows-amd-vision` --- ### 📝 Commits (8) - [`66df2af`](https://github.com/Niko1221/Strata/commit/66df2afc588303af7023e2c219641510c986df57) Windows AMD: image input on the CPU and on the GPU through Vulkan, tested on RX9070xt Nitro+ - [`7c110d8`](https://github.com/Niko1221/Strata/commit/7c110d8c4b9288dbbcbb1e044d79645c422ec0c5) Windows AMD vision: review fixes (AVX2 encoder build, cmake lookup, keep images on re-run) - [`4d282b2`](https://github.com/Niko1221/Strata/commit/4d282b23534790a0565c6ba58512db2261b555a8) Merge branch 'main' into windows-amd-vision - [`e0555d3`](https://github.com/Niko1221/Strata/commit/e0555d33488c22f0f20fa9be7d5fd0bf0933bde4) Merge branch 'main' into windows-amd-vision - [`4de6502`](https://github.com/Niko1221/Strata/commit/4de65027a6a4a9601ea7d8c54e3fa97aeb2eabfd) Merge branch 'main' into windows-amd-vision - [`4b7d090`](https://github.com/Niko1221/Strata/commit/4b7d09021eb8bea26ca7f18c5d9995e5dd0bc403) Merge remote-tracking branch 'origin/windows-amd-vision' into windows-amd-vision - [`886f322`](https://github.com/Niko1221/Strata/commit/886f3228a0d3754dd5c1c0b66c8619f46f0193b8) Test: switching the AMD encoder mode (cpu to gpu) compiles the other encoder - [`baddd77`](https://github.com/Niko1221/Strata/commit/baddd77cfd70eb62548e2e616153de55e114bdf1) gitignore: the generated build-vision-vk.bat and build-vision-cpu.bat ### 📊 Changes **8 files changed** (+258 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -0) 📝 `docs/AMD_HIP.md` (+2 -2) 📝 `setup.py` (+109 -21) 📝 `tools/strata_mcp.py` (+0 -10) 📝 `tools/test_setup_amd.py` (+124 -6) 📝 `tools/test_setup_choices.py` (+3 -5) 📝 `tools/test_strata_mcp.py` (+6 -9) 📝 `tools/vision/CMakeLists.txt` (+12 -0) </details> ### 📄 Description ## Title Windows AMD: image input on the CPU and on the GPU through Vulkan (tested on RX 9070 XT Nitro+) Issue: N/A (AMD on Windows had no way to enable images) ## Summary AMD cards on Windows could not use images: setup refused `--vision cpu`, never asked the "Images?" question, and the ready-made HIP engine ships no `strata-vision.exe`. The encoder was also CUDA-only, so there was no GPU option on AMD. This PR lets AMD users on Windows (and Linux) choose no images, the CPU encoder, or a GPU encoder built with Vulkan, compiled locally once. Tested on an RX 9070 XT Nitro+ (gfx1201), Windows, Ryzen 9 5900X, 80 GB RAM, Swift 1.5 IQ3_XXS, Visual Studio 2026 and the Vulkan SDK. Setup with `--vision gpu` compiled the encoder and the server started with images on. The model correctly read `TS20 CP77` and `QUADRA` from a test picture. Text speed stayed at about 50 tok/s with a 70-76% expert-cache hit rate, with and without images. Unit tests pass (102 in `test_setup_amd`, `test_setup_choices`, `test_strata_mcp`). ## What changed - `setup.py` - `hip_vision()` now accepts `cpu` on Windows and returns `gpu` for `gpu`/`yes` (Vulkan encoder) instead of refusing. - New `win_hip_vision()`: compiles the encoder once beside the ready-made AMD engine. If the Visual Studio C++ tools or the Vulkan SDK are missing it warns and continues with images off. - New `build_vision_vulkan()` and `find_vulkan_sdk()`. - Windows AMD setup asks "Images?" (no / CPU / GPU through Vulkan). - `build_engine_hip()` dispatches to the CPU or Vulkan encoder build, and its readiness check compares the encoder mode so switching cpu to gpu rebuilds it. - The encoder builds call `find_vcvars((13, 3))`, because the Visual Studio version cap exists for CUDA and doesn't apply here. This lets Visual Studio 2026 work. - `tools/vision/CMakeLists.txt`: new `STRATA_VISION_VULKAN` option (builds ggml-vulkan). - `tools/strata_mcp.py`: removed the check that rejected `--vision` choices for the AMD backend. - `tools/test_setup_amd.py`, `tools/test_setup_choices.py`, `tools/test_strata_mcp.py`: updated and added tests. - `docs/AMD_HIP.md`: images are now supported on Windows AMD. - `.gitignore`: added the generated `build-vision-vk.bat`. ## Extra Notes - Compiling needs the Visual Studio C++ tools, and for GPU vision the Vulkan SDK. The first build takes 10-20 minutes. `--vision cpu` needs no SDK. - Only tested on one machine. Not tested: Linux AMD with the Vulkan encoder, other Radeon cards, or a PC with an integrated GPU. On such a PC Vulkan may pick the wrong device, and `GGML_VK_VISIBLE_DEVICES` may help, but I haven't verified that. - The install tool in `strata_mcp.py` still rejects AMD on Windows. I left that out of this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:29:53 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3661
No description provided.