Whu can not I cross compile .cu file?

When I cross compile a .cu file,the system give the following error information:
root@ubuntu:/usr/local/cuda-9.0/samples/0_Simple/vectorAdd# make
/usr/local/cuda-9.0/bin/nvcc -ccbin aarch64-linux-gnu-g++ -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -o vectorAdd vectorAdd.o
/usr/lib/gcc-cross/aarch64-linux-gnu/5/…/…/…/…/aarch64-linux-gnu/bin/ld: vectorAdd.o: Relocations in generic ELF (EM: 62)
/usr/lib/gcc-cross/aarch64-linux-gnu/5/…/…/…/…/aarch64-linux-gnu/bin/ld: vectorAdd.o: Relocations in generic ELF (EM: 62)
/usr/lib/gcc-cross/aarch64-linux-gnu/5/…/…/…/…/aarch64-linux-gnu/bin/ld: vectorAdd.o: Relocations in generic ELF (EM: 62)
/usr/lib/gcc-cross/aarch64-linux-gnu/5/…/…/…/…/aarch64-linux-gnu/bin/ld: vectorAdd.o: Relocations in generic ELF (EM: 62)
/usr/lib/gcc-cross/aarch64-linux-gnu/5/…/…/…/…/aarch64-linux-gnu/bin/ld: vectorAdd.o: Relocations in generic ELF (EM: 62)
vectorAdd.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Makefile:281: recipe for target ‘vectorAdd’ failed
make: *** [vectorAdd] Error 1

Hi Ge-Baoshan,

Maybe you can refer to https://devtalk.nvidia.com/default/topic/978541 and try with nsight first.

Hi,vickyy
https://devtalk.nvidia.com/default/topic/978541 'problem is different from mine. I run into cross-compiling .cu file. Cross-compile, not other problem.

Hi,

You can use JetPack-Compile CUDA Samples options to automatically compile CUDA sample.

If you want to compile it manually, please remember to add the target information in the command:

EXTRA_LDFLAGS=--unresolved-symbols=ignore-in-shared-libs TARGET_ARCH=aarch64 make

Thanks.