Mali GPU drivers, OpenGLES x.x, OpenCL and Vulken

Will Khadas be issuing the mali gpu drivers for the VIM3?

1 Like

Only have fbdev driver for VIM3 now. But seems a new version support wayland from the buildroot source code, but still NO X11 suoport.

I can live with wayland, I’ve been using it more with the other SBC’s I have I only have one from rockchip that support x11 that’s an arm processor. Thanks for the answer

1 Like

Do you have VIM1 specific fb driver ?

kernel space driver: https://github.com/khadas/linux/tree/khadas-vims-4.9.y/drivers/gpu/arm/utgard
userspace blobs: https://github.com/khadas/fenix/tree/master/archives/hwpacks/mali/Amlogic/lib/arm64/m450/r7p0/fbdev

1 Like

Is there any word on OpenCL driver support, I’d test myself but still waiting for my board?

Is OpenCL drivers available for VIM3…?

Thanks

The fbdev driver will support OpenCL as long as you have the libmali.ko file in /usr/lib/aarch64-linx-gnu/ directory. But for whatever reason this driver is slower for the VIM3 than the VIM3L at OpenCL mining Content anyway.

It is already support in latest image.

VIM3 is solwer then VIM3L? Could you please tell me how to reproduce this ?

I tested it under xmrig v5+ compiling for OpenCL support. Then tested with CN-pico, a.k.a turtlecoin or cn-pico/trtl. I’m only referring to the OpenCL results though. The CPU is cores are about twice as fast without the 4 vs. 6 handy cap. I’ve not noticed any difference in games, but I’ve not tried anything taxing for this either.

I should also note that I don’t think I’m not on the newest image for either of them. I’ve only used Ubuntu as Debian tends to be slower in mining. I also believe it’s an issue with the fbdev driver not taking advantage of all the compute cores. The G-31 only says it has one compute core while the G-52 says that it only has two compute cores according to clinfo. I’ve not tried to clpeak on both of the boards, this may show them being different, but the mining results would do the same.

1 Like

Steps used to make the O.S. see the OpenCL support for the Mali GPU’s
$ sudo apt-get install -y mesa-opencl-icd opencl-headers ocl-icd-opencl-dev clinfo
$ sudo echo libmali.ko > /etc/OpenCL/vendors/mali.ko
ctrl+x, y
Now you can run clinfo
This is how to run it outside of wayland or X, it will also give you the be performance as well as the gpu isn’t being used for much either.

Ohh… I tried clinfo since it showed zero supported platforms I assumed it driver doesn’t work…

Also lshw shows no gpu present.

I will try the above step and try again…

which image you use?

root@Khadas:~# clinfo 
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                              3888193536 (3.621GiB)
  Error Correction support                        No
  Max memory allocation                           972048384 (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

A lot of the hardware utilities simply don’t work with due to them being written for x86_64 hardware. dmesg is the utility to use

example: $ dmesg | grep gpu or $ dmesg | grep mali
if you want to look for say the nvme if you have it plugged in you switch mali or gpu for nvme or superspeed for the usb 3.0 port

Last one I created from Fenix was on 11/6/2019 for the vim3 and the vim3L was 11/25/2019 both are using the eMMC. Both run Ubuntu server 18.04.03LTS kernel 4.9

Can you try the latest image ?
https://dl.khadas.com/Firmware/VIM3/Ubuntu/EMMC/VIM3_Ubuntu-server-bionic_Linux-4.9_arm64_EMMC_V20191231.7z

yes, I will, I’ll use the SD card image though, I’ve got to much stuff with the android image now to reflash the eMMC. Thanks for the link, I’ll get the other from the support page

Okay, on the new image with updates, it is faster then the original test the hash rates doubled from about 28H/s to 56H/s

Yeah some benchmarks in harinfo were also noticeably faster…
@wll1rah What is the hash rate you got with VIM3L…?

@numbqq Thanks, I was using a older version… Now it shows the GPU…