【问题标题】:No OpenCL / HSA support for rx 470 / vega 8 on Ubuntu 18.04 using ROCM使用 ROCM 在 Ubuntu 18.04 上不支持 rx 470 / vega 8 的 OpenCL / HSA
【发布时间】:2019-10-06 02:50:16
【问题描述】:

我按照以下说明在全新安装的 Ubuntu 18.04 上安装了 ROCm、ROCm-Tensorflow 和 PlaidML:

虽然 /opt/rocm/bin/rocminfo 列出了两个 GPU,但 /opt/rocm/opencl/bin/x86_64/clinfoplaidml-setup 无法识别它们(输出如下)。 导入tensorflow会报如下错误:

>>> import tensorflow
HSA reported error!
 In file: unpinned_copy_engine.cpp
At line: 126
HSA reported error!
 In file: unpinned_copy_engine.cpp
At line: 126
HSA reported error!
 In file: unpinned_copy_engine.cpp
At line: 126
HSA reported error!
 In file: unpinned_copy_engine.cpp
At line: 126
HSA reported error!
 In file: unpinned_copy_engine.cpp
At line: 126
HSA reported error!
 In file: unpinned_copy_engine.cpp
At line: 126
HSA reported error!
 In file: unpinned_copy_engine.cpp
At line: 126
HSA reported error!
 In file: unpinned_copy_engine.cpp
At line: 126
### HCC STATUS_CHECK Error: HSA_STATUS_ERROR_OUT_OF_RESOURCES (0x1008) at file:mcwamp_hsa.cpp line:1220
Aborted (core dumped)

Rocminfo 列出所有设备:

$ /opt/rocm/bin/rocminfo 
=====================    
HSA System Attributes    
=====================    
Runtime Version:         1.1
System Timestamp Freq.:  1000.000000MHz
Sig. Max Wait Duration:  18446744073709551615 (number of timestamp)
Machine Model:           LARGE                              
System Endianness:       LITTLE                             

==========               
HSA Agents               
==========               
*******                  
Agent 1                  
*******                  
  Name:                    AMD Ryzen 3 2200G with Radeon Vega Graphics
  Vendor Name:             CPU                                
  Feature:                 None specified                     
  Profile:                 FULL_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        0                                  
  Queue Min Size:          0                                  
  Queue Max Size:          0                                  
  Queue Type:              MULTI                              
  Node:                    0                                  
  Device Type:             CPU                                
  Cache Info:              
    L1:                      32KB                               
  Chip ID:                 5597                               
  Cacheline Size:          64                                 
  Max Clock Frequency (MHz):3850                               
  BDFID:                   2560                               
  Compute Unit:            4                                  
  Features:                None
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: KERNARG, FINE GRAINED
      Size:                    16776832KB                         
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Acessible by all:        TRUE                               
  ISA Info:                
    N/A                      
*******                  
Agent 2                  
*******                  
  Name:                    gfx902                             
  Vendor Name:             AMD                                
  Feature:                 KERNEL_DISPATCH                    
  Profile:                 FULL_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        128                                
  Queue Min Size:          4096                               
  Queue Max Size:          131072                             
  Queue Type:              MULTI                              
  Node:                    0                                  
  Device Type:             GPU                                
  Cache Info:              
    L1:                      16KB                               
  Chip ID:                 5597                               
  Cacheline Size:          64                                 
  Max Clock Frequency (MHz):1100                               
  BDFID:                   2560                               
  Compute Unit:            11                                 
  Features:                KERNEL_DISPATCH 
  Fast F16 Operation:      FALSE                              
  Wavefront Size:          64                                 
  Workgroup Max Size:      1024                               
  Workgroup Max Size Per Dimension:
    Dim[0]:                  67109888                           
    Dim[1]:                  167773184                          
    Dim[2]:                  0                                  
  Grid Max Size:           4294967295                         
  Waves Per CU:            160                                
  Max Work-item Per CU:    10240                              
  Grid Max Size per Dimension:
    Dim[0]:                  4294967295                         
    Dim[1]:                  4294967295                         
    Dim[2]:                  4294967295                         
  Max number Of fbarriers Per Workgroup:32                                 
  Pool Info:               
    Pool 1                   
      Segment:                 GROUP                              
      Size:                    64KB                               
      Allocatable:             FALSE                              
      Alloc Granule:           0KB                                
      Alloc Alignment:         0KB                                
      Acessible by all:        FALSE                              
  ISA Info:                
    ISA 1                    
      Name:                    amdgcn-amd-amdhsa--gfx902+xnack    
      Machine Models:          HSA_MACHINE_MODEL_LARGE            
      Profiles:                HSA_PROFILE_BASE                   
      Default Rounding Mode:   NEAR                               
      Default Rounding Mode:   NEAR                               
      Fast f16:                TRUE                               
      Workgroup Max Dimension: 
        Dim[0]:                  67109888                           
        Dim[1]:                  1024                               
        Dim[2]:                  16777217                           
      Workgroup Max Size:      1024                               
      Grid Max Dimension:      
        x                        4294967295                         
        y                        4294967295                         
        z                        4294967295                         
      Grid Max Size:           4294967295                         
      FBarrier Max Size:       32                                 
*******                  
Agent 3                  
*******                  
  Name:                    gfx803                             
  Vendor Name:             AMD                                
  Feature:                 KERNEL_DISPATCH                    
  Profile:                 BASE_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        128                                
  Queue Min Size:          4096                               
  Queue Max Size:          131072                             
  Queue Type:              MULTI                              
  Node:                    1                                  
  Device Type:             GPU                                
  Cache Info:              
    L1:                      16KB                               
  Chip ID:                 26591                              
  Cacheline Size:          64                                 
  Max Clock Frequency (MHz):1206                               
  BDFID:                   256                                
  Compute Unit:            32                                 
  Features:                KERNEL_DISPATCH 
  Fast F16 Operation:      FALSE                              
  Wavefront Size:          64                                 
  Workgroup Max Size:      1024                               
  Workgroup Max Size Per Dimension:
    Dim[0]:                  67109888                           
    Dim[1]:                  16778240                           
    Dim[2]:                  0                                  
  Grid Max Size:           4294967295                         
  Waves Per CU:            40                                 
  Max Work-item Per CU:    2560                               
  Grid Max Size per Dimension:
    Dim[0]:                  4294967295                         
    Dim[1]:                  4294967295                         
    Dim[2]:                  4294967295                         
  Max number Of fbarriers Per Workgroup:32                                 
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    4194304KB                          
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Acessible by all:        FALSE                              
    Pool 2                   
      Segment:                 GROUP                              
      Size:                    64KB                               
      Allocatable:             FALSE                              
      Alloc Granule:           0KB                                
      Alloc Alignment:         0KB                                
      Acessible by all:        FALSE                              
  ISA Info:                
    ISA 1                    
      Name:                    amdgcn-amd-amdhsa--gfx803          
      Machine Models:          HSA_MACHINE_MODEL_LARGE            
      Profiles:                HSA_PROFILE_BASE                   
      Default Rounding Mode:   NEAR                               
      Default Rounding Mode:   NEAR                               
      Fast f16:                TRUE                               
      Workgroup Max Dimension: 
        Dim[0]:                  67109888                           
        Dim[1]:                  1024                               
        Dim[2]:                  16777217                           
      Workgroup Max Size:      1024                               
      Grid Max Dimension:      
        x                        4294967295                         
        y                        4294967295                         
        z                        4294967295                         
      Grid Max Size:           4294967295                         
      FBarrier Max Size:       32                                 
*** Done ***

CL信息:

$ /opt/rocm/opencl/bin/x86_64/clinfo 
Number of platforms:                 1
  Platform Profile:              FULL_PROFILE
  Platform Version:              OpenCL 1.2 pocl 1.1 None+Asserts, LLVM 6.0.0, SPIR, SLEEF, DISTRO, POCL_DEBUG
  Platform Name:                 Portable Computing Language
  Platform Vendor:               The pocl project
  Platform Extensions:               cl_khr_icd


  Platform Name:                 Portable Computing Language
Number of devices:               1
  Device Type:                   CL_DEVICE_TYPE_CPU
  Vendor ID:                     1022h
  Max compute units:                 4
  Max work items dimensions:             3
    Max work items[0]:               4096
    Max work items[1]:               4096
    Max work items[2]:               4096
  Max work group size:               4096
  Preferred vector width char:           16
  Preferred vector width short:          16
  Preferred vector width int:            8
  Preferred vector width long:           4
  Preferred vector width float:          8
  Preferred vector width double:         4
  Native vector width char:          16
  Native vector width short:             16
  Native vector width int:           8
  Native vector width long:          4
  Native vector width float:             8
  Native vector width double:            4
  Max clock frequency:               3850Mhz
  Address bits:                  64
  Max memory allocation:             4294967296
  Image support:                 Yes
  Max number of images read arguments:       128
  Max number of images write arguments:      128
  Max image 2D width:                16384
  Max image 2D height:               16384
  Max image 3D width:                2048
  Max image 3D height:               2048
  Max image 3D depth:                2048
  Max samplers within kernel:            16
  Max size of kernel argument:           1024
  Alignment (bits) of base address:      1024
  Minimum alignment (bytes) for any datatype:    128
  Single precision floating point capability
    Denorms:                     Yes
    Quiet NaNs:                  Yes
    Round to nearest even:           Yes
    Round to zero:               Yes
    Round to +ve and infinity:           Yes
    IEEE754-2008 fused multiply-add:         Yes
  Cache type:                    Read/Write
  Cache line size:               64
  Cache size:                    4194304
  Global memory size:                12548460544
  Constant buffer size:              2097152
  Max number of constant args:           8
  Local memory type:                 Global
  Local memory size:                 2097152
  Kernel Preferred work group size multiple:     8
  Error correction support:          0
  Unified memory for Host and Device:        1
  Profiling timer resolution:            1
  Device endianess:              Little
  Available:                     Yes
  Compiler available:                Yes
  Execution capabilities:                
    Execute OpenCL kernels:          Yes
    Execute native function:             Yes
  Queue on Host properties:              
    Out-of-Order:                No
    Profiling :                  Yes
  Platform ID:                   0x7ff20df56020
  Name:                      pthread-AMD Ryzen 3 2200G with Radeon Vega Graphics
  Vendor:                    AuthenticAMD
  Device OpenCL C version:           OpenCL C 1.2 pocl
  Driver version:                1.1
  Profile:                   FULL_PROFILE
  Version:                   OpenCL 1.2 pocl HSTR: pthread-x86_64-pc-linux-gnu-znver1
  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_3d_image_writes cl_khr_spir cl_khr_fp64 cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp64

格子ML:

$ plaidml-setup

PlaidML Setup (0.5.0)

Thanks for using PlaidML!

Some Notes:
  * Bugs and other issues: https://github.com/plaidml/plaidml
  * Questions: https://stackoverflow.com/questions/tagged/plaidml
  * Say hello: https://groups.google.com/forum/#!forum/plaidml-dev
  * PlaidML is licensed under the GNU AGPLv3

Default Config Devices:
   No devices.

Experimental Config Devices:
   llvm_cpu.0 : CPU (LLVM)

Using experimental devices can cause poor performance, crashes, and other nastiness.
...

系统信息:

  • AMD Ryzen 2200g 配备 vega 8 显卡 (iGPU) 和 AMD Radeon rx470 (dGPU)
  • Ubuntu 18.04.2
  • 内核 4.18.0-20-generic
  • ROCm 2.4.25
  • Python 3.6.7
  • ROCm 张量流:1.13.3
  • PlaidML 0.5.0

【问题讨论】:

    标签: python tensorflow opencl ubuntu-18.04 amd-rocm


    【解决方案1】:

    参考 ROCm 文档,我相信 rx470 可以使用它,而 iGPU vega 8 则不能。 请参阅此链接以获取更多信息。 https://rocm.github.io/hardware.html

    【讨论】:

    • 这实际上是不正确的。如果您仔细阅读该文档,就会发现 HIP 和 HCC工作,而 OpenCL 运行时确实在 Raven Ridge APU 上工作。 OpenCL 应该足以运行 PlaidML。
    【解决方案2】:

    嗯,你的设置有一个相当明显的问题:

    平台数量:1

    平台名称:便携式计算语言

    平台供应商:pocl 项目

    设备类型:CL_DEVICE_TYPE_CPU

    您只安装了一个平台,它不是 AMD 的。 Ubuntu/Debian 中的 Pocl 平台只能使用 CPU。您需要为 ROCm 安装 AMD 的 opencl 包。这被描述为here,但基本上:

    sudo apt-get install rocm-opencl-dev

    应该可以。如果安装正确,clinfo 输出中的“Platform Vendor”将显示“Advanced Micro Devices, Inc.”

    【讨论】:

    • 我确实根据https://rocm.github.io/QuickStartOCL.html rocm-opencl-dev is already the newest version (1.2.0-2019060327) 安装了rocm-opencl-dev@你可能对这个问题是正确的,但是我如何启用AMD包?
    猜你喜欢
    • 1970-01-01
    • 2019-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-25
    • 1970-01-01
    相关资源
    最近更新 更多