在Ubuntu MATE 16.04中我試圖運行使用GPU的深度學習python示例:警告(theano.sandbox.cuda):安裝了CUDA,但設備gpu不可用(錯誤:cuda不可用)
我並運行該示例代碼,
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python check1.py
,但它似乎是使用的CPU,而不是GPU。這裏是終端輸出的最後一部分:
WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu0 is not available (error: cuda unavailable)
...
Used the cpu
我試圖運行此代碼太:
THEANO_FLAGS=device=cuda0 python check1.py
但輸出是:
ERROR (theano.sandbox.gpuarray): pygpu was configured but could not be imported
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/gpuarray/__init__.py", line 20, in <module>
import pygpu
ImportError: No module named pygpu
...
used cpu
我從易於安裝CUDA工具包。 這裏有(希望)有用的數據:
python --version
Python 2.7.12
g++ -v
gcc version 5.4.0
nvcc --version
Cuda compilation tools, release 7.5, V7.5.17
lspci
NVIDIA Corporation GM107 [GeForce GTX 750 Ti] (rev a2)
nvidia-smi
+------------------------------------------------------+
| NVIDIA-SMI 361.42 Driver Version: 361.42 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 750 Ti Off | 0000:01:00.0 On | N/A |
| 29% 35C P8 1W/38W | 100MiB/2044MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 2861 G /usr/lib/xorg/Xorg 90MiB |
+-----------------------------------------------------------------------------+