【问题标题】:ERROR: No OpenCL platforms found, check OpenCL installation错误:未找到 OpenCL 平台,请检查 OpenCL 安装
【发布时间】:2018-09-05 19:37:46
【问题描述】:

我尝试在 gpu (CentOS 7.3) 上运行 Matlab 程序。 这个 Matlab 使用caffe

当我从命令行运行它时:

matlab -nodisplay -r "demo, quit"

运行正常。

当我使用 LSF 命令运行它时:

bsub  -q gpu  -R "select[ngpus>0] rusage[ngpus_shared=1]" matlab -nodisplay -r "demo, quit"

我得到了错误:

错误:未找到 OpenCL 平台,请检查 OpenCL 安装

我比较 LD_PATH_LIBRARY - 是一样的。

可能是什么问题? 欢迎任何想法!

clinfo 输出:

  Number of platforms                               1
  Platform Name                                   NVIDIA CUDA
  Platform Vendor                                 NVIDIA Corporation
  Platform Version                                OpenCL 1.2 CUDA 8.0.0
  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_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts
  Platform Extensions function suffix             NV

  Platform Name                                   NVIDIA CUDA
Number of devices                                 1
  Device Name                                     Tesla K40m
  Device Vendor                                   NVIDIA Corporation
  Device Vendor ID                                0x10de
  Device Version                                  OpenCL 1.2 CUDA
  Driver Version                                  375.26
  Device OpenCL C Version                         OpenCL C 1.2 
  Device Type                                     GPU
  Device Available                                Yes
  Device Profile                                  FULL_PROFILE
  Device Topology (NV)                            PCI-E, 09:00.0
  Max compute units                               15
  Max clock frequency                             745MHz
  Compute Capability (NV)                         3.5
  Device Partition                                (core)
    Max number of sub-devices                     1
    Supported partition types                     None
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x64
  Max work group size                             1024
  Compiler Available                              Yes
  Linker Available                                Yes
  Preferred work group size multiple              32
  Warp size (NV)                                  32
  Preferred / native vector sizes                 
    char                                                 1 / 1       
    short                                                1 / 1       
    int                                                  1 / 1       
    long                                                 1 / 1       
    half                                                 0 / 0        (n/a)
    float                                                1 / 1       
    double                                               1 / 1        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  Yes
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Address bits                                    64, Little-Endian
  Global memory size                              11995578368 (11.17GiB)
  Error Correction support                        Yes
  Max memory allocation                           2998894592 (2.793GiB)
  Unified memory for Host and Device              No
  Integrated memory (NV)                          No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       4096 bits (512 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        245760 (240KiB)
  Global Memory cache line                        128 bytes
  Image support                                   Yes
    Max number of samplers per kernel             32
    Max size for 1D images from buffer            134217728 pixels
    Max 1D or 2D image array size                 2048 images
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             4096x4096x4096 pixels
    Max number of read image args                 256
    Max number of write image args                16
  Local memory type                               Local
  Local memory size                               49152 (48KiB)
  Registers per block (NV)                        65536
  Max constant buffer size                        65536 (64KiB)
  Max number of constant args                     9
  Max size of kernel argument                     4352 (4.25KiB)
  Queue properties                                
    Out-of-order execution                        Yes
    Profiling                                     Yes
  Prefer user sync for interop                    No
  Profiling timer resolution                      1000ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Kernel execution timeout (NV)                 No
  Concurrent copy and kernel execution (NV)       Yes
    Number of async copy engines                  2
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                
  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_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              Success [NV]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No platform

【问题讨论】:

  • 好像你没有安装 OpenCL 驱动。您可以使用您的分发包管理器安装clinfo 工具,并在此处发布其输出吗?
  • 我将 clinfo 输出添加到我的问题中
  • 安装正常,应该是应用故障。尝试在strace工具下运行程序:strace -fv <program with arguments> | grep -i opencl

标签: matlab opencl gpu caffe lsf


【解决方案1】:

我的最佳猜测是来自 LSF 的 bsub 命令将作业安排在集群中的另一台机器(计算节点)上,而未安装 OpenCL。

在前端有 OpenCL/CUDA,但没有集群的计算节点,这是我见过很多次的事情。甚至包含库的文件系统的一部分也是共享的,必须存在用于 OpenCLs ICD 机制的文件夹 /etc/OpenCL/vendors

您可以尝试通过bsub 运行clinfo(如果您还没有),或者使用bsub 执行ls /etc/OpenCL/vendors

如果您不确定 LSF 提交的作业是否在同一台机器上运行,请使用带有和不带有 bsubhostname 命令。

希望对您有所帮助。

【讨论】:

  • 抱歉回答晚了..我正在度假..当我用 bsub 运行 clinfo 时,我得到 2 行不同:1.Preferred work group size multiple <getWGsizes:496: create cont ext : error -30> 2.clCreateContext(NULL, ...) [other] <checkNullCtx:2308: create context with device from non-default platform : error -30>
  • 请尝试其他建议,以便我们知道:bsub 是否在同一台机器上执行作业,如果不是,则无论是否安装了 OpenCL。
  • LSF 在同一台机器上运行,因为我使用'-m machine-name'
  • 那可能是权限问题。检查~/.nv 的所有者和权限,或者干脆尝试删除或移动文件夹。
  • 移动 ~/.nv 没有帮助。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-21
  • 2015-12-07
  • 2012-04-12
  • 1970-01-01
  • 2021-07-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多