Ubuntu Installation

Austin Thresher edited this page Jul 7, 2017 · 13 revisions

This page provides instructions for installing PetaVision on Ubuntu 16.04, beginning with a clean installation of Ubuntu. You will need administrator privileges to run sudo.

Required packages

sudo apt-get install build-essential 
sudo apt-get install flex
sudo apt-get install bison 
sudo apt-get install cmake 
sudo apt-get install cmake-curses-gui
sudo apt-get install gcc 
sudo apt-get install g++ 
sudo apt-get install git 

Optional (but strongly suggested) packages

# Open MPI for parallelism in OpenPV
sudo apt-get install libopenmpi-dev openmpi-bin 

# lua for writing more complex parameter files
sudo apt-get install lua5.2 

# Octave (For reading OpenPV data files)
sudo apt-get install octave octave-image 
echo pkg load all >> ~/.octaverc # loads octave image package etc. when starting octave.

# Tools for drawing network diagrams from parameter files
sudo apt-get install npm nodejs-legacy # Needed by tool for drawing diagrams of params files.
sudo npm install -g phantomjs     # Needed by tool for drawing diagrams of params files.
sudo npm install -g mermaid@7.0.0 Needed by tool for drawing diagrams of params files.

Note: as of this writing (July 2017), the most recent version of mermaid, 7.0.3, has a bug in drawing arrowheads. Accordingly, be sure to specify the version 7.0.0.

CUDA and NVIDIA Driver (Optional)

Our GPU acceleration depends on CUDA. While it is possible to build and run PetaVision without CUDA, performance will not be nearly as good.

To download CUDA, go to https://developer.nvidia.com/cuda-downloads. Click the RUN file for your architecture and your version of Ubuntu. Note the location.

The version of the NVIDIA driver installed by CUDA may be behind the most recent driver version released by NVIDIA. If you want to use a more recent driver, you will need to install CUDA first, along with the driver that CUDA installs, and then upgrade the NVIDIA driver.
If you want to use the most recent NVIDIA driver, go to http://www.nvidia.com/Download/index.aspx?lang=en-us and select your video card. Download the linux RUN file. Note the location.

NVIDIA drivers cannot be installed while the X window system is running. Here's how to install the drivers.

Enter a virtual console (usually by pressing control-alt-F1 or control-alt-fn-F1). Log into an account with admin privileges.

sudo service lightdm stop
chmod u+x path/to/cuda.run
sudo path/to/cuda.run

Follow the onscreen instructions. We have seen the warning "The distribution-provided pre-install script failed!" but it does not seem to cause problems if you continue.

When it asks if you want to install NVIDIA driver, select yes. Add a symbolic link to /usr/local/cuda when asked.

If you now want to upgrade the NVIDIA driver to a version downloaded above.

cd path/to/driver.run
chmod u+x path/to/driver.run
./path/to/driver.run

Follow the instructions on the screen. When asked to uninstall the existing driver (installed by cuda), select yes. When asked to update your Xorg, select yes. This will use this driver as your GUI display.

Reboot.

Run nvidia-smi and make sure you see your video card.

cuDNN

It is recommended to download the cuDNN Deep Neural Network Library, which provides additional speed-up in computing the convolutions we use to compute input to post-synaptic layers.

To download cuDNN, go to https://developer.nvidia.com/cuDNN and click Download. If you haven't already registered with NVIDIA Developer you will need to do so, and then wait for email confirmation. Once registered, log into NVIDIA Developer and download the cuDNN Library for Linux. (Alternatively, if you have access to NMC's compneuro, grab it from /nh/compneuro/Data/cuDNN)

Unpack the .tgz file with the command

tar -xzf /path/to/downloaded/file -C /path/to/desired/cudnn/location

If you omit the -C /path/to/desired/cudnn/location option, tar will expand into the current working directory. This command will create a directory /path/to/desired/cudnn/location/cuda; when running cmake or ccmake (see below), you will need to set CUDNN_PATH to the full path to this directory.

Checking Out and Installing OpenPV

To build OpenPV and run the system tests, please see this page.

Optional: Anaconda Python

Ubuntu comes with python 2.7. We suggest installing Anaconda Python for analysis tools.