Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have set devices=cuda0, but the program still use cpu #6065

Closed
tswc opened this issue Jun 21, 2017 · 2 comments
Closed

I have set devices=cuda0, but the program still use cpu #6065

tswc opened this issue Jun 21, 2017 · 2 comments

Comments

@tswc
Copy link

tswc commented Jun 21, 2017

I am using CPU: AMD 8320 GPU: GTX 750 TI
python 2.7 theano 0.9.0 cuda v8.0

I have set .theanorc.txt as follow.

[global]
openmp=False  
device = cuda0

floatX = float32  
allow_input_downcast=True  
[blas]
ldflags=  
[gcc]
cxxflags=-IC:\ProgramData\Anaconda2\MinGW
[nvcc]
flags = -LC:\ProgramData\Anaconda2\libs
compiler_bindir = C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
fastmath = True  


[cuda]
root = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0

[dnn]
library_path = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64
include_path = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include
enabled = True

But when I test if I am using GPU, that sill shows that I am using CPU. But there are no errors.
So I have no idea where is wrong.


Using cuDNN version 5110 on context None
Mapped name None to device cuda0: GeForce GTX 750 Ti (0000:01:00.0)
[GpuElemwise{exp,no_inplace}(<GpuArrayType<None>(float32, vector)>), HostFromGpu(gpuarray)(GpuElemwise{exp,no_inplace}.0)]
Looping 1000 times took 0.879000 seconds
Result is [ 1.23178029  1.61879349  1.52278066 ...,  2.20771813  2.29967761
  1.62323296]
Used the cpu

Can someone help me!?

@lamblin
Copy link
Member

lamblin commented Jun 21, 2017

The script you are using to test does not seem to detect GPU usage correctly.
In fact, since it prints GpuElemwise{exp,no_inplace}(<GpuArrayType<None>(float32, vector)>), you can be sure that it actually is using the GPU.
Are you using the latest version of the script at http://deeplearning.net/software/theano/tutorial/using_gpu.html#testing-theano-with-gpu ?

@tswc
Copy link
Author

tswc commented Jun 21, 2017

Thats really helpful!!!!!!!!!!
Thanks!

C:\ProgramData\Anaconda2\python.exe "C:/Users/TSWC/Google Drive/FA/Python_101/testgpu.py"
Using cuDNN version 5110 on context None
Mapped name None to device cuda0: GeForce GTX 750 Ti (0000:01:00.0)
[GpuElemwise{exp,no_inplace}(<GpuArrayType<None>(float32, (False,))>), HostFromGpu(gpuarray)(GpuElemwise{exp,no_inplace}.0)]
Looping 1000 times took 1.069000 seconds
Result is [ 1.23178029  1.61879349  1.52278066 ...,  2.20771813  2.29967761
  1.62323296]
Used the gpu

Process finished with exit code 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants