CUDA setup for EMAN2

Setup the environment for gpu-enabled particle picking

Setup CUDA and driver

Follow instructions closely, using package manager method

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

Installing EMAN2 on Ubuntu 16.04 X86_64

Install anaconda2 from their website.
Open a bash shell (at the moment activation and deactivation of conda environments does not work on cshell).
Install EMAN2 using conda in its own environment. At this time I used np113* version. The steps below are adapted and modified from the install guide.

mkdir src

cd src

git clone https://github.com/cryoem/eman2.git #download EMAN2 source

# install dependencies

conda remove cmake bzip2 expat jsoncpp ncurses #just to make sure cmake is not broken, will be reinstalled with cmake

conda create -n eman113 cmake=3.8 -c conda-forge

conda install -n eman113 eman-deps=”*”=”np113*” -c cryoem -c defaults -c conda-forge

source activate eman113

#compile and install EMAN2

cd build

cmake ../ # on linux, also add -DENABLE_OPTIMIZE_MACHINE=ON

make -j

 

Test to make sure compile went fine

make test

make test-verbose

Enabling GPU in Theano

Install these optional packages for better performance of neural net particle picker. These are used by Theano. (If the steps below fail, consult the Theano page)

source activate eman113

conda install mkl-service pygpu=0.6.5 nose sphinx pydot-ng

pip install pycuda

# currently the latest dev version of scikit-cuda is needed

pip install git+https://github.com/lebedov/scikit-cuda.git#egg=scikit-cuda

define LD_LIBRARY_PATH

vim ~/.bashrc

and add this line to the file

export LD_LIBRARY_PATH=”/usr/local/cuda/lib64″

create .theanorc file in the home directory

vim ~/.theanorc

and add these lines

[global]

device = gpu

floatX = float32
[cuda]

root=/usr/local/cuda/

#setting DEVICE to gpu instead of cuda, forces the use of pygpu instead of gpuarray,

Full functionality of theano (and successful testing of libgpuarray (pygpu) requires the installation of NCCL (network installer) and CUDNN. Download Deb packages from nvidia developer website and install:

sudo dpkg -i /data/reza/nvidia-machine-learning-repo-ubuntu1604_1.0.0-1_amd64 #this is the network installer

sudo dpkg -i libcudnn5_5.1.10-1+cuda8.0_amd64.deb         #stable theano version uses cudnn5.1

sudo dpkg -i libcudnn5-dev_5.1.10-1+cuda8.0_amd64.deb     #stable theano version uses cudnn 5.1

sudo apt-get update

sudo apt-get install libnccl-dev

Test the environment

#simple check to see everything is there

python -c “import theano”

Using cuDNN version 5100 on context None

Mapped name None to device cuda: Quadro M6000 (0000:82:00.0)

#full test of pygpu, you can “pip install mpi4py” to have the full test set done, but it is not required

DEVICE=”cuda” python -c “import pygpu; pygpu.test()”

Ran 7301 tests in 159.932s  

Use EMAN2

Note that you will need to run this once in each shell before being able to run EMAN2 commands:

source activate eman113

this will switch to the conda environment where all EMAN2 dependencies are configured.

Cold Room Times

dispatches from the walk-in fridge and the nearby bench