Auto detect cuda in install script #15027
Merged
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.
This pull request simplifies the process for building ExecuTorch with CUDA support by removing the requirement to set the
CMAKE_ARGSenvironment variable. Now, CUDA support is automatically detected and handled during installation, streamlining both CI workflows and installation logic. Additionally, related documentation and error messages have been updated for clarity.CI/CD and Installation Process Simplification
CMAKE_ARGS="-DEXECUTORCH_BUILD_CUDA=ON"in CI scripts and workflow files;install_executorch.shnow handles CUDA detection automatically. (.ci/scripts/test-cuda-build.sh,.github/workflows/cuda.yml) [1] [2] [3] [4] [5]_is_cuda_enabled()function frominstall_utils.pyand refactored logic to rely solely on CUDA detection vianvcc. [1] [2] [3]Error Handling and Messaging Improvements
install_utils.pyto remove references to "CUDA delegate" and clarify instructions for users when CUDA is not detected or supported.Internal Refactoring
functools.lru_cacheto_get_cuda_version()for more efficient repeated CUDA version detection.These changes make the CUDA build process more user-friendly and reduce the risk of misconfiguration.