Setup Ubuntu 14.04 with Cuda and Lasagne

Apr 5, 2016

Installation of prerequisites

    # Install common stuff
    sudo apt-get install build-essential
    sudo apt-get install zsh git

    # Install SciPy dependencies
    sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran

    # Install pyenv
    curl -L | bash

    # Install python 3.5.0
    env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.5.0

    # Install cuda
    sudo dpkg -i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb
    sudo apt-get update
    sudo apt-get install cuda

    # Create theanorc
    echo "[global]" > ~/.theanorc
    echo "floatX = float32"
    echo "device = gpu"

Create pyenv and install lasagne

Choose a name you see fit. I picked “lasagne”.

    pyenv virtualenv 3.5.0 lasagne
    pyenv activate lasagne
    pip3 install --upgrade
    pip3 install --upgrade

Wrap up

Reboot your system so that the installed nvidia drivers will load


Prior to using python, activate the environment with

    pyenv activate lasagne