1

I have an NVidia Jetson TK1 Development board (ARM Cortex A15) which has a Keplar GPU that supports CUDA. I want to do same image processing on it with OpenCV 3.0 using CUDA.

Reading through the NVidida docs, I came to know that CUDA can be installed only on supported linux distros.. The challenge is that I am not using the Ubuntu OS that came with it but a light weight embedded OS that I cross compiled with the Yocto Project. OpenCV is compiled and installed with CUDA support, but it is not able to use the GPUs.

But I know that it is possible because someone in a mailing list has done it before. Here is the conversation. All I need to do is put the right binaries in the right place.

The problem is that I don't know where to get the "precompiled drivers package from nvidia" for my architecture and where to put them. Any help would be appreciated.

1

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:

  1. Make sure your image has IMAGE_FEATURES += "package-management" included.
  2. In the local.conf, change PACKAGE_CLASSES to package_deb
  3. 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.