Fix exec platform auto-detection for cross-compilation#476
Open
lewissettercaci wants to merge 1 commit into
Open
Fix exec platform auto-detection for cross-compilation#476lewissettercaci wants to merge 1 commit into
lewissettercaci wants to merge 1 commit into
Conversation
When cross-compiling (e.g., building for linux-aarch64 from linux-x86_64), exec tools like nvcc and cicc should run on the build host platform, not the target platform. The previous constraint-based auto-detection could incorrectly select the target platform's tools in some scenarios. This fix adds explicit host platform detection at repository instantiation time, using the detected host platform as the default for exec components. This ensures that when building with --platforms=linux-aarch64 on an x86_64 host, the x86_64 CUDA tools are selected, not the ARM64 tools. Priority order for exec platform selection: 1. Explicit --@rules_cuda//cuda:exec_platform flag (user override) 2. Detected host platform (works for local builds & cross-compilation) 3. Constraint-based auto-detection (fallback for RBE scenarios)
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.
When cross-compiling (e.g., building for linux-aarch64 from linux-x86_64), exec tools like cicc should run on the build host platform, not the target platform. The previous constraint-based auto-detection could incorrectly select the target platform's tools in some scenarios.
This fix adds explicit host platform detection at repository instantiation time, using the detected host platform as the default for exec components. This ensures that when building with --platforms=linux-aarch64 on an x86_64 host, the x86_64 CUDA tools are selected, not the ARM64 tools.
Priority order for exec platform selection: