NVIDIA Jetson TK1 – Install CUDA 6.5 – [L4T 21.1]

Install CUDA 6.5 on a freshly flashed Linux for Tegra (L4T) 21.1. Also, the samples from the CUDA package are built, and a few of the graphics demos are shown. Before starting your own install, you should be familiar with NVIDIA CUDA Getting Started Guide for Linux

Looky here:

Here’s the important bits:

First, you have to have L4T 21.1 installed on your Jetson, earlier releases do not work. This means that you have to flash your Jetson with that release. See Jetson TK1 Linux for Tegra (L4T) 21.1 Install for directions on how to do that.

Second, if you want to build samples you probably do not want to be a super user as shown in the video specifying ‘ ~/ ‘ as the directory where you unpack. The issue is that this is actually /root/ and you will not be able to access this as a normal user. Instead, you should simply open up a new terminal and unpack the samples there. However, if you run the provided script with sudo, i.e.

$ sudo ./installCUDA65.sh

you should be fine.

Third, here’s the scripts:

installCUDA65.sh


#!/bin/sh
# Fresh install for CUDA 6.5 on Jetson TK1 for Linux for Tegra (L4T) 21.1
# CUDA 6.5 REQUIRES L4T 21.1 !!!
sudo apt-add-repository universe
sudo apt-get update
# This is for L4T r21.1 ; Update for your L4T i.e. r21.3
wget http://developer.download.nvidia.com/compute/cuda/6_5/rel/installers/cuda-repo-l4t-r21.1-6-5-prod_6.5-14_armhf.deb
# Install the CUDA repo metadata that you downloaded
# This is for L4T 21.1 ; Update for your L4T i.e. 21.3
sudo dpkg -i cuda-repo-l4t-r21.1-6-5-prod_6.5-14_armhf.deb
# Download & install the actual CUDA Toolkit including the OpenGL toolkit from NVIDIA.
sudo apt-get update
sudo apt-get install cuda-toolkit-6-5 -y
# 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-6.5/bin:$PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib:$LD_LIBRARY_PATH" >> ~/.bashrc
source ~/.bashrc
# Build Samples (optional)
# cd /usr/local/cuda-6.5/bin
# ./cuda-install-samples-6.5.sh ~/
# Switch to CUDA directory in ~/
# make

maxCPU.sh


#!/bin/sh
# Set CPU to full performance on NVIDIA Jetson TK1 Development Kit
if [ $(id -u) != 0 ]; then
echo "This script requires root permissions"
echo "$ sudo "$0""
exit
fi
# To obtain full performance on the CPU (eg: for performance measurements or benchmarking or when you don't care about power draw), you can disable CPU scaling and force the 4 main CPU cores to always run at max performance until reboot:
echo 0 > /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable
echo 1 > /sys/devices/system/cpu/cpu0/online
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
echo 1 > /sys/devices/system/cpu/cpu3/online
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

view raw

maxCPU.sh

hosted with ❤ by GitHub

I’ve noticed that when using the Jetson as a desktop environment, the desktop is much more stable after running the maxCPU.sh script which enables full performance from the CPU. This is especially true when downloading large files and compiling large projects. I’ve included it here for easy access.

If you save the above example shell files, make sure that you change the file permissions to ‘Allow executing file as program’. You can do this by right clicking on the file and navigating using Properties->Permissions and then checking the ‘Allow executing file as program’. Close the dialog.

Making the samples is optional, of course. By default, the script does not build the samples. You may edit installCUDA65.sh to uncomment the appropriate lines in Build Samples and make them all. You will probably want to place the samples into another directory other than ~/, but I will leave that to you.

Enjoy!

1 Trackback / Pingback

  1. NVIDIA Jetson TK1 - Install OpenCV - [L4T 21.1] - NVIDIA Jetson TK1 Dev

Leave a Reply

Your email address will not be published.


*