Installing Theano and configure the GPU
Hello,
Here is a memo to show how to install the theano deep learning package on the Hades remote machine or on local machine.
It’s very easy to use git to “clone” a copy of installation files onto the remote machine or on your own local machine.
But if you don’t have git installed on the remote machine or local machine, please first do:
$ sudo apt-get install git-all
If you already have git installed you can do the following to clone a copy of the theano package to your machine:
$ git clone https://github.com/Theano/Theano
This will download the theano package into your home directory
Then you can just install it by typing the commands:
Be careful, if your numpy,…ect are installed with anaconda python, you should make sure that your python command (interpreter) here is anaconda’s, and the anaconda should be installed with your user prililege not root. You can veryfy by typing from home:
$ ls -lr
to see if the anaconda direcory’s owner is you.
Then cd to the Theano directory to install:
$ cd ~/Theano
$ python setip.py develop
The installation should be fast and straightforward.
Then you should configure the Theano to make use of your GPU
You can just create a config file named .theanorc
to your home dir that is ~/.theanorc:
1
2
3
4
5
6
7
[cuda]
root = /usr/local/cuda-7.5
[global]
floatX = float32
device = gpu0
[nvcc]
fastmath = True
If you don’t like to create this config file you can also create a environment variable called $CUDA_ROOT
by
$ export CUDA_ROOT = /usr/local/cuda-7.5:$CUDA_ROOT
$ source ~/.bashrc
Then you can test by login to python interpreter
$ python
1
import theano
If the GPU is properly configured, there will be info about your GPU printed on the screen.