Mali G52 OpenCL Comparison

Post Reply
hominoid
Posts: 269
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, XU4, MC1, N1, N2
Location: Lake Superior Basin, USA
Has thanked: 1 time
Been thanked: 3 times
Contact:

Mali G52 OpenCL Comparison

Unread post by hominoid » Thu Feb 28, 2019 12:36 pm

Wanting to get a better feel for the OpenCL performance of the Odroid N2’s Mali G52, I set up the N2 with a Odroid N1 and XU4 to run Lyra2rev2 on sgminer-arm 5.5.6a.

To get OpenCL running on the N2 I had to add the following link.

Code: Select all

cd /usr/lib/aarch64-linux-gnu
ln -s libMali.so libOpenCL.so
In order for clinfo to work the following directories and file had to be created

Code: Select all

sudo apt install clinfo
sudo mkdir /etc/OpenCL
sudo mkdir /etc/OpenCL/vendors
sudo vi /etc/OpenCL/vendors/mali.icd
add
libOpenCL.so
clinfo should now report:

Code: Select all

Number of platforms                               1
  Platform Name                                   ARM Platform
  Platform Vendor                                 ARM
  Platform Version                                OpenCL 2.0 git.c8adbf9.122c9daed32dbba4b3056f41a2f23c58
  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_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp16 cl_khr_icd cl_khr_egl_image cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_subgroups cl_khr_create_command_queue cl_arm_core_id cl_arm_printf cl_arm_thread_limit_hint cl_arm_non_uniform_work_group_size cl_arm_import_memory cl_arm_shared_virtual_memory
  Platform Extensions function suffix             ARM

  Platform Name                                   ARM Platform
Number of devices                                 1
  Device Name                                     Mali-G52
  Device Vendor                                   ARM
  Device Vendor ID                                0x72120000
  Device Version                                  OpenCL 2.0 git.c8adbf9.122c9daed32dbba4b3056f41a2f23c58
  Driver Version                                  2.0
  Device OpenCL C Version                         OpenCL C 2.0 git.c8adbf9.122c9daed32dbba4b3056f41a2f23c58
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               2
  Max clock frequency                             750MHz
  Device Partition                                (core)
    Max number of sub-devices                     0
    Supported partition types                     None
  Max work item dimensions                        3
  Max work item sizes                             384x384x384
  Max work group size                             384
  Preferred work group size multiple              8
  Preferred / native vector sizes                 
    char                                                16 / 4       
    short                                                8 / 2       
    int                                                  4 / 1       
    long                                                 2 / 1       
    half                                                 8 / 2        (cl_khr_fp16)
    float                                                4 / 1       
    double                                               0 / 0        (n/a)
  Half-precision Floating-point support           (cl_khr_fp16)
    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
  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  No
  Double-precision Floating-point support         (n/a)
  Address bits                                    64, Little-Endian
  Global memory size                              3888140288 (3.621GiB)
  Error Correction support                        No
  Max memory allocation                           972035072 (927MiB)
  Unified memory for Host and Device              Yes
  Shared Virtual Memory (SVM) capabilities        (core)
    Coarse-grained buffer sharing                 Yes
    Fine-grained buffer sharing                   No
    Fine-grained system sharing                   No
    Atomics                                       No
  Shared Virtual Memory (SVM) capabilities (ARM)  
    Coarse-grained buffer sharing                 Yes
    Fine-grained buffer sharing                   No
    Fine-grained system sharing                   No
    Atomics                                       No
  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                    65536 (64KiB)
  Preferred total size of global vars             0
  Global Memory cache type                        Read/Write
  Global Memory cache size                        131072 (128KiB)
  Global Memory cache line size                   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   32 bytes
    Pitch alignment for 2D image buffers          64 pixels
    Max 2D image size                             65536x65536 pixels
    Max 3D image size                             65536x65536x65536 pixels
    Max number of read image args                 128
    Max number of write image args                64
    Max number of read/write image args           64
  Max number of pipe args                         16
  Max active pipe reservations                    1
  Max pipe packet size                            1024
  Local memory type                               Global
  Local memory size                               32768 (32KiB)
  Max number of constant args                     8
  Max constant buffer size                        65536 (64KiB)
  Max size of kernel argument                     1024
  Queue properties (on host)                      
    Out-of-order execution                        Yes
    Profiling                                     Yes
  Queue properties (on device)                    
    Out-of-order execution                        Yes
    Profiling                                     Yes
    Preferred size                                2097152 (2MiB)
    Max size                                      16777216 (16MiB)
  Max queues on device                            1
  Max events on device                            1024
  Prefer user sync for interop                    No
  Profiling timer resolution                      1000ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  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_byte_addressable_store cl_khr_3d_image_writes cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp16 cl_khr_icd cl_khr_egl_image cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_subgroups cl_khr_create_command_queue cl_arm_core_id cl_arm_printf cl_arm_thread_limit_hint cl_arm_non_uniform_work_group_size cl_arm_import_memory cl_arm_shared_virtual_memory

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  ARM Platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [ARM]
  clCreateContext(NULL, ...) [default]            Success [ARM]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 ARM Platform
    Device Name                                   Mali-G52
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 ARM Platform
    Device Name                                   Mali-G52
  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                                 ARM Platform
    Device Name                                   Mali-G52

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
For the test I tried to set things up as evenly as possible. All three SBC ran Lyra2rev2 simultaneously on a shared network. Each platform’s sgminer was compiled with the latest ARM Compute Library v18.11.

XU4 – Active air cooled, Split AirFlow Case with 80mm ducted fan
Linux odroid-xu4 4.14.102-156 #1 SMP PREEMPT Thu Feb 21 14:15:08 -03 2019 armv7l armv7l armv7l GNU/Linux
GCC 7.3
CFLAGS="-Ofast -Wall -std=gnu99 -march=armv7-a -mtune=cortex-a15.cortex-a7 -fexpensive-optimizations -fprefetch-loop-arrays -mfpu=neon -I/opt/arm_compute-v18.11-bin-linux/include/CL" LDFLAGS="-L/opt/arm_compute-v18.11-bin-linux/lib/linux-armv7a-neon-cl" ./configure --disable-adl –disable-adl-checks

N1 – Active air cooled, stock
Linux odroid-n1 4.4.114 #1 SMP Thu Sep 6 21:26:15 EDT 2018 aarch64 GNU/Linux
GCC 6.3
CFLAGS="-Ofast -Wall -march=armv8-a+crypto -mtune=cortex-a72.cortex-a53 -fexpensive-optimizations -fprefetch-loop-arrays -std=gnu99 -I/opt/arm_compute-v18.11-bin-linux/include/CL" LDFLAGS="-L/opt/arm_compute-v18.11-bin-linux/lib/linux-arm64-v8a-neon-cl" ./configure --disable-git-version --disable-adl --disable-adl-checks

N2 - Passive heatsink, stock
Linux odroid-n2 4.9.156-14 #1 SMP PREEMPT Sat Feb 16 02:15:44 -02 2019 aarch64 aarch64 aarch64 GNU/Linux
GCC 7.3
CFLAGS="-Ofast -Wall -march=armv8-a+crypto -mtune=cortex-a73.cortex-a53 -fexpensive-optimizations -fprefetch-loop-arrays -std=gnu99 -I/opt/arm_compute-v18.11-bin-linux/include/CL" LDFLAGS="-L/opt/arm_compute-v18.11-bin-linux/lib/linux-arm64-v8a-neon-cl" ./configure --disable-git-version --disable-adl –disable-adl-checks

The SBCs ran for a little over an hour with the following average Kilohash/s results
Comparison.jpg
Comparison.jpg (30.52 KiB) Viewed 1074 times
I also recorded the system and GPU temperatures for the Odroid N2 during the test.
N2 Temps.jpg
N2 Temps.jpg (61.72 KiB) Viewed 1074 times
I spent a fair amount of time tuning GPU parameters. I have the most experience with the XU4's Mali T-628 so most of the time was spent on the N2 and the N1. As a general observation the N2’s Mali G52 was a pleasure to work with and It didn’t take long to find the sweet spot were it was stable and sustainable. The bad boy out of the group is definitely the N1’s Mali T-860. I struggled to get it to perform near the XU4’s performance. This isn’t something new either. From the first time I started working with it a year ago, getting it to operate at or near the XU4, regardless of the algorithm, has been a challenge. Even considering it’s running an older kernel, compiler and drivers I feel the N1’s Mali T860 should do better. For this test I could get it to run in the 70-73 Kilohash/s range but it’s just not sustainable over the long run.

The N2’s Mali G52’s range during tuning could punch up to 103-110 Kilohash/s but could not be sustained. It runs relatively cool and comfortable at 98-99 Kilohash/s, considering it’s passive heatsink and affords a nice increase in performance to it’s closest competitor. Overall I’m very pleased with its performance and happy from a hardware perspective that HK waited for the S922X with it’s Mali G52. In between testing I’ve been running the N2 as a thin desktop with good experiences and looking forward to the new drivers that are in the works.
Last edited by hominoid on Thu Feb 28, 2019 10:26 pm, edited 1 time in total.

User avatar
odroid
Site Admin
Posts: 30638
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 13 times
Been thanked: 91 times
Contact:

Re: Mali G52 OpenCL Comparison

Unread post by odroid » Thu Feb 28, 2019 2:13 pm

Thank you for the detail analysis.
We've fixed the disk quota issue in the PHPBB forum settings.
Please upload the images.

hominoid
Posts: 269
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, XU4, MC1, N1, N2
Location: Lake Superior Basin, USA
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: Mali G52 OpenCL Comparison

Unread post by hominoid » Thu Feb 28, 2019 10:26 pm

Thank you, images uploaded.

meister ivar
Posts: 16
Joined: Fri Jan 05, 2018 7:27 pm
languages_spoken: english german
ODROIDs: xu4q c2 n2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Mali G52 OpenCL Comparison

Unread post by meister ivar » Fri Mar 01, 2019 3:01 am

@hominoid

Do you know mandelbulber (https://github.com/buddhi1980/mandelbulber2)?
It is a 3d fractal-renderer which is able to use opencl for rendering.

Could you try your N2 on testing it by using ocl?

My XU4 isn't running well on that. Resulting images are kind of twisted...

hominoid
Posts: 269
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, XU4, MC1, N1, N2
Location: Lake Superior Basin, USA
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: Mali G52 OpenCL Comparison

Unread post by hominoid » Fri Mar 01, 2019 5:14 am

I'm not familiar with it but I have been digging around for some other OpenCL Benchmarks today. I'm about to run out of space on the 16GB emmc so I'm moving to a larger emmc right now. I'll take a look as soon as I'm done and let you know how it goes.

hominoid
Posts: 269
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, XU4, MC1, N1, N2
Location: Lake Superior Basin, USA
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: Mali G52 OpenCL Comparison

Unread post by hominoid » Fri Mar 01, 2019 11:50 pm

meister ivar wrote:
Fri Mar 01, 2019 3:01 am
@hominoid

Do you know mandelbulber (https://github.com/buddhi1980/mandelbulber2)?
It is a 3d fractal-renderer which is able to use opencl for rendering.

Could you try your N2 on testing it by using ocl?

My XU4 isn't running well on that. Resulting images are kind of twisted...
I finished up last night staging Mandelbulb2 on the N2. I was not able to actually use OpenCL on the desktop because the current fbdev driver does not support acceleration. I was able to run MandelBulber2 without OpenCL and I was able to operate the OpenCL version of the application using the command line interface. None of this helped see the issue you were experiencing so I decided to stage Mandelbulb2 on a XU4 to try and replicate the OpenCL issue.

When selecting the predefined fractals, about half of them did not appear as I would have expected. Upon further investigation I found that the default values for the viewport were not appropriate. So for instance, the MendalBox when selected was a dark image with some lines. Once the camera distance was adjusted from the default 7 to approximately 25, the image was correct. I tried several problematic fractals and they all displayed correctly once the viewport parameters were set appropriately. I did not find any issues with OpenCL acceleration for this application on the XU4. OpenCL operated as I would have expected. Since we are now off topic for this thread, if you have any followup questions please open a new thread in the XU4 forum and send me a PM so I’m aware. By the way, nice app!
Mandelbox.jpg
Mandelbox.jpg (50.12 KiB) Viewed 936 times

User avatar
odroid
Site Admin
Posts: 30638
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 13 times
Been thanked: 91 times
Contact:

Re: Mali G52 OpenCL Comparison

Unread post by odroid » Mon Mar 04, 2019 9:53 am

hominoid wrote:
Thu Feb 28, 2019 12:36 pm
The SBCs ran for a little over an hour with the following average Kilohash/s results
Image
OpenCL 2.0 accelerated Hash computing performance is very nice. :D

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 3 guests