Отсутствует поддержка OpenCL / HSA для rx 470 / vega 8 в Ubuntu 18.04 с использованием ROCM - PullRequest
1 голос
/ 19 мая 2019

Я установил ROCm, ROCm-Tensorflow и PlaidML на новую установку Ubuntu 18.04, используя инструкции, приведенные на:

Хотя оба графических процессора указаны в /opt/rocm/bin/rocminfo, они не распознаются /opt/rocm/opencl/bin/x86_64/clinfo или plaidml-setup (вывод ниже).При импорте tenorflow выдается следующая ошибка:

>>> 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 ***

CLinfo:

$ /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

PlaidML:

$ 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 Tensorflow: 1.13.3
  • PlaidML 0.5.0

Ответы [ 2 ]

0 голосов
/ 21 мая 2019

Ну, есть довольно очевидная проблема с вашей настройкой:

Количество платформ: 1

Название платформы: Portable Computing Language

Поставщик платформы:Проект pocl

Тип устройства: CL_DEVICE_TYPE_CPU

У вас установлена ​​только одна платформа, и это не AMD.Платформа Pocl, которая находится в Ubuntu / Debian, может использовать только процессоры.Вам необходимо установить пакеты AMD opencl для ROCm.Это описано здесь , но в основном:

sudo apt-get install rocm-opencl-dev

должно работать.Если вы установите его правильно, «Поставщик платформы» в выводе clinfo покажет «Advanced Micro Devices, Inc.»

0 голосов
/ 21 мая 2019

Обращаясь к документам ROCm, я считаю, что rx470 может работать с ним, а iGPU vega 8 - нет. Пожалуйста, обратитесь к этой ссылке для получения дополнительной информации. https://rocm.github.io/hardware.html

...