我正在尝试将OpenCL用作Kubuntu 17.04上Theano的后端,但遇到了一些无法解决的问题。

由于我使用的是Intel Broadwell处理器(如果有帮助的话,可以使用i7-5557u),因此我下载了Beignet源代码(1.3.1)及其所有依赖项的副本,并make && make install 根据指示 ,这似乎行之有效,因为

  1. ./utest_run命令报告100%成功
  2. clinfo提供了有关此处理器的OpenCL功能的大量信息(我认为是正确的)。 在安装Beignet之前,它没有显示任何支持。

接着,我下载阿纳康达(4.4)的副本,并加入Keras (2.0.6), Theano (0.9.0),和pygpu经由(0.6.9) conda包管理器。 Keras和Theano似乎运行良好,因为我从fast.ai课程改编的python脚本在使用CPU时(显然非常缓慢)完成了应做的工作。 另外,从旧的Internet上获得的一个简单测试脚本说,CPU路径可以正常运行( https://pastebin.com/wM9jaGMF供参考)。

为了使Theano使用OpenCL后端,我添加了具有以下内容的~/.theanorc文件:

[global] floatX = float32 device = opencl0:0

现在,当我运行上面的pastebin脚本时,它给出以下错误:

ERROR (theano.gpuarray): Could not initialize pygpu, support disabled Traceback (most recent call last): File "/home/sahab/anaconda2/lib/python2.7/site-packages/theano/gpuarray/__init__.py", line 164, in <module> use(config.device) File "/home/sahab/anaconda2/lib/python2.7/site-packages/theano/gpuarray/__init__.py", line 151, in use init_dev(device) File "/home/sahab/anaconda2/lib/python2.7/site-packages/theano/gpuarray/__init__.py", line 60, in init_dev sched=config.gpuarray.sched) File "pygpu/gpuarray.pyx", line 634, in pygpu.gpuarray.init File "pygpu/gpuarray.pyx", line 584, in pygpu.gpuarray.pygpu_init File "pygpu/gpuarray.pyx", line 1057, in pygpu.gpuarray.GpuContext.__cinit__ GpuArrayException: clGetPlatformIDs(0, NULL, &nump): Unknown error

一个更简单的测试

DEVICE="opencl0:0" python -c "import pygpu; pygpu.test()"

引发与上述相同的错误。

认为问题出在Beignet,而不是pygpu,但我不知道如何找到根本问题,因为clinfo似乎还不错。 我已经做了相当多的研究,但是似乎并没有像人们所做的那样,因为实际上并没有任何文档/博客文章/向您提供帮助。 有什么想法吗?

(根据记录,我可以肯定的是,考虑到我所拥有的计算机,这不会给我太多的提速,但是基于一些阅读,它至少应该使其速度提高1.5到2倍,因此应该仍然值得我尝试追踪)

后代的clinfo输出:

Number of platforms                               2
  Platform Name                                   Intel Gen OCL Driver
  Platform Vendor                                 Intel
  Platform Version                                OpenCL 1.2 beignet 1.3
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_subgroups cl_intel_subgroups_short cl_khr_gl_sharing
  Platform Extensions function suffix             Intel

  Platform Name                                   Portable Computing Language
  Platform Vendor                                 The pocl project
  Platform Version                                OpenCL 2.0 pocl 0.13, LLVM 3.8.1
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             POCL

  Platform Name                                   Intel Gen OCL Driver
Number of devices                                 1
  Device Name                                     Intel(R) Iris Graphics 6100 BroadWell U-Processor GT3
  Device Vendor                                   Intel
  Device Vendor ID                                0x8086
  Device Version                                  OpenCL 1.2 beignet 1.3
  Driver Version                                  1.3
  Device OpenCL C Version                         OpenCL C 1.2 beignet 1.3
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Max compute units                               48
  Max clock frequency                             1000MHz
  Device Partition                                (core)
    Max number of sub-devices                     1
    Supported partition types                     None, None, None
  Max work item dimensions                        3
  Max work item sizes                             512x512x512
  Max work group size                             512
  Preferred work group size multiple              16
  Preferred / native vector sizes                 
    char                                                16 / 8       
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 0 / 8        (cl_khr_fp16)
    float                                                4 / 4       
    double                                               0 / 2        (n/a)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (n/a)
  Address bits                                    32, Little-Endian
  Global memory size                              4294967296 (4GiB)
  Error Correction support                        No
  Max memory allocation                           2147483648 (2GiB)
  Unified memory for Host and Device              Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        8192
  Global Memory cache line                        64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            65536 pixels
    Max 1D or 2D image array size                 2048 images
    Base address alignment for 2D image buffers   4096 bytes
    Pitch alignment for 2D image buffers          1 bytes
    Max 2D image size                             8192x8192 pixels
    Max 3D image size                             8192x8192x2048 pixels
    Max number of read image args                 128
    Max number of write image args                8
  Local memory type                               Local
  Local memory size                               65536 (64KiB)
  Max constant buffer size                        134217728 (128MiB)
  Max number of constant args                     8
  Max size of kernel argument                     1024
  Queue properties                                
    Out-of-order execution                        No
    Profiling                                     Yes
  Prefer user sync for interop                    Yes
  Profiling timer resolution                      80ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            Yes
    SPIR versions                                 1.2
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                __cl_copy_region_align4;__cl_copy_region_align16;__cl_cpy_region_unalign_same_offset;__cl_copy_region_unalign_dst_offset;__cl_copy_region_unalign_src_offset;__cl_copy_buffer_rect;__cl_copy_image_1d_to_1d;__cl_copy_image_2d_to_2d;__cl_copy_image_3d_to_2d;__cl_copy_image_2d_to_3d;__cl_copy_image_3d_to_3d;__cl_copy_image_2d_to_buffer;__cl_copy_image_3d_to_buffer;__cl_copy_buffer_to_image_2d;__cl_copy_buffer_to_image_3d;__cl_fill_region_unalign;__cl_fill_region_align2;__cl_fill_region_align4;__cl_fill_region_align8_2;__cl_fill_region_align8_4;__cl_fill_region_align8_8;__cl_fill_region_align8_16;__cl_fill_region_align128;__cl_fill_image_1d;__cl_fill_image_1d_array;__cl_fill_image_2d;__cl_fill_image_2d_array;__cl_fill_image_3d;
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Device Extensions                               cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_subgroups cl_intel_subgroups_short cl_khr_gl_sharing cl_khr_fp16

  Platform Name                                   Portable Computing Language
Number of devices                                 1
  Device Name                                     pthread-Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
  Device Vendor                                   GenuineIntel
  Device Vendor ID                                0x8086
  Device Version                                  OpenCL 2.0 pocl
  Driver Version                                  0.13
  Device OpenCL C Version                         OpenCL C 2.0
  Device Type                                     CPU, Default
  Device Profile                                  FULL_PROFILE
  Max compute units                               4
  Max clock frequency                             3400MHz
  Device Partition                                (core)
    Max number of sub-devices                     4
    Supported partition types                     equally, by counts
  Max work item dimensions                        3
  Max work item sizes                             4096x4096x4096
  Max work group size                             4096
  Preferred work group size multiple              8
  Preferred / native vector sizes                 
    char                                                16 / 16      
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 8 / 8        (n/a)
    float                                                4 / 4       
    double                                               2 / 2        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Address bits                                    64, Little-Endian
  Global memory size                              17862586368 (16.64GiB)
  Error Correction support                        No
  Max memory allocation                           17862586368 (16.64GiB)
  Unified memory for Host and Device              Yes
  Shared Virtual Memory (SVM) capabilities        (core)
    Coarse-grained buffer sharing                 Yes
    Fine-grained buffer sharing                   Yes
    Fine-grained system sharing                   No
    Atomics                                       Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Preferred alignment for atomics                 
    SVM                                           0 bytes
    Global                                        0 bytes
    Local                                         0 bytes
  Max size for global variable                    0
  Preferred total size of global vars             0
  Global Memory cache type                        Read/Write
  Global Memory cache size                        32768
  Global Memory cache line                        64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            1116411648 pixels
    Max 1D or 2D image array size                 2048 images
    Max 2D image size                             32768x32768 pixels
    Max 3D image size                             2048x2048x2048 pixels
    Max number of read image args                 128
    Max number of write image args                128
    Max number of read/write image args           <printDeviceInfo:106: get CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS : error -30>
  Max number of pipe args                         16
  Max active pipe reservations                    1
  Max pipe packet size                            1024
  Local memory type                               Global
  Local memory size                               17862586368 (16.64GiB)
  Max constant buffer size                        17862586368 (16.64GiB)
  Max number of constant args                     8
  Max size of kernel argument                     1024
  Queue properties (on host)                      
    Out-of-order execution                        No
    Profiling                                     Yes
  Queue properties (on device)                    
    Out-of-order execution                        Yes
    Profiling                                     Yes
    Preferred size                                16384 (16KiB)
    Max size                                      262144 (256KiB)
  Max queues on device                            1
  Max events on device                            1024
  Prefer user sync for interop                    Yes
  Profiling timer resolution                      1ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            Yes
    SPIR versions                                 1.2
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Device Extensions                               cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_spir cl_khr_int64 cl_khr_fp64 cl_khr_int64_base_atomics cl_khr_int64_extended_atomics

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Intel Gen OCL Driver
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [Intel]
  clCreateContext(NULL, ...) [default]            Success [Intel]
  clCreateContext(NULL, ...) [other]              Success [POCL]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 Intel Gen OCL Driver
    Device Name                                   Intel(R) Iris Graphics 6100 BroadWell U-Processor GT3
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 Intel Gen OCL Driver
    Device Name                                   Intel(R) Iris Graphics 6100 BroadWell U-Processor GT3

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.11
  ICD loader Profile                              OpenCL 2.1

  ask by syazdani translate from so

本文未有回复,本站智能推荐:

1回复

Beignet找不到CPU

我正在使用Beignet在我的笔记本上尝试使用第四代i7和集成图形加速器的OpenCL,运行Ubuntu 16.04 在运行clinfo时,我只找到1个平台和1个设备,这是图形加速器。 我还应该找不到CPU本身吗? 正如我所读到的,OpenCL允许将主机用作普通设备并在其上运行一些内核
1回复

DLL加载失败:找不到pygpu / libgpuarray的指定模块

我正在使用libgpuarray(openCL),但似乎无法在anaconda 2中使GPU与Theano一起使用。当我尝试运行测试时,我得到: 错误(theano.gpuarray):已配置pygpu,但无法导入Traceback(最近一次调用最近):文件“ C:\\ Users \
2回复

英特尔OpenCL Beignet问题

我正在尝试使用英特尔硬件在Linux上使用OpenCL: 我有3个选择: 在CPU实现上使用Intel的OpenCL - 让我有机会测试代码逻辑,因为性能行为非常不同。 在GPU实现上使用英特尔的OpenCL - 但是我从未管理它运行,因为它需要自定义构建内核并且它不是想
1回复

在AMD GPU中使用Python + Theano和OpenCL

我正在尝试使用Python与Theano来加速OpenCL的一些代码。 我按照指示安装了libgpuarray和pygpu (我认为),没有错误。 安装检测到安装的OpenCL运行时。 我只是不能为OpenCL运行Theano示例,主要是因为我不知道如何指定我的GPU。 根据inxi
1回复

使用OpenCL在千层面中使用卷积层

我有一个AMD显卡,所以我必须使用OpenCL。 经过很长一段时间的安装,我几乎让它工作,我唯一不能做的就是使用卷积层。 我收到一个错误: AssertionError:AbstractConv2d Theano优化失败:没有可用的实现支持所请求的选项。 你是否从优化器中排除了“
2回复

在AMD Radeon上尝试使用OpenCL + Theano时,获取“pygpu已配置但无法导入”错误

我遵循了以下说明: https://gist.github.com/jarutis/ff28bca8cfb9ce0c8b1a 但是当我尝试时:THEANO_FLAGS = device = opencl0:0 python test.py 在测试文件上我收到错误: 错误(t
1回复

pygpu问题:DLL加载失败:找不到指定的程序

在 anaconda 上尝试在 Theano 中运行模型时 重要的版本信息是: 蟒蛇(蟒蛇 3.7) Theano : 1.0.4 (来自主分支的最新版本) pygpu:0.7.6(从 conda 安装) CUDA:10.0 CUDNN:7.6.5 我已经检查了没有 gpu
2回复

安装beignet以在Intel上使用OpenCL,但OpenCL程序仅在以root身份运行时才能运行

我有一台英特尔高清显卡4000第三代处理器,我的操作系统是Linux Mint 17.1 64位。 我安装了beignet以便能够使用OpenCL ,从而在GPU上运行程序。 我使用pyOpenCL绑定时遇到了很多问题,所以我决定卸载我当前的beignet版本并安装最新的版本(你可以看到我之