Altera_Forum
Honored Contributor
10 years agoOpenCL memory hang on custom platform
We are porting the OpenCL platform to a custom Cyclone V board. Have successfully compiled the OpenCL framework into an FPGA binary (RBF) and is currently loaded on the system. The CMA modules are built into the Linux kernel and the OpenCL host driver module has been recompiled and loaded into the system. DTS changes from the FPGA design are in the process of being merged into the Linux build.
‘aocl diagnose’ returns successful and simple OpenCL program that don’t involve memory transactions complete but we are experiencing issues with programs that copy memory buffers. Simple OpenCL examples like a vector addition that copy a memory buffer never reach clFinish … they hang. These simple programs will execute on C5SOC platform so we are looking into our design. Right now we are comparing the C5SOC FPGA design with the custom implementation and looking through Linux host driver code. Was wondering if there was a place in particular that we should look into regarding memory buffer transfer issues in OpenCL. Any insight you can give is greatly appreciated. Thanks, Chad Hewitt root@avid-cyclone5:~# aocl diagnose aocl diagnose: Running diagnostic from /home/root/opencl_arm32_rte/board/avid_alpha/arm32/bin Verified that the kernel mode driver is installed on the host machine. Using platform: Altera SDK for OpenCL Board vendor name: Altera Corporation Board name: avid_alpha : Cyclone V SoC Development Kit Buffer read/write test passed. diagnostic_passed root@avid-cyclone5:~# root@avid-cyclone5:~# ./hello_world Compiled by Randy - 7/22/2015 10:00 AM Querying platform for info: ========================== CL_PLATFORM_NAME = Altera SDK for OpenCL CL_PLATFORM_VENDOR = Altera Corporation CL_PLATFORM_VERSION = OpenCL 1.0 Altera SDK for OpenCL, Version 15.0 Querying device for info: ======================== CL_DEVICE_NAME = avid_alpha : Cyclone V SoC Development Kit CL_DEVICE_VENDOR = Altera Corporation CL_DEVICE_VENDOR_ID = 4466 CL_DEVICE_VERSION = OpenCL 1.0 Altera SDK for OpenCL, Version 15.0 CL_DRIVER_VERSION = 15.0 CL_DEVICE_ADDRESS_BITS = 64 CL_DEVICE_AVAILABLE = true CL_DEVICE_ENDIAN_LITTLE = true CL_DEVICE_GLOBAL_MEM_CACHE_SIZE = 32768 CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE = 0 CL_DEVICE_GLOBAL_MEM_SIZE = 536870912 CL_DEVICE_IMAGE_SUPPORT = false CL_DEVICE_LOCAL_MEM_SIZE = 16384 CL_DEVICE_MAX_CLOCK_FREQUENCY = 1000 CL_DEVICE_MAX_COMPUTE_UNITS = 1 CL_DEVICE_MAX_CONSTANT_ARGS = 8 CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 134217728 CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = 3 CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = 8192 CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE = 1024 CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR = 4 CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT = 2 CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT = 1 CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG = 1 CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT = 1 CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE = 0 Command queue out of order? = false Command queue profiling enabled? = true Using AOCX: hello_world.aocx Reprogramming device with handle 1 Kernel initialization is complete. Launching the kernel... Thread# 0: Hello from Altera's OpenCL Compiler! Compiled by Randy - 7/22/2015 10:00 AM kernel execution is complete. root@avid-cyclone5:~# ./vector_add Compiled by Randy - 7/30/2015 10:00 AM Initializing OpenCL Platform: Altera SDK for OpenCL Using 1 device(s) avid_alpha : Cyclone V SoC Development Kit Using AOCX: vector_add.aocx Reprogramming device with handle 1 Launching for device 0 (1000000 elements) waiting for the queue. (never completes)