Site icon JetsonHacks

Torch 7 Scientific Computer Framework with cuDNN – NVIDIA Jetson TK1

Installing Torch 7 with cuDNN on the Jetson TK1 Dev Kit.

Installing Torch with cuDNN on the Jetson TK1 Dev Kit.

The Torch scientific computing framework is an easy to use and efficient platform with wide support for machine learning algorithms. The underlying C/CUDA implementation is accessed through a fast scripting language called LuaJIT. Installation on the Jetson TK1 is straightforward. We also add extensions for cuDNN support. Looky here:
https://youtu.be/J9WM1yUsbyI

Introduction

The Torch website lists all the good bits about why people should use Torch. There are a wide variety of applications that can be built using Torch. From the website:

Torch comes with a large ecosystem of community-driven packages in machine learning, computer vision, signal processing, parallel processing, image, video, audio and networking among others, and builds on top of the Lua community.

At the heart of Torch are the popular neural network and optimization libraries which are simple to use, while having maximum flexibility in implementing complex neural network topologies. You can build arbitrary graphs of neural networks, and parallelize them over CPUs and GPUs in an efficient manner.

The reason that you should pay attention to Torch is that it is being used by a lot of the big players in the deep learning/machine learning space, including such familiar names as Facebook, Google and Twitter.

Torch 7 Installation

Installation is straightforward. The entire installation takes about an hour. There is a script that was used for the basis of the video https://github.com/torch/ezinstall. There were some issues with permissions during installation, so I just manually entered the two installation scripts.

$ git clone https://github.com/torch/ezinstall.git
$ cd ezinstall
$ sudo ./install-deps
$ sudo ./install-luajit+torch

If you want to install the NVIDIA® cuDNN – GPU Accelerated Deep Learning extension for Torch 7, you must go to the NVIDIA site and download the library. Note: You must be a CUDA Registered Developer (it’s free to sign up) in order to download the cuDNN library. The current version is V2. Download the extension, and switch to that directory, i.e. $

cd ~/Downloads

Here’s a script to install it:

You can then switch back to your Home directory.
Once the cuDNN library is installed, you can then install the Torch extensions for cuDNN:

$ sudo luarocks install cutorch
$ sudo luarocks install cunn
$ sudo luarocks install cudnn

FYI, luarocks install cudnn will install Torch bindings (written by Soumith, https://github.com/soumith/cudnn.torch) for cuDNN library.

Notes

Torch 7 tends to use a lot of memory. If you use Torch, you will probably need to have a swap file set up. You can refresh your memory on how to do that here on another blog entry on JetsonHacks.

This installation installs Torch 7 on a NVIDIA Jetson TK1 running Linux for Tegra (L4T) 21.3 with CUDA 6.5. The installation was done over a fresh install using JetPack 1.1. For more information about doing a fresh install, see this blog entry on JetsonHacks.

Exit mobile version
Skip to toolbar