Theano:“已安装CUDA,但设备gpu不可用”

时间:2015-11-15 02:29:12

标签: python ubuntu cuda theano

我正在尝试使用THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python gpu_test.py运行一些Theano脚本,我收到以下错误消息:

WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available  
(error: Unable to get the number of gpus available: no CUDA-capable device is detected)

我使用Nvidia GTX 690运行Kubuntu 15.10 x64。

CUDA似乎已正确安装:

f@f-Aurora-R4:~/theano$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2014 NVIDIA Corporation
Built on Thu_Jul_17_21:41:27_CDT_2014
Cuda compilation tools, release 6.5, V6.5.12

f@f-Aurora-R4:~/theano$ nvidia-smi  
Sat Nov 14 21:18:51 2015       
+------------------------------------------------------+                       
| NVIDIA-SMI 4.304...   Driver Version: 304.128        |                       
|-------------------------------+----------------------+----------------------+
| GPU  Name                     | Bus-Id        Disp.  | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap| Memory-Usage         | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 690          | 0000:04:00.0     N/A |                  N/A |
| 30%   33C  N/A     N/A /  N/A |   0%    8MB / 2047MB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 690          | 0000:05:00.0     N/A |                  N/A |
| 30%   36C  N/A     N/A /  N/A |  12%  237MB / 2047MB |     N/A      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Compute processes:                                               GPU Memory |
|  GPU       PID  Process name                                     Usage      |
|=============================================================================|
|    0            Not Supported                                               |
|    1            Not Supported                                               |
+-----------------------------------------------------------------------------+

我使用官方指南Easy Installation of an Optimized Theano on Current Ubuntu中的说明,全新安装Kubuntu,即:

# Python requirements
sudo apt-get -y install python-numpy python-scipy python-dev python-pip 
sudo apt-get -y install python-nose g++ libopenblas-dev git

# Install Theano:
sudo pip install Theano

# Add GPU requirements
sudo apt-get install nvidia-current
sudo apt-get install nvidia-cuda-toolkit 
sudo apt-get install cuda

然后我在我的主文件夹(即.theanorc)中创建了一个/home/f/.theanorc文件:

[cuda]
root = /usr/lib/nvidia-cuda-toolkit

我重新启动了。

我错过了什么吗?

我尝试了以下命令但得到了同样的错误:

# Tried specifying the GPU:
THEANO_FLAGS=mode=FAST_RUN,device=gpu0,floatX=float32 python gpu_test.py
THEANO_FLAGS=mode=FAST_RUN,device=gpu1,floatX=float32 python gpu_test.py

# Tried pointing to CUDA:
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32,cuda.root=/usr/lib/nvidia-cuda-toolkit  python gpu_test.py
THEANO_FLAGS=mode=FAST_RUN,device=gpu0,floatX=float32,cuda.root=/usr/lib/nvidia-cuda-toolkit  python gpu_test.py
THEANO_FLAGS=mode=FAST_RUN,device=gpu1,floatX=float32,cuda.root=/usr/lib/nvidia-cuda-toolkit  python gpu_test.py

0 个答案:

没有答案