Repository navigation
fix(build): give nvcc the build's own MSVC as host compiler on Windows - #2298
Merged
Merged
Conversation
#2298) * fix(build): give nvcc the build's own MSVC as host compiler on Windows The required Windows MSVC+CUDA job failed on master 4bbbc1f: every std::numbers::pi in ciede_device.h was "name followed by :: must be a class or namespace name", after "The contents of <numbers> are available only with C++20 or later", although nvcc ran with --std c++20. Meson built C and C++ with cl 19.51 (the developer environment's 14.51 toolset), but the Windows block gave nvcc -ccbin the first cl.exe of a recursive walk of the latest Visual Studio install: the v142 toolset 14.29 that Visual Studio 2026 carries beside its own, with its 14.29 headers. Every .cu host half was compiled against another STL than the objects it links with, and that STL does not expose <numbers> in nvcc's host passes. nvcc now takes the build's cl.exe when the build compiles C++ with MSVC, otherwise the newest toolset of the latest install by version, otherwise cl on PATH. test_windows_cuda_compiler_discovery.py gains three cases that fail on master; building-on-windows.md states the order.
lusoris
force-pushed
the
fix/nvcc-ccbin-build-msvc
branch
from
October 6, 2026 16:34
11f84cd to
41aaf8b
Compare
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.
Summary
The required
Windows MSVC+CUDAjob failed on master because nvcc compiled the host side of the CUDA kernels with a different, older MSVC toolset than the rest of the build. On master4bbbc1faa(run 37475182695, job 112308637968)Build libvmaf (CUDA)stopped atciede_device.h(161): error: name followed by "::" must be a class or namespace nameon everystd::numbers::pi, afterThe contents of <numbers> are available only with C++20 or later., although nvcc ran with--std c++20. nvcc now uses the build's owncl.exe.Evidence from that job's log:
cl (msvc 19.51.36260), the developer environment's toolset (VCToolsInstallDir ...\MSVC\14.51.36231\).Found MSVC cl.exe at: ...\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exeandMSVC include: .../14.29.30133/include: the firstcl.exeofGet-ChildItem -Recurse ... | Select-Object -First 1, the v142 toolset Visual Studio 2026 carries beside its own.<numbers>in nvcc's host passes;std::numbers::pienteredciede_device.hwith refactor(cuda): bring the CUDA kernels and their headers to the lint and HISS standard (ADR-1142) #2109. Every.cuhost half was also compiled against another STL than the objects it links with.Fix in the Windows block of
core/src/meson.build(ported from the unmerged Netflix PR #1472, ADR-0150; upstream master has no such block): nvcc's-ccbinis the build'scl.exewhencxxis MSVC; otherwise the newest toolset under the latestvswhereinstall, sorted by[version]; otherwiseclonPATH. MSVC header discovery follows the chosen compiler as before.Type
fix— bug fixChecklist
make format && make lintis green locally — the commit hooks pass (black, HISS audit, generated-docs freshness).python3 core/test/test_windows_cuda_compiler_discovery.py→ 7 OK;meson setupof a Linux CUDA build configures and runs the test throughrun_meson_test.py(1 OK)./cross-backend-diffand the worst ULP is ≤ 2. — not applicable: build configuration only; no kernel or flag changes, Linux builds take the same path as before..c/.cpp/.cu/.h/.hpp, it has the appropriate license header (seeCONTRIBUTING.md). — not applicable: no native file.!orBREAKING CHANGE:and the migration path is documented below. — not a breaking change.docs/adr/_index_fragments/<NNNN-slug>.md— not applicable: bug fix under ADR-0150.Bug-status hygiene (ADR-0165)
docs/state.mdupdated — opened and closed row T-WINDOWS-NVCC-CCBIN-OLDEST-TOOLSET-2026-10-06.Netflix golden-data gate (ADR-0024)
assertAlmostEqual(...)score in the Netflix golden Python tests.Deep-dive deliverables (ADR-0108)
std::numbers::piwith a literal inciede_device.hwould hide the mixed toolsets and bring back themodernize-use-std-numbersfinding refactor(cuda): bring the CUDA kernels and their headers to the lint and HISS standard (ADR-1142) #2109 removed; pinning a toolset version in the workflow would break with the next runner image. Using the build's own compiler is the invariant every other host object already follows.AGENTS.mdinvariant note —core/src/AGENTS.d/build-and-compiler.md"Windows CUDA compiler discovery" (index regenerated).changelog.d/fixed/windows-nvcc-ccbin-build-msvc.md.docs/rebase-notes.md"nvcc on Windows uses the build's MSVC".User documentation:
docs/getting-started/building-on-windows.md"Native MSVC and CUDA" lists the order.Reproducer
python3 core/test/test_windows_cuda_compiler_discovery.py -v # hosted: Builds workflow, job "Windows MSVC+CUDA" ("nvcc host compiler: the build MSVC at ...")Gates shown failing on planted defects
test_build_msvc_is_the_nvcc_host_compilertest_build_msvc_comes_from_the_cpp_compilercxxderivationtest_search_takes_the_newest_toolset-Recurse -Filter cl.exeKnown follow-ups
Windows MSVC+CUDAon this branch (workflow dispatch if the PR run is plan-skipped).