You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When cross-compiling CUDA-based projects for aarch64 platforms, Meson's built-in CUDA dependency dependency('cuda', modules: ['cudart'])
always provides the host link directory /usr/local/cuda/lib64 instead of the target architecture's /usr/local/cuda/targets/aarch64-linux/lib
To Reproduce
Any cross compiled project which uses dependency('cuda')
Expected behavior
dependency('cuda') should use the target's include and link dir when available.
--
Issues I noticed in the cuda dependency:
cuda dependency will always include the build machine libdir:
When the actual NVIDIA cross-compilation toolchain uses lib
( /usr/local/cuda/targets/aarch64-linux/lib)
This prevents setting CUDA_PATH=/usr/local/cuda/targets/aarch64-linux as a workaround.
The host machine target is totally ignored, and only the build machine lib dir is used.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
When cross-compiling CUDA-based projects for aarch64 platforms, Meson's built-in CUDA dependency
dependency('cuda', modules: ['cudart'])
always provides the host link directory
/usr/local/cuda/lib64
instead of the target architecture's/usr/local/cuda/targets/aarch64-linux/lib
To Reproduce
Any cross compiled project which uses
dependency('cuda')
Expected behavior
dependency('cuda')
should use the target's include and link dir when available.--
Issues I noticed in the cuda dependency:
meson/mesonbuild/dependencies/cuda.py
Lines 213 to 214 in 25854d7
meson/mesonbuild/dependencies/cuda.py
Line 226 in 25854d7
Arch should be looked up via the compilers "for_machine" entry instead.
lib64
is hardcoded.meson/mesonbuild/dependencies/cuda.py
Lines 222 to 223 in 25854d7
When the actual NVIDIA cross-compilation toolchain uses
lib
(
/usr/local/cuda/targets/aarch64-linux/lib
)This prevents setting
CUDA_PATH=/usr/local/cuda/targets/aarch64-linux
as a workaround.meson/mesonbuild/dependencies/cuda.py
Lines 59 to 60 in 25854d7
Approaches to fix the issue
With some guidance I'd be honored to make a PR, I have the following thoughts on how to solve the issues:
_detect_arch_libdir
should use "for_machine" entry instead ofdetect_cpu_family
.lib
(or make configurable ?)/usr/local/cuda/targets/{target_arch}-linux/
.--
system parameters
Ubuntu 18.04 x86_64
Python 3.8.0
1.8.0
1.11.1.git.kitware.jobserver-1
Thanks to @eli-schwartz for guidance on Matrix chat about this issue! 🙂
The text was updated successfully, but these errors were encountered: