Coder Social home page Coder Social logo

Comments (38)

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024 1

it uses a different method to achieve hardware acceleration

full acceleration in proot is yet to come

may take some months or more

Yes i am waiting.. to see clinfo present in proot..

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024 1

@Saikatsaha1996
I started working back on this and found that clinfo can run in proot with option OS=Android

you need to compile clinfo

cd ~
git clone https://github.com/Oblomov/clinfo
git clone https://github.com/KhronosGroup/OpenCL-Headers
cd ~/clinfo
make OS=Android 

AND result...
Screenshot_20220124-123317_Termux

root@localhost:~/clinfo# make OS=Android
cc -g -pedantic -Werror -std=c99 -Wall -Wextra -I../OpenCL-Headers  -c -o clinfo.o src/clinfo.c
cc -g -pedantic -Werror -std=c99 -Wall -Wextra -I../OpenCL-Headers -Wl,-rpath-link=/system/vendor/lib64 -L/system/vendor/lib64  -o clinfo.real clinfo.o  -lOpenCL -ldl
chmod +x clinfo
root@localhost:~/clinfo# clinfo
-bash: clinfo: command not found
root@localhost:~/clinfo# ./clinfo
Number of platforms                               1
 Platform Name                                   ARM Platform
 Platform Vendor                                 ARM
 Platform Version                                OpenCL 2.0 v1.r26p0-01eac0.###other-sha0123456789ABCDEF0###
 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_il_program cl_khr_priority_hints cl_khr_create_command_queue cl_khr_spirv_no_integer_wrap_decoration cl_khr_extended_versioning 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_import_memory_dma_buf cl_arm_import_memory_host cl_arm_import_memory_android_hardware_buffer
 Platform Extensions function suffix             ARM

 Platform Name                                   ARM Platform
Number of devices                                 1
 Device Name                                     Mali-G72 r0p1
 Device Vendor                                   ARM
 Device Vendor ID                                0x62210010
 Device Version                                  OpenCL 2.0 v1.r26p0-01eac0.###other-sha0123456789ABCDEF0###
 Device Numeric Version                          0x800000 (2.0.0)
 Driver Version                                  2.0
 Device OpenCL C Version                         OpenCL C 2.0 v1.r26p0-01eac0.###other-sha0123456789ABCDEF0###
 Device Type                                     GPU
 Device Profile                                  FULL_PROFILE
 Device Available                                Yes
 Compiler Available                              Yes
 Linker Available                                Yes
 Max compute units                               3
 Available core IDs                              0-2
 Max clock frequency                             5MHz
 Device Partition                                (core)
   Max number of sub-devices                     0
   Supported partition types                     None
   Supported affinity domains                    (n/a)
 Max work item dimensions                        3
 Max work item sizes                             384x384x384
 Max work group size                             384
 Preferred work group size multiple (kernel)     4
 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                              4294967296 (4GiB)
 Error Correction support                        No
 Max memory allocation                           1073741824 (1024MiB)
 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
 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                        262144 (256KiB)
 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                     128
 Max constant buffer size                        1073741824 (1024MiB)
 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
   IL version                                    SPIR-V_1.0
   ILs with version                              SPIR-V                                                           0x400000 (1.0.0)
 printf() buffer size                            1048576 (1024KiB)
 Built-in kernels                                (n/a)
 Built-in kernels with version                   (n/a)
 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_il_program cl_khr_priority_hints cl_khr_create_command_queue cl_khr_spirv_no_integer_wrap_decoration cl_khr_extended_versioning 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_import_memory_dma_buf cl_arm_import_memory_host cl_arm_import_memory_android_hardware_buffer
 Device Extensions with Version                  cl_khr_global_int32_base_atomics                                 0x400000 (1.0.0)
                                                 cl_khr_global_int32_extended_atomics                             0x400000 (1.0.0)
                                                 cl_khr_local_int32_base_atomics                                  0x400000 (1.0.0)
                                                 cl_khr_local_int32_extended_atomics                              0x400000 (1.0.0)
                                                 cl_khr_byte_addressable_store                                    0x400000 (1.0.0)
                                                 cl_khr_3d_image_writes                                           0x400000 (1.0.0)
                                                 cl_khr_int64_base_atomics                                        0x400000 (1.0.0)
                                                 cl_khr_int64_extended_atomics                                    0x400000 (1.0.0)
                                                 cl_khr_fp16                                                      0x400000 (1.0.0)
                                                 cl_khr_icd                                                       0x400000 (1.0.0)
                                                 cl_khr_egl_image                                                 0x400000 (1.0.0)
                                                 cl_khr_image2d_from_buffer                                       0x400000 (1.0.0)
                                                 cl_khr_depth_images                                              0x400000 (1.0.0)
                                                 cl_khr_il_program                                                0x400000 (1.0.0)
                                                 cl_khr_priority_hints                                            0x400000 (1.0.0)
                                                 cl_khr_create_command_queue                                      0x400000 (1.0.0)
                                                 cl_khr_spirv_no_integer_wrap_decoration                          0x400000 (1.0.0)
                                                 cl_khr_extended_versioning                                       0x400000 (1.0.0)
                                                 cl_arm_core_id                                                   0x400000 (1.0.0)
                                                 cl_arm_printf                                                    0x400000 (1.0.0)
                                                 cl_arm_thread_limit_hint                                         0x400000 (1.0.0)
                                                 cl_arm_non_uniform_work_group_size                               0x400000 (1.0.0)
                                                 cl_arm_import_memory                                             0x400000 (1.0.0)
                                                 cl_arm_import_memory_dma_buf                                     0x400000 (1.0.0)
                                                 cl_arm_import_memory_host                                        0x400000 (1.0.0)
                                                 cl_arm_import_memory_android_hardware_buffer                     0x400000 (1.0.0)

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-G72 r0p1
 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-G72 r0p1
 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-G72 r0p1
root@localhost:~/clinfo#

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024 1

Ok
I'll start looking about this!

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

Screenshot_2021-12-13-00-33-27-014_com termux
With android-ubuntu getting error

Without Ubuntu in direct termux successful
Screenshot_2021-12-12-02-38-11-965_com termux

Can you give me any solution please?

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

Waiting for your valuable time 🙂 thanks

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

Nope OpenCl won't work for now!

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

Nope OpenCl won't work for now!

OpenCL working with CPU but not working with gpu
Meybe dependency issue or meybe i am doing anything whong! 🥲

LibOpenCL.so found but
Every time got error with
*Undefined reference to x,y,z
Thank you for your response

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

OpenCl won't work with current state of termux app's proot!

Need upgrades from termux org!

from ubuntu-on-android.

stale avatar stale commented on May 18, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

OpenCl won't work with current state of termux app's proot!

Need upgrades from termux org!

Please add support OpenCL driver any another way..

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

sorry @Saikatsaha1996

it's way too heavy for me now, for now, you can try the AidLearning app which provides OpenCL support for python scripts.

https://github.com/aidlearning/AidLearning-FrameWork

it supports OpenCL for python codes

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

sorry @Saikatsaha1996

it's way too heavy for me now, for now, you can try the AidLearning app which provides OpenCL support for python scripts.

https://github.com/aidlearning/AidLearning-FrameWork

it supports OpenCL for python codes

Already tried but when i trying to check clinfo
.

Number of device. Showing 0

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

it uses a different method to achieve hardware acceleration

full acceleration in proot is yet to come

may take some months or more

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

@Saikatsaha1996 I started working back on this and found that clinfo can run in proot with option OS=ANDROID

you need to compile clinfo

cd ~
git clone https://github.com/Oblomov/clinfo
git clone https://github.com/KhronosGroup/OpenCL-Headers
cd ~/clinfo
make OS=Android 

AND result... Screenshot_20220124-123317_Termux

root@localhost:~/clinfo# make OS=Android
cc -g -pedantic -Werror -std=c99 -Wall -Wextra -I../OpenCL-Headers  -c -o clinfo.o src/clinfo.c
cc -g -pedantic -Werror -std=c99 -Wall -Wextra -I../OpenCL-Headers -Wl,-rpath-link=/system/vendor/lib64 -L/system/vendor/lib64  -o clinfo.real clinfo.o  -lOpenCL -ldl
chmod +x clinfo
root@localhost:~/clinfo# clinfo
-bash: clinfo: command not found
root@localhost:~/clinfo# ./clinfo
Number of platforms                               1
 Platform Name                                   ARM Platform
 Platform Vendor                                 ARM
 Platform Version                                OpenCL 2.0 v1.r26p0-01eac0.###other-sha0123456789ABCDEF0###
 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_il_program cl_khr_priority_hints cl_khr_create_command_queue cl_khr_spirv_no_integer_wrap_decoration cl_khr_extended_versioning 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_import_memory_dma_buf cl_arm_import_memory_host cl_arm_import_memory_android_hardware_buffer
 Platform Extensions function suffix             ARM

 Platform Name                                   ARM Platform
Number of devices                                 1
 Device Name                                     Mali-G72 r0p1
 Device Vendor                                   ARM
 Device Vendor ID                                0x62210010
 Device Version                                  OpenCL 2.0 v1.r26p0-01eac0.###other-sha0123456789ABCDEF0###
 Device Numeric Version                          0x800000 (2.0.0)
 Driver Version                                  2.0
 Device OpenCL C Version                         OpenCL C 2.0 v1.r26p0-01eac0.###other-sha0123456789ABCDEF0###
 Device Type                                     GPU
 Device Profile                                  FULL_PROFILE
 Device Available                                Yes
 Compiler Available                              Yes
 Linker Available                                Yes
 Max compute units                               3
 Available core IDs                              0-2
 Max clock frequency                             5MHz
 Device Partition                                (core)
   Max number of sub-devices                     0
   Supported partition types                     None
   Supported affinity domains                    (n/a)
 Max work item dimensions                        3
 Max work item sizes                             384x384x384
 Max work group size                             384
 Preferred work group size multiple (kernel)     4
 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                              4294967296 (4GiB)
 Error Correction support                        No
 Max memory allocation                           1073741824 (1024MiB)
 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
 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                        262144 (256KiB)
 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                     128
 Max constant buffer size                        1073741824 (1024MiB)
 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
   IL version                                    SPIR-V_1.0
   ILs with version                              SPIR-V                                                           0x400000 (1.0.0)
 printf() buffer size                            1048576 (1024KiB)
 Built-in kernels                                (n/a)
 Built-in kernels with version                   (n/a)
 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_il_program cl_khr_priority_hints cl_khr_create_command_queue cl_khr_spirv_no_integer_wrap_decoration cl_khr_extended_versioning 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_import_memory_dma_buf cl_arm_import_memory_host cl_arm_import_memory_android_hardware_buffer
 Device Extensions with Version                  cl_khr_global_int32_base_atomics                                 0x400000 (1.0.0)
                                                 cl_khr_global_int32_extended_atomics                             0x400000 (1.0.0)
                                                 cl_khr_local_int32_base_atomics                                  0x400000 (1.0.0)
                                                 cl_khr_local_int32_extended_atomics                              0x400000 (1.0.0)
                                                 cl_khr_byte_addressable_store                                    0x400000 (1.0.0)
                                                 cl_khr_3d_image_writes                                           0x400000 (1.0.0)
                                                 cl_khr_int64_base_atomics                                        0x400000 (1.0.0)
                                                 cl_khr_int64_extended_atomics                                    0x400000 (1.0.0)
                                                 cl_khr_fp16                                                      0x400000 (1.0.0)
                                                 cl_khr_icd                                                       0x400000 (1.0.0)
                                                 cl_khr_egl_image                                                 0x400000 (1.0.0)
                                                 cl_khr_image2d_from_buffer                                       0x400000 (1.0.0)
                                                 cl_khr_depth_images                                              0x400000 (1.0.0)
                                                 cl_khr_il_program                                                0x400000 (1.0.0)
                                                 cl_khr_priority_hints                                            0x400000 (1.0.0)
                                                 cl_khr_create_command_queue                                      0x400000 (1.0.0)
                                                 cl_khr_spirv_no_integer_wrap_decoration                          0x400000 (1.0.0)
                                                 cl_khr_extended_versioning                                       0x400000 (1.0.0)
                                                 cl_arm_core_id                                                   0x400000 (1.0.0)
                                                 cl_arm_printf                                                    0x400000 (1.0.0)
                                                 cl_arm_thread_limit_hint                                         0x400000 (1.0.0)
                                                 cl_arm_non_uniform_work_group_size                               0x400000 (1.0.0)
                                                 cl_arm_import_memory                                             0x400000 (1.0.0)
                                                 cl_arm_import_memory_dma_buf                                     0x400000 (1.0.0)
                                                 cl_arm_import_memory_host                                        0x400000 (1.0.0)
                                                 cl_arm_import_memory_android_hardware_buffer                     0x400000 (1.0.0)

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-G72 r0p1
 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-G72 r0p1
 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-G72 r0p1
root@localhost:~/clinfo#

Omg 🤩🤩🤩🤩

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

Screenshot_2022-01-24-13-10-20-616_com termux
No same problem 🥲

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

@Saikatsaha1996 I started working back on this and found that clinfo can run in proot with option OS=Android

you need to compile clinfo

cd ~
git clone https://github.com/Oblomov/clinfo
git clone https://github.com/KhronosGroup/OpenCL-Headers
cd ~/clinfo
make OS=Android 

AND result... Screenshot_20220124-123317_Termux

root@localhost:~/clinfo# make OS=Android
cc -g -pedantic -Werror -std=c99 -Wall -Wextra -I../OpenCL-Headers  -c -o clinfo.o src/clinfo.c
cc -g -pedantic -Werror -std=c99 -Wall -Wextra -I../OpenCL-Headers -Wl,-rpath-link=/system/vendor/lib64 -L/system/vendor/lib64  -o clinfo.real clinfo.o  -lOpenCL -ldl
chmod +x clinfo
root@localhost:~/clinfo# clinfo
-bash: clinfo: command not found
root@localhost:~/clinfo# ./clinfo
Number of platforms                               1
 Platform Name                                   ARM Platform
 Platform Vendor                                 ARM
 Platform Version                                OpenCL 2.0 v1.r26p0-01eac0.###other-sha0123456789ABCDEF0###
 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_il_program cl_khr_priority_hints cl_khr_create_command_queue cl_khr_spirv_no_integer_wrap_decoration cl_khr_extended_versioning 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_import_memory_dma_buf cl_arm_import_memory_host cl_arm_import_memory_android_hardware_buffer
 Platform Extensions function suffix             ARM

 Platform Name                                   ARM Platform
Number of devices                                 1
 Device Name                                     Mali-G72 r0p1
 Device Vendor                                   ARM
 Device Vendor ID                                0x62210010
 Device Version                                  OpenCL 2.0 v1.r26p0-01eac0.###other-sha0123456789ABCDEF0###
 Device Numeric Version                          0x800000 (2.0.0)
 Driver Version                                  2.0
 Device OpenCL C Version                         OpenCL C 2.0 v1.r26p0-01eac0.###other-sha0123456789ABCDEF0###
 Device Type                                     GPU
 Device Profile                                  FULL_PROFILE
 Device Available                                Yes
 Compiler Available                              Yes
 Linker Available                                Yes
 Max compute units                               3
 Available core IDs                              0-2
 Max clock frequency                             5MHz
 Device Partition                                (core)
   Max number of sub-devices                     0
   Supported partition types                     None
   Supported affinity domains                    (n/a)
 Max work item dimensions                        3
 Max work item sizes                             384x384x384
 Max work group size                             384
 Preferred work group size multiple (kernel)     4
 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                              4294967296 (4GiB)
 Error Correction support                        No
 Max memory allocation                           1073741824 (1024MiB)
 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
 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                        262144 (256KiB)
 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                     128
 Max constant buffer size                        1073741824 (1024MiB)
 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
   IL version                                    SPIR-V_1.0
   ILs with version                              SPIR-V                                                           0x400000 (1.0.0)
 printf() buffer size                            1048576 (1024KiB)
 Built-in kernels                                (n/a)
 Built-in kernels with version                   (n/a)
 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_il_program cl_khr_priority_hints cl_khr_create_command_queue cl_khr_spirv_no_integer_wrap_decoration cl_khr_extended_versioning 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_import_memory_dma_buf cl_arm_import_memory_host cl_arm_import_memory_android_hardware_buffer
 Device Extensions with Version                  cl_khr_global_int32_base_atomics                                 0x400000 (1.0.0)
                                                 cl_khr_global_int32_extended_atomics                             0x400000 (1.0.0)
                                                 cl_khr_local_int32_base_atomics                                  0x400000 (1.0.0)
                                                 cl_khr_local_int32_extended_atomics                              0x400000 (1.0.0)
                                                 cl_khr_byte_addressable_store                                    0x400000 (1.0.0)
                                                 cl_khr_3d_image_writes                                           0x400000 (1.0.0)
                                                 cl_khr_int64_base_atomics                                        0x400000 (1.0.0)
                                                 cl_khr_int64_extended_atomics                                    0x400000 (1.0.0)
                                                 cl_khr_fp16                                                      0x400000 (1.0.0)
                                                 cl_khr_icd                                                       0x400000 (1.0.0)
                                                 cl_khr_egl_image                                                 0x400000 (1.0.0)
                                                 cl_khr_image2d_from_buffer                                       0x400000 (1.0.0)
                                                 cl_khr_depth_images                                              0x400000 (1.0.0)
                                                 cl_khr_il_program                                                0x400000 (1.0.0)
                                                 cl_khr_priority_hints                                            0x400000 (1.0.0)
                                                 cl_khr_create_command_queue                                      0x400000 (1.0.0)
                                                 cl_khr_spirv_no_integer_wrap_decoration                          0x400000 (1.0.0)
                                                 cl_khr_extended_versioning                                       0x400000 (1.0.0)
                                                 cl_arm_core_id                                                   0x400000 (1.0.0)
                                                 cl_arm_printf                                                    0x400000 (1.0.0)
                                                 cl_arm_thread_limit_hint                                         0x400000 (1.0.0)
                                                 cl_arm_non_uniform_work_group_size                               0x400000 (1.0.0)
                                                 cl_arm_import_memory                                             0x400000 (1.0.0)
                                                 cl_arm_import_memory_dma_buf                                     0x400000 (1.0.0)
                                                 cl_arm_import_memory_host                                        0x400000 (1.0.0)
                                                 cl_arm_import_memory_android_hardware_buffer                     0x400000 (1.0.0)

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-G72 r0p1
 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-G72 r0p1
 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-G72 r0p1
root@localhost:~/clinfo#

What is your android version?

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

@Saikatsaha1996
Android 11

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

@Saikatsaha1996 Android 11

Same android 11 but don't know why I am facing this problem

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

Probably cause weird implementations by android vendors

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

Probably cause weird implementations by android vendors

Any solution available for this ?

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

Can you describe error you got?

Any fresh screenshots!

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

Can you describe error you got?

Any fresh screenshots!

Screenshot_2022-01-24-16-30-38-771_com termux

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

Ok I'll start looking about this!

Oky thank you waiting 😃✋

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

@Saikatsaha1996
your screenshot shows there is a missing library called libcutils.so which is supposed be in /system/vendor/lib64 or /system/lib64
but in termux it ran successfully ( bit tricky )

try

ls /system/lib64/*cutils*

or

ls /system/lib64/*cutils*

it shows you some valid output

as of my previous answer, I tried clinfo in a Redmi phone with android 11 but I can't recreate your issue

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

here is clinfo result in a redmi device
img clinfo
e

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

ls /system/lib64/cutils
Screenshot_2022-01-24-18-48-29-931_com termux

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

here is clinfo result in a redmi device img clinfo e

Screenshot_2022-01-24-18-55-47-670_com termux

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

here is clinfo result in a redmi device img clinfo e

Now problem is solved.. without build-essential PKG clinfo compiling successfully.. but with build-essential PKG clinfo can't compile..

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

Oh!!

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

Oh!!

Actually i am not professional that's why facing problem

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

@Saikatsaha1996
Here is the reason:

I backtraced some events to find out what made it happen
in all successful screenshots, gcc of termux was acting as a compiler

proot-distro binds ~/../usr/bin by default, when this binding is in place termux binaries are available in udroid too and binaries in /usr/bin inside proot hold a high priority to get executed when called

the reason for the error in your device was gcc already installed and it took priority over termux gcc. as gcc in udroid made for traditional Linux fs hierarchy and implementation, it will fail. in my case I used fresh ubuntu without any build-essentials installed ( including gcc ) this caused make software to use gcc of termux which is the only one available in PATH env variable

so only termux GCC can compile clinfo without additional options

You can know which gcc is acting as compiler with command which gcc
it it starts with /data/data/com.termux/..... then its a termux binaries else its belongs to distro you using

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

@Saikatsaha1996 Here is the reason:

I backtraced some events to find out what made it happen in all successful screenshots, gcc of termux was acting as a compiler

proot-distro binds ~/../usr/bin by default, when this binding is in place termux binaries are available in udroid too and binaries in /usr/bin inside proot hold a high priority to get executed when called

the reason for the error in your device was gcc already installed and it took priority over termux gcc. as gcc in udroid made for traditional Linux fs hierarchy and implementation, it will fail. in my case I used fresh ubuntu without any build-essentials installed ( including gcc ) this caused make software to use gcc of termux which is the only one available in PATH env variable

so only termux GCC can compile clinfo without additional options

You can which gcc is acting with command which gcc it it starts with /data/data/com.termux/..... then its a termux binaries else its belongs to distro you using

Yes now i understand .. when i installed bbuild-essential can't compile Linux and android..

Mey be it will possible with ndk

from ubuntu-on-android.

SaicharanKandukuri avatar SaicharanKandukuri commented on May 18, 2024

but clinfo avalible in termux repo fails to load all details which happens to be compiled with ndk

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

but clinfo avalible in termux repo fails to load all details which happens to be compiled with ndk

yes also clvk PKG also available OpenCL and vulkan driver .. but it fail because to many bugs available

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

but clinfo avalible in termux repo fails to load all details which happens to be compiled with ndk

And one thik your GPU is very good 👌

from ubuntu-on-android.

stale avatar stale commented on May 18, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from ubuntu-on-android.

stale avatar stale commented on May 18, 2024

Time to close this BrownSpiffyEmperorshrimp-size_restricted

from ubuntu-on-android.

Saikatsaha1996 avatar Saikatsaha1996 commented on May 18, 2024

@Saikatsaha1996 Here is the reason:

I backtraced some events to find out what made it happen in all successful screenshots, gcc of termux was acting as a compiler

proot-distro binds ~/../usr/bin by default, when this binding is in place termux binaries are available in udroid too and binaries in /usr/bin inside proot hold a high priority to get executed when called

the reason for the error in your device was gcc already installed and it took priority over termux gcc. as gcc in udroid made for traditional Linux fs hierarchy and implementation, it will fail. in my case I used fresh ubuntu without any build-essentials installed ( including gcc ) this caused make software to use gcc of termux which is the only one available in PATH env variable

so only termux GCC can compile clinfo without additional options

You can know which gcc is acting as compiler with command which gcc it it starts with /data/data/com.termux/..... then its a termux binaries else its belongs to distro you using

Can you find any solution about OpenCL available with build-essential pkg ?

from ubuntu-on-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.