Hi All.
What should I do to modify the amount of CL_DEVICE_GLOBAL_MEM_SIZE?
I am trying to use Darknet_On_OpenCL(using yolov3-tiny.cfg and yolov3-tiny.weights) on i.mx8mq.
but I got this error after executing the command.
[command]
./darknet detect cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg
[error]
OpenCL error -5 on line 269 of /home/user/work/directory/clBLAS/src/library/blas/xgemm.cc
darknet: /home/user/work/directory/clBLAS/src/library/blas/xgemm.cc:269: void makeGemmKernel(_cl_kernel**, cl_command_queue, const char*, const char*, const unsigned char**, size_t*, const char*): Assertion `false' failed.
Aborted (core dumped)
I think that the cause of the error is CL_DEVICE_GLOBAL_MEM_SIZE is too small.
I increased galcore.contiguousSize to 838860800B.
CL_DEVICE_GLOBAL_MEM_SIZE is 268435456B.
[OpenCL Info]
root@imx8mqevk:~# /opt/imx-gpu-sdk/OpenCL/Info/Info
Dumping platform info for 1 platforms.
*** Platform #0 ***
Platform version: 1.2
CL_PLATFORM_PROFILE: FULL_PROFILE
CL_PLATFORM_VERSION: OpenCL 1.2 V6.2.4.p4.190076
CL_PLATFORM_NAME: Vivante OpenCL Platform
CL_PLATFORM_VENDOR: Vivante Corporation
CL_PLATFORM_EXTENSIONS: cl_khr_icd
Dumping detailed device info for 1 platforms.
*** Platform #0 ***
Platform version: 1.2
CL_PLATFORM_PROFILE: FULL_PROFILE
CL_PLATFORM_VERSION: OpenCL 1.2 V6.2.4.p4.190076
CL_PLATFORM_NAME: Vivante OpenCL Platform
CL_PLATFORM_VENDOR: Vivante Corporation
CL_PLATFORM_EXTENSIONS: cl_khr_icd
Enumerating devices of type: CL_DEVICE_TYPE_CPU
- Not supported
Enumerating devices of type: CL_DEVICE_TYPE_GPU
--- Device #0 ---
Device version: 1.2
CL_DEVICE_ADDRESS_BITS: 32
CL_DEVICE_AVAILABLE: 1
CL_DEVICE_BUILT_IN_KERNELS:
CL_DEVICE_COMPILER_AVAILABLE: 1
CL_DEVICE_DOUBLE_FP_CONFIG: 0
CL_DEVICE_ENDIAN_LITTLE: 1
CL_DEVICE_ERROR_CORRECTION_SUPPORT: 1
CL_DEVICE_EXECUTION_CAPABILITIES: 1
CL_DEVICE_EXTENSIONS: cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_gl_sharing
CL_DEVICE_GLOBAL_MEM_CACHE_SIZE: 8192
CL_DEVICE_GLOBAL_MEM_CACHE_TYPE: 2
CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE: 8589934656
CL_DEVICE_GLOBAL_MEM_SIZE: 268435456
CL_DEVICE_HALF_FP_CONFIG: 0
CL_DEVICE_HOST_UNIFIED_MEMORY: 1
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 8192
CL_DEVICE_IMAGE2D_MAX_WIDTH: 8192
CL_DEVICE_IMAGE3D_MAX_DEPTH: 8192
CL_DEVICE_IMAGE3D_MAX_HEIGHT: 8192
CL_DEVICE_IMAGE3D_MAX_WIDTH: 8192
CL_DEVICE_IMAGE_MAX_BUFFER_SIZE: 65536
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 8192
CL_DEVICE_LINKER_AVAILABLE: 1
CL_DEVICE_LOCAL_MEM_SIZE: 32768
CL_DEVICE_LOCAL_MEM_TYPE: 2
CL_DEVICE_MAX_CLOCK_FREQUENCY: 800
CL_DEVICE_MAX_COMPUTE_UNITS: 1
CL_DEVICE_MAX_CONSTANT_ARGS: 9
CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE: 65536
CL_DEVICE_MAX_MEM_ALLOC_SIZE: 134217728
CL_DEVICE_MAX_PARAMETER_SIZE: 1024
CL_DEVICE_MAX_READ_IMAGE_ARGS: 128
CL_DEVICE_MAX_SAMPLERS: 16
CL_DEVICE_MAX_WORK_GROUP_SIZE: 1024
CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS: 3
CL_DEVICE_MAX_WORK_ITEM_SIZES: 1024, 1024, 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
CL_DEVICE_MAX_WRITE_IMAGE_ARGS: 8
CL_DEVICE_MEM_BASE_ADDR_ALIGN: 1024
CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE: 128
CL_DEVICE_NAME: Vivante OpenCL Device GC7000L.6214.0000
CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR: 4
CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT: 4
CL_DEVICE_NATIVE_VECTOR_WIDTH_INT: 4
CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG: 4
CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT: 4
CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE: 0
CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF: 0
CL_DEVICE_OPENCL_C_VERSION: OpenCL C 1.2
CL_DEVICE_PARENT_DEVICE: 0
CL_DEVICE_PARTITION_MAX_SUB_DEVICES: 0
CL_DEVICE_PARTITION_PROPERTIES: 0, 0, 0, 0
CL_DEVICE_PARTITION_AFFINITY_DOMAIN: 0
CL_DEVICE_PARTITION_TYPE: 0, 0, 0, 0
CL_DEVICE_PLATFORM: 0xffffa8732f28
CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR: 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT: 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT: 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG: 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT: 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE: 0
CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF: 0
CL_DEVICE_PRINTF_BUFFER_SIZE: 1048576
CL_DEVICE_PREFERRED_INTEROP_USER_SYNC: 1
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_PROFILING_TIMER_RESOLUTION: 1000
CL_DEVICE_QUEUE_PROPERTIES: 3
CL_DEVICE_REFERENCE_COUNT: 1
CL_DEVICE_SINGLE_FP_CONFIG: 14
CL_DEVICE_TYPE: CL_DEVICE_TYPE_GPU
CL_DEVICE_VENDOR: Vivante Corporation
CL_DEVICE_VENDOR_ID: 5654870
CL_DEVICE_VERSION: OpenCL 1.2
CL_DRIVER_VERSION: OpenCL 1.2 V6.2.4.p4.190076
Enumerating devices of type: CL_DEVICE_TYPE_ACCELERATOR
- Not supported
Enumerating devices of type: CL_DEVICE_TYPE_CUSTOM
- Not supported
Enumerating devices of type: CL_DEVICE_TYPE_ALL
--- Device #0 ---
Device version: 1.2
CL_DEVICE_ADDRESS_BITS: 32
CL_DEVICE_AVAILABLE: 1
CL_DEVICE_BUILT_IN_KERNELS:
CL_DEVICE_COMPILER_AVAILABLE: 1
CL_DEVICE_DOUBLE_FP_CONFIG: 0
CL_DEVICE_ENDIAN_LITTLE: 1
CL_DEVICE_ERROR_CORRECTION_SUPPORT: 1
CL_DEVICE_EXECUTION_CAPABILITIES: 1
CL_DEVICE_EXTENSIONS: cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_gl_sharing
CL_DEVICE_GLOBAL_MEM_CACHE_SIZE: 8192
CL_DEVICE_GLOBAL_MEM_CACHE_TYPE: 2
CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE: 8589934656
CL_DEVICE_GLOBAL_MEM_SIZE: 268435456
CL_DEVICE_HALF_FP_CONFIG: 0
CL_DEVICE_HOST_UNIFIED_MEMORY: 1
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 8192
CL_DEVICE_IMAGE2D_MAX_WIDTH: 8192
CL_DEVICE_IMAGE3D_MAX_DEPTH: 8192
CL_DEVICE_IMAGE3D_MAX_HEIGHT: 8192
CL_DEVICE_IMAGE3D_MAX_WIDTH: 8192
CL_DEVICE_IMAGE_MAX_BUFFER_SIZE: 65536
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 8192
CL_DEVICE_LINKER_AVAILABLE: 1
CL_DEVICE_LOCAL_MEM_SIZE: 32768
CL_DEVICE_LOCAL_MEM_TYPE: 2
CL_DEVICE_MAX_CLOCK_FREQUENCY: 800
CL_DEVICE_MAX_COMPUTE_UNITS: 1
CL_DEVICE_MAX_CONSTANT_ARGS: 9
CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE: 65536
CL_DEVICE_MAX_MEM_ALLOC_SIZE: 134217728
CL_DEVICE_MAX_PARAMETER_SIZE: 1024
CL_DEVICE_MAX_READ_IMAGE_ARGS: 128
CL_DEVICE_MAX_SAMPLERS: 16
CL_DEVICE_MAX_WORK_GROUP_SIZE: 1024
CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS: 3
CL_DEVICE_MAX_WORK_ITEM_SIZES: 1024, 1024, 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
CL_DEVICE_MAX_WRITE_IMAGE_ARGS: 8
CL_DEVICE_MEM_BASE_ADDR_ALIGN: 1024
CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE: 128
CL_DEVICE_NAME: Vivante OpenCL Device GC7000L.6214.0000
CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR: 4
CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT: 4
CL_DEVICE_NATIVE_VECTOR_WIDTH_INT: 4
CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG: 4
CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT: 4
CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE: 0
CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF: 0
CL_DEVICE_OPENCL_C_VERSION: OpenCL C 1.2
CL_DEVICE_PARENT_DEVICE: 0
CL_DEVICE_PARTITION_MAX_SUB_DEVICES: 0
CL_DEVICE_PARTITION_PROPERTIES: 0, 0, 0, 0
CL_DEVICE_PARTITION_AFFINITY_DOMAIN: 0
CL_DEVICE_PARTITION_TYPE: 0, 0, 0, 0
CL_DEVICE_PLATFORM: 0xffffa8732f28
CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR: 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT: 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT: 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG: 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT: 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE: 0
CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF: 0
CL_DEVICE_PRINTF_BUFFER_SIZE: 1048576
CL_DEVICE_PREFERRED_INTEROP_USER_SYNC: 1
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_PROFILING_TIMER_RESOLUTION: 1000
CL_DEVICE_QUEUE_PROPERTIES: 3
CL_DEVICE_REFERENCE_COUNT: 1
CL_DEVICE_SINGLE_FP_CONFIG: 14
CL_DEVICE_TYPE: CL_DEVICE_TYPE_GPU
CL_DEVICE_VENDOR: Vivante Corporation
CL_DEVICE_VENDOR_ID: 5654870
CL_DEVICE_VERSION: OpenCL 1.2
CL_DRIVER_VERSION: OpenCL 1.2 V6.2.4.p4.190076
I hope you will be able to provide the information.
Hello Katsuaki,
If you have more than 4GB in your system then export GPU_MAX_ALLOC_PERCENT=100 - get all 2GB.
If you don´t have you can raise it by changing GPU_MAX_HEAP_SIZE and GPU_MAX_ALLOC_SIZE environment variables.
regards
Hi, Bio
I tried setting These environment variables and execute Darknet_On_OpenCL.
To check if CL_DEVICE_GLOBAL_MEM_SIZE is increased, I added to this code in Darknet_On_OpenCL.
[adding code]
cl_ulong max_mem_alloc_size;
clGetDeviceInfo(clDevice, CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(max_mem_alloc_size), &max_mem_alloc_size, NULL);
printf("CL_DEVICE_GLOBAL_MEM_SIZE :\t\t%u MByte\n", (unsigned int)(max_mem_alloc_size / (1024 * 1024)));
[result]
CL_DEVICE_GLOBAL_MEM_SIZE : 256 MByte
It looks like CL_DEVICE_GLOBAL_MEM_SIZE is not increased.
And I tried to find these environment variables using strings command.
But I could not find them.
[command]
$ strings -a /usr/lib/libVivanteOpenCL.so | grep GPU
[result]
gcoCL_MultiGPUSync
Error: OCL-002005: (clCreateContextFromType) DeviceType (0x%x) is not CL_DEVICE_TYPE_GPU or CL_DEVICE_TYPE_DEFAULT
gcvPATCH_SILICONSTUDIOGPUMARK
gcvENGINE_GPU_ENGINE_COUNT
gcvPATCH_GPUBENCH
gcvSTATUS_GPU_NOT_RESPONDING
gcvOPTION_GPU_TEX_UPLOAD
gcvOPTION_GPU_BUFOBJ_UPLOAD
gcvFEATURE_MULTIGPU_SYNC_V3
gcvFEATURE_MULTIGPU_SYNC_V2
gcoCL_MultiGPUSync
gcoCL_MultiGPUSync
Is OpenCL version different? Using OpenCL varsion is 1.2 on GC7000lite.
Are there how to increase CL_DEVICE_GLOBAL_MEM_SIZE others?
regards