It is possible. And it is easy if you have apt and dpkg. In my case, I did not have both and had to install them. Skip to "Installing CUDA" if you already have apt.
You need to install apt install the CUDA binaries. You need to do the next two steps to make sure that your image has apt:
- Make sure your image has
IMAGE_FEATURES += "package-management"
included.
- In the local.conf, change
PACKAGE_CLASSES
to package_deb
- Add
gnupg
and apt
to CORE_IMAGE_EXTRA_INSTALL
Installing CUDA.
So all you have to do is to download the .deb file for the CUDA Toolkit for L4T either using a web browser on the device, or download on your PC then copy the file to your device using a USB flash stick or across the network. (Make sure you download the Toolkit for L4T and not the Toolkit for Ubuntu since that is for cross-compilation instead of native compilation).
You need to download the toolkit corresponding to the L4T version you have. For example, I run R21.4 and so I could download mine from here. On this page you will find the binaries for the latest version.
Now Install the CUDA repo metadata that you downloaded manually for L4T
sudo dpkg -i cuda-repo-l4t-<version-you-downloaded>_armhf.deb
Download & install the actual CUDA Toolkit including the OpenGL toolkit from NVIDIA. It only downloads around 15MB. In the second command below, install "cuda-toolkit-6-0" if you downloaded CUDA 6.0, or "cuda-toolkit-6-5" if you downloaded CUDA 6.5, etc.
sudo apt-get update
sudo apt-get install cuda-toolkit-x-x
Add yourself to the "video" group to allow access to the GPU
sudo usermod -a -G video $USER
Add the 32-bit CUDA paths to your .bashrc login script, and start using it in your current console:
echo "# Add CUDA bin & library paths:" >> ~/.bashrc
echo "export PATH=/usr/local/cuda/bin:$PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH" >> ~/.bashrc
source ~/.bashrc
Finally verify that the CUDA Toolkit is installed on your device:
nvcc -V
And voila, you are done!
Source