[PR #1792] [CLOSED] setup: find_vcvars() without CUDA asks vswhere for no version range (#881) #3676

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1792
Author: @Hugua700
Created: 10/10/2026
Status: ❌ Closed

Base: main ← Head: fix/find-vcvars-non-cuda


📝 Commits (1)

  • a88fc3f setup: find_vcvars() without CUDA asks vswhere for no version range (#881)

📊 Changes

1 file changed (+17 additions, -4 deletions)

View changed files

📝 setup.py (+17 -4)

📄 Description

#881's CPU image encoder cannot be built on a machine whose only C++ tools are Visual Studio 2026, because find_vcvars() returns None there.

[16.0,18.0) is CUDA 13's requirement (#985), and it was applied to every caller. #985 then added cuda_v to relax it for CUDA 13.3+ — correct for CUDA callers, but a non-CUDA caller still passes no cuda_v, so the range still applies and VS 2026 stays invisible. build_vision_cpu() calls find_vcvars() with no arguments, so on that machine it cannot build the encoder at all.

This is also a prerequisite for #1789's --vision cpu on Windows: that accepts a hand-built encoder, but building it still goes through find_vcvars().

The change (one function, one file):

  • cuda_v is None → ask vswhere for no version range. The CPU encoder is built by MSVC, which is happy with any version, and tools/hip/build_windows.bat already calls vswhere that way.
  • CUDA callers unchanged: cuda_v=(13, 0) still refuses VS 18, cuda_v=(13, 3) still takes it.
  • STRATA_VCVARS=<vcvars64.bat> picks an install by hand, for a vswhere that cannot be used (e.g. a range-matched install that is broken).

Measured on the machine of #881 (RX 6800M / gfx1031, Windows 11, Chinese locale, the only C++ tools are Visual Studio 2026 Build Tools 18.4.11605):

find_vcvars()               -> <VS 18>\VC\Auxiliary\Build\vcvars64.bat
find_vcvars(cuda_v=(13, 0)) -> None
find_vcvars(cuda_v=(13, 3)) -> <VS 18>\VC\Auxiliary\Build\vcvars64.bat

Not included here, deliberately:

  • the Windows plumbing itself (hip_vision()'s gate, placing the encoder beside the engine) — #1789 covers that, and covers it better;
  • shipping the encoder inside the ready-made zip, which would remove the toolchain requirement entirely. That is a release-policy decision: package_windows.py would carry a strata-vision.exe built with -DSTRATA_PORTABLE=ON (AVX2 baseline + static CRT, so it runs on other machines), the zip goes 120 → 122 MiB, BUILD.json records "vision": "cpu", and a build without an encoder packages exactly as before. Happy to file it if wanted.

🔄 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/1792 **Author:** [@Hugua700](https://github.com/Hugua700) **Created:** 10/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/find-vcvars-non-cuda` --- ### 📝 Commits (1) - [`a88fc3f`](https://github.com/Niko1221/Strata/commit/a88fc3fb8eb49d2aaa7876f64948f32365020cfb) setup: find_vcvars() without CUDA asks vswhere for no version range (#881) ### 📊 Changes **1 file changed** (+17 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `setup.py` (+17 -4) </details> ### 📄 Description #881's CPU image encoder cannot be built on a machine whose only C++ tools are Visual Studio 2026, because `find_vcvars()` returns `None` there. `[16.0,18.0)` is CUDA 13's requirement (#985), and it was applied to every caller. #985 then added `cuda_v` to relax it for CUDA 13.3+ — correct for CUDA callers, but a **non-CUDA** caller still passes no `cuda_v`, so the range still applies and VS 2026 stays invisible. `build_vision_cpu()` calls `find_vcvars()` with no arguments, so on that machine it cannot build the encoder at all. This is also a prerequisite for #1789's `--vision cpu` on Windows: that accepts a hand-built encoder, but building it still goes through `find_vcvars()`. **The change** (one function, one file): - `cuda_v is None` → ask vswhere for no version range. The CPU encoder is built by MSVC, which is happy with any version, and `tools/hip/build_windows.bat` already calls vswhere that way. - CUDA callers unchanged: `cuda_v=(13, 0)` still refuses VS 18, `cuda_v=(13, 3)` still takes it. - `STRATA_VCVARS=<vcvars64.bat>` picks an install by hand, for a vswhere that cannot be used (e.g. a range-matched install that is broken). **Measured** on the machine of #881 (RX 6800M / gfx1031, Windows 11, Chinese locale, the only C++ tools are Visual Studio 2026 Build Tools 18.4.11605): ``` find_vcvars() -> <VS 18>\VC\Auxiliary\Build\vcvars64.bat find_vcvars(cuda_v=(13, 0)) -> None find_vcvars(cuda_v=(13, 3)) -> <VS 18>\VC\Auxiliary\Build\vcvars64.bat ``` **Not included here**, deliberately: - the Windows plumbing itself (`hip_vision()`'s gate, placing the encoder beside the engine) — #1789 covers that, and covers it better; - shipping the encoder inside the ready-made zip, which would remove the toolchain requirement entirely. That is a release-policy decision: `package_windows.py` would carry a `strata-vision.exe` built with `-DSTRATA_PORTABLE=ON` (AVX2 baseline + static CRT, so it runs on other machines), the zip goes 120 → 122 MiB, `BUILD.json` records `"vision": "cpu"`, and a build without an encoder packages exactly as before. Happy to file it if wanted. --- <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:59 +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#3676
No description provided.