Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jan 2019 00:21:21 +0100
From:      Tomasz CEDRO <tomek@cedro.info>
To:        Greg V <greg@unrelenting.technology>
Cc:        FreeBSD Questions Mailing List <freebsd-questions@freebsd.org>, freebsd-x11@freebsd.org
Subject:   Re: AMDGPU RX580 OpenCL
Message-ID:  <CAFYkXjn5XCSJrZXFuoJXzrUFF9pNpi0OhL3g=%2BO-1AB1_5BdMw@mail.gmail.com>
In-Reply-To: <1546427653.1787.0@smtp.migadu.com>
References:  <CAFYkXjnVOspenga%2BM0oP-0pS=vxr4gmqs7XcrJZdSjnf1geEZA@mail.gmail.com> <1546427653.1787.0@smtp.migadu.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 2, 2019 at 12:15 PM Greg V wrote:
> - you might have to run OpenCL applications with
> LD_PRELOAD=/lib/libthr.so.3 (when they're single thread applications
> like clinfo) https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214204
> - you have to rebuild the kernel driver with this patch
> https://github.com/FreeBSDDesktop/kms-drm/issues/33#issuecomment-422793245
>
> keep in mind that Clover is not very good. It can't yet handle Blender,
> doesn't have image support for Darktable, etc.

Thank you Greg! LD_PRELOAD trick does not help..

For instance with john:

# john --list=opencl-devices
Platform #0 name: Clover
Platform version: OpenCL 1.1 Mesa 18.1.9
Device #0 (0) name: Radeon RX 580 Series (POLARIS10, DRM 3.23.0,
12.0-RELEASE, LLVM 6.0.1)
Device vendor: AMD
Device type: GPU (LE)
Device version: OpenCL 1.1 Mesa 18.1.9
Driver version: 18.1.9
Native vector widths: char 16, short 8, int 4, long 2
Preferred vector width: char 16, short 8, int 4, long 2
Global Memory: 8.0 GB
Local Memory: 32.0 KB (Local)
Max memory alloc. size: 5.0 GB
Max clock (MHz): 4294968662
Max Work Group Size: 256
Parallel compute cores: 36
Stream processors: 2304  (36 x 64)

# john --format=Raw-SHA1-opencl -test
Device 0: Radeon RX 580 Series (POLARIS10, DRM 3.23.0, 12.0-RELEASE, LLVM 6.0.1)
OpenCL error (UNKNOWN OPENCL ERROR) in file (common-opencl.c) at line
(1782) - (Source kernel not found!)


With clinfo:

# clinfo
Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 18.1.9
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 1
  Device Name                                     Radeon RX 580 Series
(POLARIS10, DRM 3.23.0, 12.0-RELEASE, LLVM 6.0.1)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 Mesa 18.1.9
  Driver Version                                  18.1.9
  Device OpenCL C Version                         OpenCL C 1.1
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Max compute units                               36
  Max clock frequency                             1366MHz
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
  Preferred work group size multiple              64
  Preferred / native vector sizes
    char                                                16 / 16
    short                                                8 / 8
    int                                                  4 / 4
    long                                                 2 / 2
    half                                                 8 / 8
(cl_khr_fp16)
    float                                                4 / 4
    double                                               2 / 2
(cl_khr_fp64)
  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         (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                              8589934592 (8GiB)
  Error Correction support                        No
  Max memory allocation                           6440266752 (5.998GiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       32768 bits (4096 bytes)
  Global Memory cache type                        None
  Image support                                   No
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Max constant buffer size                        2147483647 (2GiB)
  Max number of constant args                     16
  Max size of kernel argument                     1024
  Queue properties
    Out-of-order execution                        No
    Profiling                                     Yes
  Profiling timer resolution                      0ns
  Execution capabilities
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  Device Available                                Yes
  Compiler 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_int64_base_atomics
cl_khr_int64_extended_atomics cl_khr_fp64 cl_khr_fp16

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [MESA]
  clCreateContext(NULL, ...) [default]            Success [MESA]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found
in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 Clover
    Device Name                                   Radeon RX 580 Series
(POLARIS10, DRM 3.23.0, 12.0-RELEASE, LLVM 6.0.1)
  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                                 Clover
    Device Name                                   Radeon RX 580 Series
(POLARIS10, DRM 3.23.0, 12.0-RELEASE, LLVM 6.0.1)

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.12
  ICD loader Profile                              OpenCL 2.2
NOTE: your OpenCL library declares to support OpenCL 2.2,
but it seems to support up to OpenCL 2.1 only.
Segmentation fault (core dumped)

root@hexagon:~ # env| grep LD
LD_PRELOAD=/lib/libthr.so.3

# ls /lib/libthr.so.3
/lib/libthr.so.3

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFYkXjn5XCSJrZXFuoJXzrUFF9pNpi0OhL3g=%2BO-1AB1_5BdMw>