使用gpu训练报错cudaSuccess == cudaStat (0 vs. 38) Cuda Error: no CUDA-capable device is detected
Created by: HljWafer
安装的 pip install paddlepaddle-gpu cuda-7.5 cudnn5 运行官网例子时用cpu可以成功,切换成gpu会报错
I0124 08:39:10.899049 1337 Util.cpp:166] commandline: --use_gpu=True
modprobe: FATAL: Module nvidia not found in directory /lib/modules/4.13.0-31-generic
F0124 08:39:10.926606 1337 hl_cuda_device.cc:453] Check failed: cudaSuccess == cudaStat (0 vs. 38) Cuda Error: no CUDA-capable device is detected
检查了下 cuda确实应该是安装成功了
nvcc -V
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
运行的是官网的例子
import paddle.v2 as paddle
paddle.init(use_gpu=True, trainer_count=1)
x = paddle.layer.data(name='x', type=paddle.data_type.dense_vector(13))
y_predict = paddle.layer.fc(input=x, size=1, act=paddle.activation.Linear())
probs = paddle.infer(
output_layer=y_predict,
parameters=paddle.dataset.uci_housing.model(),
input=[item for item in paddle.dataset.uci_housing.test()()])
for i in xrange(len(probs)):
print 'Predicted price: ${:,.2f}'.format(probs[i][0] * 1000)