You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following test for GPU functionality from the Theano tutorial:
import os
os.environ["MKL_THREADING_LAYER"] = "GNU"
os.environ["THEANO_FLAGS"] = "device=cuda,floatX=float32"
from theano import function, config, shared, tensor
import numpy
import time
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core
iters = 1000
rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
f = function([], tensor.exp(x))
print(f.maker.fgraph.toposort())
t0 = time.time()
for i in range(iters):
r = f()
t1 = time.time()
print("Looping %d times took %f seconds" % (iters, t1 - t0))
print("Result is %s" % (r,))
if numpy.any([isinstance(x.op, tensor.Elemwise) and
('Gpu' not in type(x.op).__name__)
for x in f.maker.fgraph.toposort()]):
print('Used the cpu')
else:
print('Used the gpu')
Produces an error message:
Can not use cuDNN on context None: cannot compile with cuDNN. We got this error:
/tmp/try_flags_cgM6mq.c:4:19: fatal error: cudnn.h: No such file or directory
#include <cudnn.h>
^
compilation terminated.
Mapped name None to device cuda: GeForce GTX 980 Ti (0000:01:00.0)
Although the output indicates that the GPU was in fact used during the execution
[GpuElemwise{exp,no_inplace}(<GpuArrayType<None>(float32, vector)>), HostFromGpu(gpuarray)(GpuElemwise{exp,no_inplace}.0)]
Looping 1000 times took 1.333771 seconds
Result is [ 1.23178029 1.61879349 1.52278066 ..., 2.20771813 2.29967761
1.62323296]
Used the gpu
The text was updated successfully, but these errors were encountered:
@billpage I just had the same error when testing Theano and adding .theanorc helps. cuDNN is installed in a weird location. Need to find the way to preload .theanorc to the project folders.
The following test for GPU functionality from the Theano tutorial:
Produces an error message:
Although the output indicates that the GPU was in fact used during the execution
The text was updated successfully, but these errors were encountered: