Cross-compiling CUDA for an ARMv7-based Tegra K1 Android device is now possible according to the latest CUDA toolkit documentation. Deploying that compiled binary as part of an Android application is where I am struggling. These are the steps I have followed so far:
Installed CUDA 8.0 toolkit through the Apt package manager which installs a version of Nsight (Eclipse configured for CUDA development) in my /usr/local/cuda/libnsight directory.
Installed the ARMv7 cross compiler through the Apt package manager. I have verified that the cross compiler works by importing a sample CUDA project into Nsight and building using the cross-compiler. It builds and links successfully – of course I can’t run it on my workstation.
Installed Codeworks for Android 1R5. This process installs things in the /home/NVPACK/ directory. I now have another “flavour” of Eclipse located in this directory (Eclipse configured for Android App deployment). I have verified I can build and deploy a native Android application to my connected Android device by importing a sample and deploying to the device.
Now I’m stuck…
I have my own CUDA code that a want to build into a native App which I want to then run on my Android device. How do I set up the Android version of eclipse to build an APK from my CUDA code and my native app code? Is it even possible or do I need to build the CUDA library first and link it in? If so how do I tell Nsight eclipse to build the CUDA code as a library and what run-time libraries do I need to include?