Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can it support OpenCL acceleration? #89

Closed
Saikatsaha1996 opened this issue Dec 12, 2021 · 38 comments
Closed

Can it support OpenCL acceleration? #89

Saikatsaha1996 opened this issue Dec 12, 2021 · 38 comments
Assignees
Labels
question Further information is requested stale issue is inactive for long time

Comments

@Saikatsaha1996
Copy link

Help wanted
Directly in termux OpenCL successful
But termux-linux i can
Any solution for this ?

@Saikatsaha1996 Saikatsaha1996 added the question Further information is requested label Dec 12, 2021
@Saikatsaha1996
Copy link
Author

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?

@Saikatsaha1996
Copy link
Author

Waiting for your valuable time 🙂 thanks

@SaicharanKandukuri
Copy link
Member

Nope OpenCl won't work for now!

@Saikatsaha1996
Copy link
Author

Saikatsaha1996 commented Dec 13, 2021

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

@SaicharanKandukuri
Copy link
Member

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

Need upgrades from termux org!

@SaicharanKandukuri SaicharanKandukuri added the wontfix This will not be worked on label Dec 21, 2021
@stale
Copy link

stale bot commented Dec 31, 2021

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.

@stale stale bot added the stale issue is inactive for long time label Dec 31, 2021
@Saikatsaha1996
Copy link
Author

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

@SaicharanKandukuri
Copy link
Member

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

@Saikatsaha1996
Copy link
Author

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

@SaicharanKandukuri
Copy link
Member

SaicharanKandukuri commented Jan 22, 2022

it uses a different method to achieve hardware acceleration

full acceleration in proot is yet to come

may take some months or more

@Saikatsaha1996
Copy link
Author

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

@SaicharanKandukuri SaicharanKandukuri removed wontfix This will not be worked on stale issue is inactive for long time labels Jan 24, 2022
@SaicharanKandukuri
Copy link
Member

SaicharanKandukuri commented Jan 24, 2022

@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#

@Saikatsaha1996
Copy link
Author

@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 🤩🤩🤩🤩

@Saikatsaha1996
Copy link
Author

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

@Saikatsaha1996
Copy link
Author

@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?

@SaicharanKandukuri
Copy link
Member

@Saikatsaha1996
Android 11

@Saikatsaha1996
Copy link
Author

@Saikatsaha1996 Android 11

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

@SaicharanKandukuri
Copy link
Member

SaicharanKandukuri commented Jan 24, 2022

Probably cause weird implementations by android vendors

@Saikatsaha1996
Copy link
Author

Probably cause weird implementations by android vendors

Any solution available for this ?

@SaicharanKandukuri
Copy link
Member

Can you describe error you got?

Any fresh screenshots!

@Saikatsaha1996
Copy link
Author

Can you describe error you got?

Any fresh screenshots!

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

@SaicharanKandukuri
Copy link
Member

Ok
I'll start looking about this!

@Saikatsaha1996
Copy link
Author

Ok I'll start looking about this!

Oky thank you waiting 😃✋

@SaicharanKandukuri
Copy link
Member

@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

@SaicharanKandukuri
Copy link
Member

here is clinfo result in a redmi device
img clinfo
e

@Saikatsaha1996
Copy link
Author

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

@Saikatsaha1996
Copy link
Author

here is clinfo result in a redmi device img clinfo e

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

@Saikatsaha1996
Copy link
Author

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

@SaicharanKandukuri
Copy link
Member

Oh!!

@Saikatsaha1996
Copy link
Author

Oh!!

Actually i am not professional that's why facing problem

@SaicharanKandukuri
Copy link
Member

SaicharanKandukuri commented Jan 24, 2022

@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

@Saikatsaha1996
Copy link
Author

@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

@SaicharanKandukuri
Copy link
Member

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

@Saikatsaha1996
Copy link
Author

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

@Saikatsaha1996
Copy link
Author

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 👌

@stale
Copy link

stale bot commented Feb 3, 2022

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.

@stale stale bot added the stale issue is inactive for long time label Feb 3, 2022
@stale
Copy link

stale bot commented Feb 10, 2022

Time to close this BrownSpiffyEmperorshrimp-size_restricted

@stale stale bot closed this as completed Feb 10, 2022
@Saikatsaha1996
Copy link
Author

@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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale issue is inactive for long time
Projects
None yet
Development

No branches or pull requests

2 participants