【发布时间】:2018-04-25 19:31:46
【问题描述】:
我正在安装 libgpuarray v0.7.4。当我导入 theano 时,出现以下错误: 我正在使用以下版本:
(1) 来自 github (rel-1.0.0rc1) 的 Theano,
(2) CUDA 9.0 (我确信 CUDA / cusolver 可以工作,我安装了 pycuda、scikit-cuda 并且可以成功运行它们)
(3) cuDNN 7.0.3
(4) NVIDIA 驱动程序 384.90
Python 3.5.2 (default, Sep 14 2017, 22:51:06)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import theano
Using cuDNN version 7003 on context None
ERROR (theano.gpuarray): Could not initialize pygpu, support disabled
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/Theano-1.0.0rc1-py3.5.egg/theano/gpuarray/__init__.py", line 220, in <module>
use(config.device)
File "/usr/local/lib/python3.5/dist-packages/Theano-1.0.0rc1-py3.5.egg/theano/gpuarray/__init__.py", line 207, in use
init_dev(device, preallocate=preallocate)
File "/usr/local/lib/python3.5/dist-packages/Theano-1.0.0rc1-py3.5.egg/theano/gpuarray/__init__.py", line 152, in init_dev
pygpu.blas.gemm(0, tmp, tmp, 0, tmp, overwrite_c=True)
File "pygpu/blas.pyx", line 149, in pygpu.blas.gemm
File "pygpu/blas.pyx", line 47, in pygpu.blas.pygpu_blas_rgemm
pygpu.gpuarray.GpuArrayException: (b'cuLinkCreate: CUDA_ERROR_JIT_COMPILER_NOT_FOUND: PTX JIT compiler library not found', 3)
关于如何解决它的任何想法? 我想利用theano的GPU支持
编辑(回复 talonmies)
我认为 pygpu 可以在我的 GPU 上创建上下文:
$ DEVICE=cuda python3
Python 3.5.2 (default, Sep 14 2017, 22:51:06)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygpu
>>> pygpu.test()
pygpu is installed in /usr/local/lib/python3.5/dist-packages/pygpu-0.7.4-py3.5-linux-x86_64.egg/pygpu
NumPy version 1.13.3
NumPy relaxed strides checking option: True
NumPy is installed in /usr/local/lib/python3.5/dist-packages/numpy-1.13.3-py3.5-linux-x86_64.egg/numpy
Python version 3.5.2 (default, Sep 14 2017, 22:51:06) [GCC 5.4.0 20160609]
nose version 1.3.7
*** Testing for GeForce GTX TITAN Black
mpi4py found: False
.EEEEEEEEEEEEEEEEEEEEEEEEEEE
另一方面,运行nvidia-smi
Mon Nov 13 15:39:35 2017
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.90 Driver Version: 384.90 |
|-------------------------------+----------------------+----------------------+
| 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 TIT... Off | 00000000:01:00.0 Off | N/A |
| 28% 47C P2 94W / 250W | 102MiB / 6082MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 5562 C python3 91MiB |
+-----------------------------------------------------------------------------+
我跟踪了代码,发现错误出现在 BLAS GEMM 中。我认为我的 GPU 没有编译代码,libgpuarray 需要在我的机器上编译。但不知何故,它找不到编译器。
编辑结束
【问题讨论】:
-
“在无上下文中使用 cuDNN 版本 7003”可能是那里的主要线索。您正在使用的 Theano 安装似乎甚至无法在 GPU 上建立上下文。在那之后一切都会被打破
-
我认为可以。问题似乎 libgpuarray(或 cublas)无法为我的 GPU 构建代码
-
CUBLAS 是一个静态链接的运行时 API 库,它根本不使用 JIT 编译。所以这绝对是你正在使用的 Python 框架内部的东西,或者你构建或运行它们的方式有些奇怪
-
嗯...那我不确定。我已经在github提交了一个问题。
标签: theano theano-cuda