UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
854 Views
Registered: ‎04-17-2012

Out of memory when running OpenCL application on ZCU102

Jump to solution

Hi,
I have a custom OpenCL application targeting the ZCU102 device.
Emulation runs fine and the FPGA binary is built correctly but execution fails.

Any advice on how to find the cause of this "Out of memory: Kill process XXX" problem ?

 

root@zcu102:/mnt# source ./init.sh
insmod: can't insert '/mnt/zocl.ko': File exists
root@zcu102:/mnt# export XILINX_OPENCL=/mnt/embedded_root/
root@zcu102:/mnt#
root@zcu102:/mnt# time ./pointcloud2_to_image_fpga
init
done

platform Name: Xilinx
Vendor Name : Xilinx
Found Platform
XCLBIN File Name: pointcloud2_to_image
INFO: Importing ./pointcloud2_to_image.xclbin
Loading: './pointcloud2_to_image.xclbin'
[ 1467.541436] zocl-scheduler- invoked oom-killer: gfp_mask=0x16040c0(GFP_KERNEL|__GFP_COMP|__GFP_NOTRACK), nodemask=(null), order=0, oom_score_adj=0
[ 1467.554598] CPU: 1 PID: 2334 Comm: zocl-scheduler- Tainted: G O 4.14.0 #3
[ 1467.562473] Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
[ 1467.567418] Call trace:
[ 1467.569857] [<ffffff8008088c58>] dump_backtrace+0x0/0x368
[ 1467.575234] [<ffffff8008088fd4>] show_stack+0x14/0x20
[ 1467.580270] [<ffffff80089ecb78>] dump_stack+0x9c/0xbc
[ 1467.585304] [<ffffff800813b248>] dump_header.isra.6+0x7c/0x194
[ 1467.591119] [<ffffff800813a8b8>] oom_kill_process+0x280/0x500
[ 1467.596848] [<ffffff800813ae68>] out_of_memory+0xe0/0x3e8
[ 1467.602231] [<ffffff800813fed8>] __alloc_pages_nodemask+0xa20/0xad8
[ 1467.608483] [<ffffff8008187634>] cache_alloc_refill+0xd4/0x690
[ 1467.614297] [<ffffff8008187d68>] kmem_cache_alloc+0xa0/0xd0
[ 1467.619854] [<ffffff8008174304>] alloc_vmap_area.isra.9+0x64/0x350
[ 1467.626017] [<ffffff8008174684>] __get_vm_area_node.isra.10+0x94/0x198
[ 1467.632527] [<ffffff80081750c4>] get_vm_area_caller+0x34/0x40
[ 1467.638257] [<ffffff8008095db8>] __ioremap_caller+0x68/0xf0
[ 1467.643811] [<ffffff8008095e50>] __ioremap+0x10/0x18
[ 1467.648769] [<ffffff8000a18148>] penguin_query+0x70/0x210 [zocl]
[ 1467.654757] [<ffffff8000a1863c>] scheduler+0x19c/0x410 [zocl]
[ 1467.660480] [<ffffff80080b908c>] kthread+0x12c/0x130
[ 1467.665427] [<ffffff8008084a90>] ret_from_fork+0x10/0x18
[ 1467.670740] Mem-Info:
[ 1467.672990] active_anon:20233 inactive_anon:3634 isolated_anon:0
[ 1467.672990] active_file:35 inactive_file:0 isolated_file:0
[ 1467.672990] unevictable:0 dirty:1 writeback:0 unstable:0
[ 1467.672990] slab_reclaimable:1111 slab_unreclaimable:667662
[ 1467.672990] mapped:1974 shmem:6015 pagetables:140 bounce:0
[ 1467.672990] free:271683 free_pcp:412 free_cma:258523
[ 1467.706186] Node 0 active_anon:80932kB inactive_anon:14536kB active_file:140kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:7896kB dirty:4kB writeback:0kB shmem:24060kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? yes
[ 1467.733164] DMA free:1064156kB min:22384kB low:27980kB high:33576kB active_anon:6316kB inactive_anon:0kB active_file:0kB inactive_file:4kB unevictable:0kB writepending:0kB present:2096128kB managed:2014576kB mlocked:0kB kernel_stack:16kB pagetables:8kB bounce:0kB free_pcp:800kB local_pcp:0kB free_cma:1034092kB
[ 1467.760589] lowmem_reserve[]: 0 1985 1985
[ 1467.764573] Normal free:22576kB min:22668kB low:28332kB high:33996kB active_anon:74616kB inactive_anon:14536kB active_file:16kB inactive_file:116kB unevictable:0kB writepending:4kB present:2097152kB managed:2032640kB mlocked:0kB kernel_stack:1504kB pagetables:552kB bounce:0kB free_pcp:844kB local_pcp:0kB free_cma:0kB
[ 1467.792622] lowmem_reserve[]: 0 0 0
[ 1467.796080] DMA: 1135*4kB (UMEC) 1370*8kB (UMEC) 657*16kB (UMEC) 134*32kB (UMC) 2*64kB (UC) 4*128kB (C) 2*256kB (C) 1*512kB (C) 2*1024kB (C) 3*2048kB (C) 250*4096kB (C) = 1064156kB
[ 1467.812151] Normal: 1076*4kB (UME) 1501*8kB (ME) 338*16kB (UME) 29*32kB (UM) 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 22648kB
[ 1467.825086] 6053 total pagecache pages
[ 1467.828800] 0 pages in swap cache
[ 1467.832105] Swap cache stats: add 0, delete 0, find 0/0
[ 1467.837312] Free swap = 0kB
[ 1467.840170] Total swap = 0kB
[ 1467.843042] 1048320 pages RAM
[ 1467.845991] 0 pages HighMem/MovableOnly
[ 1467.849813] 36516 pages reserved
[ 1467.853024] 262144 pages cma reserved
[ 1467.856742] Out of memory: Kill process 2535 (pointcloud2_to_) score 17 or sacrifice child
[ 1467.864954] Killed process 2535 (pointcloud2_to_) total-vm:539476kB, anon-rss:67496kB, file-rss:8kB, shmem-rss:4268kB
Killed

real 2m29.051s
user 1m2.635s
sys 0m37.160s

 

 


Best,
L30nardo SV
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
780 Views
Registered: ‎08-20-2018

Re: Out of memory when running OpenCL application on ZCU102

Jump to solution

Hi @leonardo.solis

Okay. I will verify this issue. meanwhile let me provide you a patch for 2018.2

 

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
818 Views
Registered: ‎08-20-2018

Re: Out of memory when running OpenCL application on ZCU102

Jump to solution

Hi @leonardo.solis

This is a known issue. It is fixed in 2018.3

Kindly try with 2018.3 release.

If issue still persists, kindly let us know.

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Contributor
Contributor
802 Views
Registered: ‎04-17-2012

Re: Out of memory when running OpenCL application on ZCU102

Jump to solution

Hi @nutang,

Many thanks for the quick reply.

We have installed v2018.3 but couldn't build even the "hello_world" example: https://github.com/Xilinx/SDSoC_Examples/tree/master/ocl/getting_started/hello_vadd_ocl.

The reason is that the OpenCL headers and other files required for building are simply missing within the v2018.3 installation path. To give you an idea, here is a comparison wrt to v2018.2:

% ls 2018.2/runtime/include/1_2/CL/
cl2.hpp     cl_d3d11.h              cl_ext.h     cl_gl.h cl.hpp         opencl.h
cl_d3d10.h  cl_dx9_media_sharing.h  cl_gl_ext.h  cl.h cl_platform.h

% ls 2018.3/runtime/include/1_2/CL/
ls: cannot access '2018.3/runtime/include/1_2/CL/': No such file or directory

% ls 2018.2/runtime/lib/aarch64/
libxilinxopencl.so

% ls 2018.3/runtime/lib/aarch64/
ls: cannot access '2018.3/runtime/lib/aarch64/': No such file or directory

I have searched those files under the whole 2018.3 installation path but couldn't find any of them.

The installation process finished successfully so: is there is any additional step for obtaining the runtime files for SDSoC?

I have read that for SDAccel boards, runtime files should be downloaded separately:

https://forums.xilinx.com/t5/SDAccel/SDAccel-2018-3-examples-Error-XILINX-XRT-is-not-defined/td-p/921905

Any hint would be really apprecciated!

Leonardo


Best,
L30nardo SV
0 Kudos
Xilinx Employee
Xilinx Employee
781 Views
Registered: ‎08-20-2018

Re: Out of memory when running OpenCL application on ZCU102

Jump to solution

Hi @leonardo.solis

Okay. I will verify this issue. meanwhile let me provide you a patch for 2018.2

 

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Contributor
Contributor
767 Views
Registered: ‎04-17-2012

Re: Out of memory when running OpenCL application on ZCU102

Jump to solution

Hi @nutang,

Yes, meanwhile a patch would be nice for 2018.2. 

Either privately or a publicly sharing it would be fine for me.

Thanks!

Leonardo

 


Best,
L30nardo SV
0 Kudos
Visitor abperina
Visitor
189 Views
Registered: ‎03-11-2019

Re: Out of memory when running OpenCL application on ZCU102

Jump to solution

Dear all,

could you please share this patch with me as well? I have been using 2018.2 for some time, I tried to install 2018.3 but I have the same issues as here mentioned here to find the opencl platforms. Furthermore I am afraid to try to make it work and break other OpenCL installations that I have in my system.

 

Thank you very much :)

0 Kudos