Once that is done, the only thing left is to change the ``device`` option to name the GPU device in your
Once that is done, the only thing left is to change the ``device`` option to name the GPU device in your
computer.
computer.
For example: ``THEANO_FLAGS='cuda.root=/path/to/cuda/root,device=gpu0'``.
For example: ``THEANO_FLAGS='cuda.root=/path/to/cuda/root,device=gpu'``.
You can also set the device option in the .theanorc file's ``[global]`` section. If
You can also set the device option in the .theanorc file's ``[global]`` section.
your computer has multiple gpu devices, you can address them as gpu0, gpu1,
gpu2, or gpu3. (If you have more than 4 devices you are very lucky but you'll have to modify theano's
* If your computer has multiple gpu and use 'device=gpu', the driver select the one to use (normally gpu0)
*configdefaults.py* file and define more gpu devices to choose from.)
* You can use the program nvida-smi to change that policy.
* You can choose one specific gpu by giving device the one of those values: gpu0, gpu1, gpu2, or gpu3.
* If you have more than 4 devices you are very lucky but you'll have to modify theano's *configdefaults.py* file and define more gpu devices to choose from.
* Using the 'device=gpu*' theano flag make theano fall back to the cpu if their is a problem with the gpu.
You can use the flag 'force_device=gpu*' to have theano raise an error when we can't use the gpu.
.. note::
.. note::
There is a compatibility issue affecting some Ubuntu 9.10 users, and probably anyone using
There is a compatibility issue affecting some Ubuntu 9.10 users, and probably anyone using
...
@@ -98,7 +102,7 @@ As a point of reference, a loop that calls ``numpy.exp(x.value)`` also takes abo
...
@@ -98,7 +102,7 @@ As a point of reference, a loop that calls ``numpy.exp(x.value)`` also takes abo
Looping 100 times took 7.17374897003 seconds
Looping 100 times took 7.17374897003 seconds
Result is [ 1.23178032 1.61879341 1.52278065 ..., 2.20771815 2.29967753 1.62323285]
Result is [ 1.23178032 1.61879341 1.52278065 ..., 2.20771815 2.29967753 1.62323285]