Cross Compilation using WSL2 for Jetson Nano

Hi,

I am trying to cross compile a simple helloWorld.cu file on WSL2 (Ubuntu 18.04). I intend to run the executable on Nvidia Jetson Nano 2GB board. Please provide some insight.

Hi,

You will need to have a cross compile toolchain for ARM and add the GPU architecture=sm_53 for Nano.

Below is a sharing from our user for your reference:

Thanks.

1 Like

Hi,
Can you share complete process to cross compile toolchain for ARM. I referred the pdf in the link shared but ran into trouble while cross compiling on WSL with Distro Ubuntu18.04

Hi,

Below is a tutorial but he use docker and armv7.
For Nano, you will need to compile it for aarch64

If the tutorial is not working on your environment, please check with WSL team to see if they can support cross-compile an ARM binary first.

Thanks.

Hi AastaLLL,
Thanks for sharing the link. I was able to get that to working in my environment. However, I still ran into issues while trying to cross compile on X86 for Jetson. I could not compile the mxnet part. If you can share some thoughts, it would be really helpful

Also, after setting the environment variables as described in the ppt document, when I try to compile helloworld.cu file, I get below error:
$NVCC Chkhello.cu -m64 --gpu-architecture=sm_53 -target-dir aarch64-linux -o Nanohello
/lib/ld-linux-aarch64.so.1: No such file or directory

Hi,

If you are using MXNet, you need to copy the library (for aarch64) back to X86 for compiling.

More, some extra configure is required for the cross-compile with nvcc directly:
https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#cross-compilation

Thanks.