【发布时间】:2018-11-11 22:05:00
【问题描述】:
(theano_p27) ubuntu@ip-***-**-**-***:~$ device=cuda0,floatX=float32 GPUARRAY_CUDA_VERSION=80 python test.py
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
ERROR (theano.gpuarray): Could not initialize pygpu, support disabled
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/theano_p27/lib/python2.7/site-packages/theano/gpuarray/__init__.py", line 227, in <module>
use(config.device)
File "/home/ubuntu/anaconda3/envs/theano_p27/lib/python2.7/site-packages/theano/gpuarray/__init__.py", line 214, in use
init_dev(device, preallocate=preallocate)
File "/home/ubuntu/anaconda3/envs/theano_p27/lib/python2.7/site-packages/theano/gpuarray/__init__.py", line 99, in init_dev
**args)
File "pygpu/gpuarray.pyx", line 658, in pygpu.gpuarray.init
File "pygpu/gpuarray.pyx", line 587, in pygpu.gpuarray.pygpu_init
GpuArrayException: cuInit: CUDA_ERROR_UNKNOWN: unknown error
[Elemwise{exp,no_inplace}(<TensorType(float32, vector)>)]
Looping 1000 times took 2.717710 seconds
Result is [1.2317803 1.6187934 1.5227807 ... 2.2077181 2.2996776 Used the cpu
我正在尝试使用 Amazon Web Services EC2 运行 GPU,当我尝试运行测试以让我的代码运行我的 gnu 时出现此错误,但它给了我这个错误。
请帮忙
编辑:我运行的代码是来自 Theano 网站的测试代码
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')
【问题讨论】:
-
欢迎来到 SO!如果您需要帮助,您需要发布失败的代码!
-
什么实例类型?您是否安装了 GPU 驱动程序?
-
@BrandonMiller Ubuntu 实例类型是 t2.micro,带有深度学习 AMI (Ubuntu) 版本 9.0,我认为我没有安装任何 GPU 驱动程序
-
您是否连接了弹性 GPU 或其他东西?默认情况下,t2.micro 肯定没有 GPU。
-
@BrandonMiller 哦,我不知道,抱歉,我是 AWS 新手。谢谢
标签: python amazon-web-services gpu theano theano-cuda