Unable to cross compile CUDA based code for Jetson Nano

Hi,

I am stuck at setting up cross compilation for Jetson Nano for quite some time now. I created a docker and installed Jetpack in it. I only installed the HOST components for Jetpack 4.2.1 (rev 2) for Jetson Nano (not dev version). We need to use an older Jetpack because of limitations of one of our drivers’ compatibility. I assumed the necessary tools would be installed. I could see /usr/local/cuda on docker (host) but not the cross compilation tools. So I went to Downloads for nvidia and manually installed using dpkg -i the following package: cuda-repo-cross-aarch64-10-0-local-10.0.326_1.0-1_all.deb. Is this enough? I noticed some cross compile includes and libs at /usr/local/cuda/targets/aarch64-linux on the docker (host). The nvcc is available at /usr/local/cuda/bin.

Please find attached the toolchain file I am usingtoolchain_file.txt (2.3 KB) . The toolchain is linaro 7.5, which I make known by exporting environment in shell in which build in run, using:
export CC=/home/user/Toolchain/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
export CXX=/home/user/Toolchain/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++
I also export the other required environmental variables like BASE_DIR via a script, before running cmake.

Now the error: I have some .cu files in the code and their corresponding object files cannot be generated. Cmake is successful, make fails. I get:
Error generating
<path_to_expected_object_cuda_file_inside_build_directory>/<filename>.cu.o

Please advise regarding this. I have followed discussion on other forums with similar issues, but it did not help unfortunately. Please note that cross compilation is successful if I do not use any CUDA-based code (like .cu files), i.e., if I don’t use cuda_add_library in the module-level CMake.