I have a cross-compilation environment setup on my x64 Linux PC that compiles to aarch64 (Xavier).
My project is a CMAKE project that uses the built-in CUDA language support.
My toolchain file provides, among other things, CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
and the architecture aarch64. using `project(myproj LANGUAGES C CXX CUDA) results in CMake implicitly including the correct libraries and include files.
This results in CMake adding -I/usr/local/cuda/targets/aarch64-linux/include
to the aarc64-linux-gnu-gcc compiler command line, which would normally be the right thing to do - my understanding is that all of the CUDA include files should be there, after installing the JetPack.
I recently wanted to add cuda_egl_interop.h
to my project, and it complains that cudart_platform.h
, included by cuda_egl_interop.h
is missing. Sure enough, when I compare the headers under /usr/local/cuda/targets/aarch64-linux/include
to a rootfs I lifted from the actual Xavier, some differences emerge using diff
:
Only in rootfs/usr/local/cuda-10.0/targets/aarch64-linux/include/: cudart_platform.h
Only in rootfs/usr/local/cuda-10.0/targets/aarch64-linux/include/: nvgraph.h
Only in rootfs/usr/local/cuda-10.0/targets/aarch64-linux/include/: nvml.h
Only in rootfs/usr/local/cuda-10.0/targets/aarch64-linux/include/: nvrtc.h
Only in rootfs/usr/local/cuda-10.0/targets/aarch64-linux/include/: nvToolsExtCuda.h
Only in rootfs/usr/local/cuda-10.0/targets/aarch64-linux/include/: nvToolsExtCudaRt.h
Only in rootfs/usr/local/cuda-10.0/targets/aarch64-linux/include/: nvToolsExt.h
Only in rootfs/usr/local/cuda-10.0/targets/aarch64-linux/include/: nvToolsExtMeta.h
Only in rootfs/usr/local/cuda-10.0/targets/aarch64-linux/include/: nvToolsExtSync.h
Only in rootfs/usr/local/cuda-10.0/targets/aarch64-linux/include/: nvtx3
Is this an error in the sdkmanager
, whereby these include files for aarch64 cross-compilation aren’t getting installed but should have been? If so what would be the safest way of going about fixing it?
Alternatively, is there a way for me to tell CMake to get the lib and include files from an alternate location (i.e. the rootfs copy I lifted), USING THE BUILT-IN LANGUAGE FUNCTION (as opposed to FindCUDA.cmake). Admittedly, this may be more of a question for the CMake team, I may take it up with them as documentation is rather spotty.