Fall back to the CUDA_PATH toolkit when the preferred CUDA version is not installed#6360
Merged
Conversation
… not installed Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Grantim
approved these changes
Jul 3, 2026
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.
platform.propshard-selects the CUDA version per platform toolset (v142 → 11.4, v143 → 12.0, v145 → 13.2). If a user doesn't have exactly that version, the build fails with MSB4019 on theCUDA $(MRCudaVersion).propsimport even when a perfectly usable newer toolkit is installed.This PR adds an evaluation-time fallback: when the selected version's MSBuild integration is absent from the running Visual Studio,
MRCudaVersionis re-pointed to the toolkit referenced by theCUDA_PATHenvironment variable (the NVIDIA installer keeps it at the latest installed version), provided that version's VS integration is present. So a machine with only CUDA 13.3 installed now builds with 13.3 instead of erroring.Details:
Exists()), which is required because the CUDA props import itself happens during evaluation — a target-based detection would run too late.MRCudaGencode(Build MSBuild CUDA for the same GPU architectures as CMake #6359) picks up the fallback version automatically via its version-range conditions, e.g. a 13.x fallback gets the75/86/89/120architecture set.CUDA_PATHversion has its integration installed (orCUDA_PATHis unset), the behavior is exactly as before: MSB4019 naming the missing props file.MRCudaVersionempty): theCUDA_PATHversion is used if its integration is installed.Verified locally: with the mapped version present the selection is unchanged (12.0 for v143); with the mapping temporarily pointed at a non-installed 12.9 and
CUDA_PATH=v13.2, evaluation selects 13.2 and MRCuda compiles end-to-end with the CUDA 13 architecture set; withCUDA_PATHpointing at a toolkit without VS integration (or unset), the original MSB4019 remains.🤖 Generated with Claude Code