cuda: use target-specific paths under CUDA Toolkit on Linux #14612
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.
fix #14595
This PR updates the cuda dependency to use target-specific include and library paths, such as
/usr/local/cuda/targets/aarch64-linux/lib
and/usr/local/cuda/targets/aarch64-linux/include
, instead of defaulting to the host's/usr/local/cuda/lib64
.When cross-compiling, Meson currently:
lib64
for aarch64, even though NVIDIA's toolchain useslib
under the target-specific path.targets/<arch>-<os>
layout entirely, making it impossible to useCUDA_PATH=/usr/local/cuda/targets/aarch64-linux
as a workaround.This causes incorrect link paths and build failures when targeting non-x86_64 platforms.
Fix:
for_machine
to determine the target architecture, not the host.This fix only applies to Linux.
Tested with jetpack cuda 12.6 & jetpack cuda 10.2
I cannot test it on Windows or other.
Todo: