You have "optimizer = None" in your .theanorc, which prevents all graph
optimizations from being applied, including the ones that replace the
CPU computations by the GPU ones.

Theano is behaving normally.

If you want a faster compilation but still using the GPU, use "optimizer
= fast_compile".

On Mon, Sep 26, 2016, ZetaOri wrote:
> Hello. 
> 
> I am having an issue using the GPU with Theano. It says it runs on gpu, but 
> still performs computation on cpu.
> 
> CentOS 6.7
> python 2.7.10
> cuda 7.5
> gcc 4.4.7.
> 
> I have, as far as I know, configured everything correctly to run theano 
> with device=gpu, but it still runs on CPU.
> 
> Running the theano gpu test 
> <http://deeplearning.net/software/theano/tutorial/using_gpu.html#testing-theano-with-gpu>
>  
> outputs the following:
> python tgputest.py
> *Using gpu device 0: GeForce GTX TITAN X (CNMeM is disabled, cuDNN 4007)*
> [HostFromGpu(<CudaNdarrayType(float32, vector)>), 
> Elemwise{exp,no_inplace}(HostFromGpu.0)]
> Looping 1000 times took 4.698779 seconds
> Result is [ 1.23178029  1.61879337  1.52278066 ...,  2.20771813  2.29967761
>   1.62323284]
> *Used the cpu*
> 
> theanorc is configured properly, but testing with THEANO_FLAGS shows exact 
> same output.
> 
> What is frustrating is theano used to work on the gpu, but when I 
> uninstalled that virtualenv and reinstalled (with the same 
> requirements.txt), it no longer can run on gpu.
> 
> 
> Theano was installed via pip to a virtualenv (managed by pyenv):
> pip install numpy
> pip install scipy
> pip install theano
> 
> For what its worth, I have tried uninstalling and reinstalling many times, 
> as well as installing from bleeding edge. 
> 
> Please consider my situation with theano 8.2, rather than suggesting theano 
> 9/dev.
> 
> *System/config specs*
> 
> 
> *.theanorc*[cuda]
> root = /usr/local/cuda-7.5
> 
> [global]
> floatX=float32
> optimizer = None
> device = gpu
> force_device = True
> 
> [nvcc]
> fastmath = True
> 
> 
> *.bashrc*# Source global definitions
> if [ -f /etc/bashrc ]; then
>         . /etc/bashrc
> fi
> 
> # User specific aliases and functions
> export 
> LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
> 
> export CUDA_HOME=/usr/local/cuda
> export PATH=$PATH:/usr/local/cuda/bin
> 
> export PYENV_ROOT="$HOME/.pyenv"
> export PATH="$PYENV_ROOT/bin:$PATH"
> eval "$(pyenv init -)"
> eval "$(pyenv virtualenv-init -)"
> 
> 
> *which pip*~/.pyenv/shims/pip
> 
> 
> *pip list*cycler (0.10.0)
> h5py (2.6.0)
> hickle (2.1.0)
> Keras (1.1.0)
> matplotlib (1.5.3)
> nose (1.3.7)
> nose-parameterized (0.5.0)
> *numpy (1.11.1)*
> pip (8.1.2)
> pyparsing (2.1.9)
> python-dateutil (2.5.3)
> pytz (2016.6.1)
> PyYAML (3.12)
> *scipy (0.18.1)*
> setuptools (27.3.0)
> six (1.10.0)
> *Theano (0.8.2)*
> wheel (0.30.0a0)
> 
> 
> *nvcc --version*
> nvcc: NVIDIA (R) Cuda compiler driver
> Copyright (c) 2005-2015 NVIDIA Corporation
> Built on Tue_Aug_11_14:27:32_CDT_2015
> Cuda compilation tools, release 7.5, V7.5.17
> 
> 
> *gcc --version*gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
> Copyright (C) 2010 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> *uname -mrs*
> Linux 2.6.32-573.3.1.el6.x86_64 x86_64
> 
> *lsb_release -a*
> LSB Version:    
> :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
> Distributor ID:    CentOS
> Description:    CentOS release 6.7 (Final)
> Release:    6.7
> Codename:    Final
> 
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.


-- 
Pascal

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to