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
NOTE: in the default platform, which is x86_64(k8) toolchain , the compile and linking works.
I wonder if it's a bug or just a misconfiguration during usage of this repo?
simply compile the basic example with cu_library and report the following errors. NOTE: in the default platform, which is x86_64(k8) toolchain , the compile works.
skipping incompatible bazel-out/aarch64-dbg/bin/_solib_aarch64-buildroot-linux-gnu/_U@@local_Ucuda_S_S_Clibcudart.so.11.0___Ucuda_Slib64/libcudart.so.11.0 when searching for -l:libcudart.so.11.0
which means the cuda libraries is still the lib64 version in usr/local/cuda/lib64.
actually the cuda libraries may be installed in other dirs and may consist multiple arch version. especially in nvidia AGX machines.
CUDA: Should be installed at /usr/local, CUDA for various platforms should be in the target directory of /usr/local/cuda-X
e.g. aarch64-linux CUDA 10.1 should be located at /usr/local/cuda-10.1/targets/aarch64-linux
CUDA-X DL Libs (i.e. TensorRT and cuDNN): Should be located at /usr/local/cuda-X/dl/targets/<PLATFORM>/{include, lib}
Other system dependencies: Dependencies should be located in /usr/local/{include, lib} for x86_64, /usr/aarch64-linux-gnu/ for aarch64-linux and /usr/aarch64-unknown-nto-qnx/aarch64le for aarch64-qnx
there is an old version of cuda toolchain config which supports multiplatform_cpu compile in bazel, but the CROSSTOOL is outdated and not available in the latest version of bazel.
rules_cuda_dependencies(toolkit_path)
Populate the dependencies for rules_cuda. This will setup workspace dependencies (other bazel rules) and local toolchains.
Name Description Default Value
toolkit_path Optionally specify the path to CUDA toolkit. If not specified, it will be detected automatically.
Is there an example to show how to use it correctly?
I think you are configuring it correctly. The root problem is the cross compiling is not addressed in this rule at the moment. So exec_compatible_with for tools and target_compatible_with for runtime are assumed to be the same, but they are not enforced so it is workaroundable.
I think you are configuring it correctly. The root problem is the cross compiling is not addressed in this rule at the moment.
OK, I will keep the issue open.
ZhenshengLee
changed the title
[BUG] linking failed using custom cc_toolchain with platform_cpu, cannot detect multiplatform cuda library,
[BUG] linking failed using custom cc_toolchain with platform_cpu, cannot detect multiplatform cuda library.
Aug 27, 2024
brief
NOTE: in the default platform, which is x86_64(k8) toolchain , the compile and linking works.
I wonder if it's a bug or just a misconfiguration during usage of this repo?
environment
bazel: version7.0.2
cctoolchain: //bazel/toolchains/v5l (a custom cc toolchain for cross compile in aarch64, like https://github.com/f0rmiga/gcc-toolchain/blob/main/toolchain/cc_toolchain_config.bzl)
repro steps
simply compile the basic example with cu_library and report the following errors.
NOTE: in the default platform, which is x86_64(k8) toolchain , the compile works.
considerations
skipping incompatible bazel-out/aarch64-dbg/bin/_solib_aarch64-buildroot-linux-gnu/_U@@local_Ucuda_S_S_Clibcudart.so.11.0___Ucuda_Slib64/libcudart.so.11.0 when searching for -l:libcudart.so.11.0
which means the cuda libraries is still the lib64 version in
usr/local/cuda/lib64
.actually the cuda libraries may be installed in other dirs and may consist multiple arch version. especially in nvidia AGX machines.
https://github.com/NVIDIA/DL4AGX/blob/9a4f60c2847d32e81372b9a2165299a3b65eabf1/CONTRIBUTING.md?plain=1#L201-L205
related info
there is an old version of cuda toolchain config which supports multiplatform_cpu compile in bazel, but the CROSSTOOL is outdated and not available in the latest version of bazel.
https://github.com/NVIDIA/DL4AGX/tree/master
EDIT: there already has an issue talking about resolving multiple version of cuda libraries, but I don't think the issue resolved by design #113
workaround(works)
add the library path manually should compile the binary successfully.
The text was updated successfully, but these errors were encountered: