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
3,246 Views
Registered: ‎03-08-2018

My SDx IDE can't run the printf example code

Jump to solution

Dear all,

 

I had run both two examples "misc > vadd" and "debug > debug_printf_ocl".

The vadd works very well at all target modes - emul-sw / emul-hw / system -.

But the debug_printf_ocl have a problem at run time even if emul-sw target mode.

 

There are console's messages.

 

Found Platform
Platform Name: Xilinx
XCLBIN File Name: vadd
INFO: Importing ../vadd.xclbin
Loading: '../vadd.xclbin'
CPU emulation compute unit exited unexpectedly

 

What would do I?

 

Any help will be greatly appreciated.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
Contributor
Contributor
3,291 Views
Registered: ‎03-08-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

Thank remy561,

 

Finally, I understood what to do.

What I did,

$ cd /opt/Xilinx/SDx/2017.4/gnu/binutils/bin
$ ln -s /usr/bin/objcopy objcopy   ## after backup objcopy binary file

And I do "make clean" and "run on sw-emu target".

The printf works well.

 

22 Replies
Xilinx Employee
Xilinx Employee
3,208 Views
Registered: ‎07-12-2017

Re: My SDx IDE can't run the printf example code

Jump to solution

Hi Yilee,

 

I am not able to reproduce this at my end in SDx IDE. Could you please tell which release you are trying the example with ?

0 Kudos
Contributor
Contributor
3,178 Views
Registered: ‎03-08-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

I was trying with SDx 2017.4 and KCU1500 board.

This symptom showed my co-worker as well.

 

Currently I am trying to run by root account.

I have another problem (build well but not run) and I guess my SDx's environments have some faults.

 

If you know other information, let me know.

 

Thanks.

0 Kudos
Contributor
Contributor
3,170 Views
Registered: ‎03-08-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

These are my results of running.

Emulation SW and System are failed.

Emulation HW is succeeded.

 

== Emulation SW ==
Found Platform
Platform Name: Xilinx
XCLBIN File Name: vadd
INFO: Importing ../vadd.xclbin
Loading: '../vadd.xclbin'
CPU emulation compute unit exited unexpectedly

 

== Emulation HW ==
Found Platform
Platform Name: Xilinx
XCLBIN File Name: vadd
INFO: Importing ../vadd.xclbin
Loading: '../vadd.xclbin'
INFO: [SDx-EM 01] Hardware emulation runs detailed simulation underneath. It may take long time for large data set. Please use a small dataset for faster execution. You can still get performance trend for your kernel with smaller dataset.
** Printing from inside krnl_vadd: globalid: 0 of 

......

** Checking against expected results and printing every 16th result (in 1024 additions)...

Result Match: i = 0 CPU result = 0 Krnl Result = 0
Result Match: i = 16 CPU result = 160 Krnl Result = 160
Result Match: i = 32 CPU result = 320 Krnl Result = 320
Result Match: i = 48 CPU result = 480 Krnl Result = 480
Result Match: i = 64 CPU result = 640 Krnl Result = 640
Result Match: i = 80 CPU result = 800 Krnl Result = 800
Result Match: i = 96 CPU result = 960 Krnl Result = 960
Result Match: i = 112 CPU result = 1120 Krnl Result = 1120
Result Match: i = 128 CPU result = 1280 Krnl Result = 1280
Result Match: i = 144 CPU result = 1440 Krnl Result = 1440
Result Match: i = 160 CPU result = 1600 Krnl Result = 1600
Result Match: i = 176 CPU result = 1760 Krnl Result = 1760
Result Match: i = 192 CPU result = 1920 Krnl Result = 1920
Result Match: i = 208 CPU result = 2080 Krnl Result = 2080
Result Match: i = 224 CPU result = 2240 Krnl Result = 2240
Result Match: i = 240 CPU result = 2400 Krnl Result = 2400
TEST PASSED

INFO: [SDx-EM 22] [Wall clock time: 10:03, Emulation time: 0.277331 ms] Data transfer between kernel(s) and global memory(s)
BANK0 RD = 16.000 KB WR = 50.000 KB
BANK1 RD = 0.000 KB WR = 0.000 KB
BANK2 RD = 0.000 KB WR = 0.000 KB
BANK3 RD = 0.000 KB WR = 0.000 KB

 

== System ==
09:21:34 **** Incremental Build of configuration System for project ex02 ****
make -j36 incremental
/opt/Xilinx/SDx/2017.4/bin/xcpp -DSDX_PLATFORM=xilinx_kcu1500_dynamic_5_0 -D__USE_XOPEN2K8 -I/root/workspace/ex02/libs/xcl2 -I/opt/Xilinx/SDx/2017.4/runtime/include/1_2/ -I/opt/Xilinx/Vivado/2017.4/include/ -O2 -Wall -c -fmessage-length=0 -std=c++14 -DSDX_PLATFORM=xilinx_kcu1500_dynamic_5_0 -D__USE_XOPEN2K8 -I/root/workspace/ex02/libs/xcl2 -I/opt/Xilinx/SDx/2017.4/runtime/include/1_2/ -I/opt/Xilinx/Vivado/2017.4/include/ -O2 -Wall -c -fmessage-length=0 -o "src/host.o" "../src/host.cpp"
/opt/Xilinx/SDx/2017.4/bin/xcpp -DSDX_PLATFORM=xilinx_kcu1500_dynamic_5_0 -D__USE_XOPEN2K8 -I/root/workspace/ex02/libs/xcl2 -I/opt/Xilinx/SDx/2017.4/runtime/include/1_2/ -I/opt/Xilinx/Vivado/2017.4/include/ -O2 -Wall -c -fmessage-length=0 -std=c++14 -DSDX_PLATFORM=xilinx_kcu1500_dynamic_5_0 -D__USE_XOPEN2K8 -I/root/workspace/ex02/libs/xcl2 -I/opt/Xilinx/SDx/2017.4/runtime/include/1_2/ -I/opt/Xilinx/Vivado/2017.4/include/ -O2 -Wall -c -fmessage-length=0 -o "libs/xcl2/xcl2.o" "../libs/xcl2/xcl2.cpp"
/opt/Xilinx/SDx/2017.4/bin/xocc -t hw --platform xilinx_kcu1500_dynamic_5_0 --save-temps --report system -c -k krnl_vadd --messageDb vadd/krnl_vadd.mdb -I"../src" --xp misc:solution_name=_xocc_compile_vadd_krnl_vadd --xp param:compiler.enableAutoPipelining=false -o"vadd/krnl_vadd.xo" "../src/vadd.cl"

****** xocc v2017.4 (64-bit)
**** SW Build 2086221 on Fri Dec 15 20:54:30 MST 2017
** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

Attempting to get a license: ap_opencl
/opt/Xilinx/SDx/2017.4/bin/xcpp -o "ex02.exe" libs/xcl2/xcl2.o src/host.o -lxilinxopencl -lpthread -lrt -lstdc++ -L/opt/Xilinx/SDx/2017.4/runtime/lib/x86_64 -lxilinxopencl -lpthread -lrt -lstdc++ -L/opt/Xilinx/SDx/2017.4/runtime/lib/x86_64
Feature available: ap_opencl
INFO: [XOCC 60-585] Compiling for hardware target
INFO: [XOCC 60-895] Target platform: /opt/Xilinx/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm
INFO: [XOCC 60-423] Target device: xilinx_kcu1500_dynamic_5_0
INFO: [XOCC 60-242] Creating kernel: 'krnl_vadd'
INFO: [XOCC 60-594] Finished kernel compilation
INFO: [XOCC 60-244] Generating system estimate report...
INFO: [XOCC 60-677] Generated system_estimate.xtxt
INFO: [XOCC 60-586] Created vadd/krnl_vadd.xo
INFO: [XOCC 60-791] Total elapsed time: 0h 0m 59s
/opt/Xilinx/SDx/2017.4/bin/xocc -t hw --platform xilinx_kcu1500_dynamic_5_0 --save-temps --report system -l --nk krnl_vadd:1 --messageDb vadd.mdb --xp misc:solution_name=_xocc_link_vadd --remote_ip_cache /root/workspace/ip_cache -o"vadd.xclbin" vadd/krnl_vadd.xo

 

****** xocc v2017.4 (64-bit)
**** SW Build 2086221 on Fri Dec 15 20:54:30 MST 2017
** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

INFO: [XOCC 60-629] Linking for hardware target
INFO: [XOCC 60-895] Target platform: /opt/Xilinx/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm
INFO: [XOCC 60-897] Reading --xp value from platform: vivado_prop:run.impl_1.STEPS.OPT_DESIGN.TCL.SDXPOST=/root/workspace/ex02/System/_xocc_link_vadd/tcl_hooks/dynamic_postopt.tcl
INFO: [XOCC 60-423] Target device: xilinx_kcu1500_dynamic_5_0
INFO: [XOCC 60-825] xocc command line options for sdx_link are --xo vadd/krnl_vadd.xo --nk krnl_vadd:1 -keep
INFO: [XOCC 60-824] sdx_link command line is sdx_link --xo vadd/krnl_vadd.xo --nk krnl_vadd:1 -keep --xpfm /opt/Xilinx/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm --target hw --output_dir . --temp_dir .
using /opt/Xilinx/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm
extracting xo v3 file /root/workspace/ex02/System/vadd/krnl_vadd.xo
Creating IP database /root/workspace/ex02/System/_sds/.cdb/xd_ip_db.xml
processing accelerators: /root/workspace/ex02/System/iprepo/xilinx_com_hls_krnl_vadd_1_0
ip_dir: /root/workspace/ex02/System/iprepo/xilinx_com_hls_krnl_vadd_1_0
/opt/Xilinx/SDx/2017.4/bin/xsltproc --stringparam xpath "spirit:component/spirit:name/text()" /opt/Xilinx/SDx/2017.4/scripts/xdcc/xpathValueOf.xsl /root/workspace/ex02/System/iprepo/xilinx_com_hls_krnl_vadd_1_0/component.xml
ip_name: krnl_vadd
Creating apsys_0.xml
/opt/Xilinx/SDx/2017.4/bin/cfgen: 4: /opt/Xilinx/SDx/2017.4/bin/cfgen: [[: not found
/opt/Xilinx/SDx/2017.4/bin/cfgen: 4: /opt/Xilinx/SDx/2017.4/bin/cfgen: [[: not found
Port Specs:
Kernel Specs:
kernel: krnl_vadd, num: 1, inst(0): krnl_vadd_1
Pipes:

 

Creating dr.bd.tcl
/opt/Xilinx/SDx/2017.4/bin/cf2xd: 4: /opt/Xilinx/SDx/2017.4/bin/cf2xd: [[: not found
/opt/Xilinx/SDx/2017.4/bin/cf2xd: 4: /opt/Xilinx/SDx/2017.4/bin/cf2xd: [[: not found
INFO: [CF2XD 83-2203] Adding accelerator adapters...
INFO: [CF2XD 83-2200] Adding axi_interconnects...
INFO: [CF2XD 83-2201] Adding axi_stream_router for scatter-gather DMAs...
INFO: [CF2XD 83-2202] Adding axi_dwidth_converters...
INFO: [CF2XD 83-2208] Adding bus connections for logical connections...
INFO: [CF2XD 83-2205] Adding clock connections...
INFO: [CF2XD 83-2206] Adding reset connections...
/opt/Xilinx/SDx/2017.4/bin/cf_xsd: 4: /opt/Xilinx/SDx/2017.4/bin/cf_xsd: [[: not found
/opt/Xilinx/SDx/2017.4/bin/cf_xsd: 4: /opt/Xilinx/SDx/2017.4/bin/cf_xsd: [[: not found
INFO: [XOCC 60-812] xocc command line options for vpl are --xp vivado_prop:run.impl_1.STEPS.OPT_DESIGN.TCL.SDXPOST=/root/workspace/ex02/System/_xocc_link_vadd/tcl_hooks/dynamic_postopt.tcl -t hw -f xilinx_kcu1500_dynamic_5_0 --nk krnl_vadd:1 --xp vivado_prop:run.__KERNEL__.{STEPS.SYNTH_DESIGN.ARGS.MORE OPTIONS}={-directive sdx_optimization_effort_high} --xp param:compiler.enableRunInBitstreamGeneration=1 --xp misc:solution_name=_xocc_link_vadd -s --remote_ip_cache /root/workspace/ip_cache

****** vpl v2017.4 (64-bit)
**** SW Build 2086221 on Fri Dec 15 20:54:30 MST 2017
** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

INFO: [VPL 60-839] Read in kernel information from file 'kernel_info.dat'.
INFO: [VPL 60-895] Target platform: /opt/Xilinx/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm
INFO: [VPL 60-423] Target device: xilinx_kcu1500_dynamic_5_0
INFO: [VPL 60-251] Hardware accelerator integration...
Creating Vivado project and starting FPGA synthesis.
[09:26:28] Synthesis is running.
[09:27:28] Synthesis is running.
[09:28:28] Synthesis is running.

 

===>The following messages were generated while Compiling (top level synthesis checkpoint) dynamic region Log file: /root/workspace/ex02/System/_xocc_link_vadd/_vpl/ipi/syn/syn.runs/synth_1/runme.log :
ERROR: [VPL 36-335] '/root/workspace/ex02/System/_xocc_link_vadd/_vpl/ipi/syn/syn.srcs/sources_1/bd/bd/ip/pfm_dynamic_memory_subsystem_0/bd_0/ip/ip_5/bd_d216_interconnect_ddr4_mem00_0.dcp' is not a valid design checkpoint
ERROR: [VPL 60-704] Integration error, One or more synthesis runs failed during dynamic region dcp generation
ERROR: [VPL 60-806] Failed to finish platform linker
ERROR: [XOCC 60-398] vpl failed
ERROR: [XOCC 60-626] Kernel link failed to complete
ERROR: [XOCC 60-703] Failed to finish linking
makefile:76: recipe for target 'vadd.xclbin' failed
make: *** [vadd.xclbin] Error 1

 

09:29:20 Build Finished (took 7m:46s.452ms)

 

 

0 Kudos
Moderator
Moderator
3,154 Views
Registered: ‎03-27-2012

Re: My SDx IDE can't run the printf example code

Jump to solution

Hi @yilee

 

SW build also work for me on 2017.4 with following steps:

source /opt/Xilinx/SDx/2017.4/settings64.sh 
cd examples/getting_started/debug/debug_printf_ocl/
make all TARGETS=sw_emu DEVICES=xilinx_kcu1500_dynamic_5_0
emconfigutil -f xilinx_kcu1500_dynamic_5_0 --nd 1
export XCL_EMULATION_MODE=sw_emu
./host

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Contributor
Contributor
3,140 Views
Registered: ‎03-08-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

Hi seanz,

 

I was running your suggestions. But it failed at the build step.

And I don't understand why the make do synthesis.

You can see below.

 

himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl$ source /opt/Xilinx/SDx/2017.4/settings64.sh
himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl$ source /opt/Xilinx/SDx/2017.4/license.sh
himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl$ make all TARGET=sw_emu DEVICES=xilinx_kcu1500_dynamic_5_0
/opt/Xilinx/SDx/2017.4/bin/xcpp -Wall -O0 -g -std=c++14 -I./src/ -I../../..//libs/xcl2 -I/opt/Xilinx/SDx/2017.4/runtime/include/1_2 ./src/host.cpp ../../..//libs/xcl2/xcl2.cpp -o host -L/opt/Xilinx/SDx/2017.4/runtime/lib/x86_64 -L/opt/Xilinx/SDx/2017.4/lib/lnx64.o -lOpenCL -pthread
mkdir -p xclbin
/opt/Xilinx/SDx/2017.4/bin/xocc -c --xp "param:compiler.preserveHlsOutput=1" --xp "param:compiler.generateExtraRunData=true" -s --xp "param:compiler.enableAutoPipelining=false" -I./src/ -o xclbin/vadd.hw.xilinx_kcu1500_dynamic_5_0.xo -t hw --platform xilinx_kcu1500_dynamic_5_0 ./src/vadd.cl

****** xocc v2017.4 (64-bit)
**** SW Build 2086221 on Fri Dec 15 20:54:30 MST 2017
** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

Attempting to get a license: ap_opencl
Feature available: ap_opencl
INFO: [XOCC 60-585] Compiling for hardware target
INFO: [XOCC 60-895] Target platform: /opt/Xilinx/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm
INFO: [XOCC 60-423] Target device: xilinx_kcu1500_dynamic_5_0
INFO: [XOCC 60-242] Creating kernel: 'krnl_vadd'
INFO: [XOCC 60-594] Finished kernel compilation
INFO: [XOCC 60-586] Created xclbin/vadd.hw.xilinx_kcu1500_dynamic_5_0.xo
INFO: [XOCC 60-791] Total elapsed time: 0h 0m 57s
mkdir -p xclbin
/opt/Xilinx/SDx/2017.4/bin/xocc -l --xp "param:compiler.preserveHlsOutput=1" --xp "param:compiler.generateExtraRunData=true" -s -o xclbin/vadd.hw.xilinx_kcu1500_dynamic_5_0.xclbin -t hw --platform xilinx_kcu1500_dynamic_5_0 xclbin/vadd.hw.xilinx_kcu1500_dynamic_5_0.xo

 

****** xocc v2017.4 (64-bit)
**** SW Build 2086221 on Fri Dec 15 20:54:30 MST 2017
** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

INFO: [XOCC 60-629] Linking for hardware target
INFO: [XOCC 60-895] Target platform: /opt/Xilinx/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm
INFO: [XOCC 60-897] Reading --xp value from platform: vivado_prop:run.impl_1.STEPS.OPT_DESIGN.TCL.SDXPOST=/home/himem/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/_xocc_link_vadd.hw.xilinx_kcu1500_dynamic_5_0_vadd.hw.xilinx_kcu1500_dynamic_5_0.dir/tcl_hooks/dynamic_postopt.tcl
INFO: [XOCC 60-423] Target device: xilinx_kcu1500_dynamic_5_0
INFO: [XOCC 60-825] xocc command line options for sdx_link are --xo xclbin/vadd.hw.xilinx_kcu1500_dynamic_5_0.xo -keep
INFO: [XOCC 60-824] sdx_link command line is sdx_link --xo xclbin/vadd.hw.xilinx_kcu1500_dynamic_5_0.xo -keep --xpfm /opt/Xilinx/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm --target hw --output_dir . --temp_dir .
using /opt/Xilinx/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm
extracting xo v3 file /home/himem/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/xclbin/vadd.hw.xilinx_kcu1500_dynamic_5_0.xo
Creating IP database /home/himem/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/_sds/.cdb/xd_ip_db.xml
processing accelerators: /home/himem/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/iprepo/xilinx_com_hls_krnl_vadd_1_0
ip_dir: /home/himem/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/iprepo/xilinx_com_hls_krnl_vadd_1_0
/opt/Xilinx/SDx/2017.4/bin/xsltproc --stringparam xpath "spirit:component/spirit:name/text()" /opt/Xilinx/SDx/2017.4/scripts/xdcc/xpathValueOf.xsl /home/himem/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/iprepo/xilinx_com_hls_krnl_vadd_1_0/component.xml
ip_name: krnl_vadd
Creating apsys_0.xml
/opt/Xilinx/SDx/2017.4/bin/cfgen: 4: /opt/Xilinx/SDx/2017.4/bin/cfgen: [[: not found
/opt/Xilinx/SDx/2017.4/bin/cfgen: 4: /opt/Xilinx/SDx/2017.4/bin/cfgen: [[: not found
Port Specs:
Kernel Specs:
Pipes:

 

Creating dr.bd.tcl
/opt/Xilinx/SDx/2017.4/bin/cf2xd: 4: /opt/Xilinx/SDx/2017.4/bin/cf2xd: [[: not found
/opt/Xilinx/SDx/2017.4/bin/cf2xd: 4: /opt/Xilinx/SDx/2017.4/bin/cf2xd: [[: not found
INFO: [CF2XD 83-2203] Adding accelerator adapters...
INFO: [CF2XD 83-2200] Adding axi_interconnects...
INFO: [CF2XD 83-2201] Adding axi_stream_router for scatter-gather DMAs...
INFO: [CF2XD 83-2202] Adding axi_dwidth_converters...
INFO: [CF2XD 83-2208] Adding bus connections for logical connections...
INFO: [CF2XD 83-2205] Adding clock connections...
INFO: [CF2XD 83-2206] Adding reset connections...
/opt/Xilinx/SDx/2017.4/bin/cf_xsd: 4: /opt/Xilinx/SDx/2017.4/bin/cf_xsd: [[: not found
/opt/Xilinx/SDx/2017.4/bin/cf_xsd: 4: /opt/Xilinx/SDx/2017.4/bin/cf_xsd: [[: not found
INFO: [XOCC 60-812] xocc command line options for vpl are --xp vivado_prop:run.impl_1.STEPS.OPT_DESIGN.TCL.SDXPOST=/home/himem/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/_xocc_link_vadd.hw.xilinx_kcu1500_dynamic_5_0_vadd.hw.xilinx_kcu1500_dynamic_5_0.dir/tcl_hooks/dynamic_postopt.tcl -t hw -f xilinx_kcu1500_dynamic_5_0 --xp vivado_prop:run.__KERNEL__.{STEPS.SYNTH_DESIGN.ARGS.MORE OPTIONS}={-directive sdx_optimization_effort_high} --xp param:compiler.enableRunInBitstreamGeneration=1 --xp param:compiler.preserveHlsOutput=1 --xp param:compiler.generateExtraRunData=true -s

****** vpl v2017.4 (64-bit)
**** SW Build 2086221 on Fri Dec 15 20:54:30 MST 2017
** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

INFO: [VPL 60-839] Read in kernel information from file 'kernel_info.dat'.
INFO: [VPL 60-895] Target platform: /opt/Xilinx/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm
INFO: [VPL 60-423] Target device: xilinx_kcu1500_dynamic_5_0
INFO: [VPL 60-251] Hardware accelerator integration...
Creating Vivado project and starting FPGA synthesis.
[07:53:27] Synthesis is running.
[07:54:27] Synthesis is running.
[07:55:27] Synthesis is running.

 

===>The following messages were generated while Compiling (top level synthesis checkpoint) dynamic region Log file: /home/himem/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/_xocc_link_vadd.hw.xilinx_kcu1500_dynamic_5_0_vadd.hw.xilinx_kcu1500_dynamic_5_0.dir/_vpl/ipi/syn/syn.runs/synth_1/runme.log :
ERROR: [VPL 36-335] '/home/himem/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/_xocc_link_vadd.hw.xilinx_kcu1500_dynamic_5_0_vadd.hw.xilinx_kcu1500_dynamic_5_0.dir/_vpl/ipi/syn/syn.srcs/sources_1/bd/bd/ip/pfm_dynamic_memory_subsystem_0/bd_0/ip/ip_5/bd_d216_interconnect_ddr4_mem00_0.dcp' is not a valid design checkpoint
ERROR: [VPL 60-704] Integration error, One or more synthesis runs failed during dynamic region dcp generation
ERROR: [VPL 60-806] Failed to finish platform linker
ERROR: [XOCC 60-398] vpl failed
ERROR: [XOCC 60-626] Kernel link failed to complete
ERROR: [XOCC 60-703] Failed to finish linking
../../..//utility/rules.mk:128: recipe for target 'xclbin/vadd.hw.xilinx_kcu1500_dynamic_5_0.xclbin' failed
make: *** [xclbin/vadd.hw.xilinx_kcu1500_dynamic_5_0.xclbin] Error 1
himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl$

 

0 Kudos
Moderator
Moderator
3,132 Views
Registered: ‎03-27-2012

Re: My SDx IDE can't run the printf example code

Jump to solution

Hi yilee,

 

You missed a "S" behind "TARGET", it should be

make all TARGETS=sw_emu DEVICES=xilinx_kcu1500_dynamic_5_0

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Contributor
Contributor
3,126 Views
Registered: ‎03-08-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

Thanks your kindness.

That is my mistake!

 

So, I was retrying and the results failed.

Would you see the error of results.

 

himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl$ source /opt/Xilinx/SDx/2017.4/settings64.sh
himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl$ make all TARGETS=sw_emu DEVICES=xilinx_kcu1500_dynamic_5_0
/opt/Xilinx/SDx/2017.4/bin/xcpp -Wall -O0 -g -std=c++14 -I./src/ -I../../..//libs/xcl2 -I/opt/Xilinx/SDx/2017.4/runtime/include/1_2 ./src/host.cpp ../../..//libs/xcl2/xcl2.cpp -o host -L/opt/Xilinx/SDx/2017.4/runtime/lib/x86_64 -L/opt/Xilinx/SDx/2017.4/lib/lnx64.o -lOpenCL -pthread
himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl$ emconfigutil -f xilinx_kcu1500_dynamic_5_0 --nd 1

****** configutil v2017.4 (64-bit)
**** SW Build 2086221 on Fri Dec 15 20:54:30 MST 2017
** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

INFO: [ConfigUtil 60-895] Target platform: /opt/Xilinx/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm
emulation configuration file `emconfig.json` is created in current working directory
himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl$ export XCL_EMULATION_MODE=sw_emu
himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl$ ./host
Found Platform
Platform Name: Xilinx
XCLBIN File Name: vadd
INFO: Importing xclbin/vadd.sw_emu.xilinx_kcu1500_dynamic_5_0.xclbin
Loading: 'xclbin/vadd.sw_emu.xilinx_kcu1500_dynamic_5_0.xclbin'
CPU emulation compute unit exited unexpectedly
Terminated

0 Kudos
Moderator
Moderator
3,120 Views
Registered: ‎03-27-2012

Re: My SDx IDE can't run the printf example code

Jump to solution

Have you modified the code or makefile?

Please make sure you are running with the latest version of SDAccel example.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Contributor
Contributor
3,107 Views
Registered: ‎03-08-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

No, I didn't modified.

 

The example code version is master branch.

 

== Makefile

himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl$ cat Makefile
COMMON_REPO := ../../../

include $(COMMON_REPO)/utility/boards.mk
include $(COMMON_REPO)/libs/xcl2/xcl2.mk
include $(COMMON_REPO)/libs/opencl/opencl.mk

# Host Application
host_SRCS=./src/host.cpp $(xcl2_SRCS)
host_HDRS=$(xcl2_HDRS)
host_CXXFLAGS=-I./src/ $(xcl2_CXXFLAGS) $(opencl_CXXFLAGS)
host_LDFLAGS=$(opencl_LDFLAGS)

EXES=host

# Kernel
vadd_SRCS=./src/vadd.cl
#Disabled autoPipelining for kernel as pipeline is not feasible with printf statement in kernel.
#this will allow compiler to generate design quickly as it will not attempt to pipeline.
vadd_CLFLAGS=--xp "param:compiler.enableAutoPipelining=false" -I./src/

XOS=vadd

# xclbin
vadd_XOS=vadd

XCLBINS=vadd

# check
check_EXE=host
check_XCLBINS=vadd

CHECKS=check

include $(COMMON_REPO)/utility/rules.mk

 

== host code

himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/src$ cat host.h

#pragma once

#define LENGTH (256)
#define WORKGROUP_SIZE (16)

 

himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/src$ cat host.cpp

#include "xcl2.hpp"
#include <vector>
#include "host.h"

int main(int argc, char* argv[])
{

size_t vector_size_bytes = sizeof(int) * LENGTH;
std::vector<int,aligned_allocator<int>> source_a(4 * LENGTH);
std::vector<int,aligned_allocator<int>> result_sim(LENGTH);
std::vector<int,aligned_allocator<int>> result_krnl(LENGTH);

// OPENCL HOST CODE AREA START
std::vector<cl::Device> devices = xcl::get_xil_devices();
cl::Device device = devices[0];

cl::Context context(device);
cl::CommandQueue q(context, device, CL_QUEUE_PROFILING_ENABLE);
std::string device_name = device.getInfo<CL_DEVICE_NAME>();

std::string binaryFile = xcl::find_binary_file(device_name,"vadd");
cl::Program::Binaries bins = xcl::import_binary_file(binaryFile);
devices.resize(1);
cl::Program program(context, devices, bins);
cl::Kernel kernel(program,"krnl_vadd");

cl::Buffer buffer_a(context,CL_MEM_USE_HOST_PTR | CL_MEM_READ_ONLY,
4*vector_size_bytes,source_a.data());
cl::Buffer buffer_e(context,CL_MEM_USE_HOST_PTR | CL_MEM_WRITE_ONLY,
vector_size_bytes,result_krnl.data());
std::vector<cl::Memory> readbufVec,writebufVec;
writebufVec.push_back(buffer_a);
readbufVec.push_back(buffer_e);

//Create the test data and run the vector addition locally
for(int i=0; i < LENGTH; i++){
source_a[4*i] = i;
source_a[4*i+1] = 2*i;
source_a[4*i+2] = 3*i;
source_a[4*i+3] = 4*i;
result_sim[i] = source_a[4*i] + source_a[4*i+1]
+ source_a[4*i+2] + source_a[4*i+3];

}

// Copy input vectors to memory
q.enqueueMigrateMemObjects(writebufVec,0/* 0 means from host*/);

auto krnl = cl::KernelFunctor<cl::Buffer&, cl::Buffer&>(kernel);
//Launch the Kernel
krnl(cl::EnqueueArgs(q,cl::NDRange(LENGTH,1,1), cl::NDRange(WORKGROUP_SIZE,1,1)),
buffer_a, buffer_e);

// Copy result to local buffer
q.enqueueMigrateMemObjects(readbufVec,CL_MIGRATE_MEM_OBJECT_HOST);
q.finish();

// OPENCL HOST CODE AREA END

// Compare the results of the kernel to the simulation
int krnl_match = 0;
std::cout <<"Checking against expected results and printing every 16th result (in 1024 additions)..." << std::endl;
for(int i = 0; i < LENGTH; i++){
if(result_sim[i] != result_krnl[i]){
std::cout <<"Error: Result mismatch" << std::endl;
std::cout <<"i = " << i << " CPU result = " << result_sim[i] << " Krnl Result = " << result_krnl[i] << std::endl;
krnl_match = 1;
break;
}
else{
if (i %16 == 0)
std::cout <<"Result Match: i = " << i << " CPU result = " << result_sim[i] << " Krnl Result = " << result_krnl[i] << std::endl;
}
}

std::cout << "TEST " << (krnl_match ? "FAILED" : "PASSED") << std::endl;
return (krnl_match? EXIT_FAILURE : EXIT_SUCCESS);
}

 

== kernel code

himem@acc01:~/test/SDAccel_Examples-master/getting_started/debug/debug_printf_ocl/src$ cat vadd.cl

#include "host.h"

__kernel void __attribute__ ((reqd_work_group_size(WORKGROUP_SIZE, 1, 1)))
// WORKGROUP_SIZE is set to 16 in host.h
krnl_vadd(__global int* a, __global int* e)
{
// Get information about global and local workgroup sizes and ids
int globalid = get_global_id(0);
int globalsize = get_global_size(0);
int localid = get_local_id(0);
int localsize = get_local_size(0);

// Add 4 consecutive locations from int array a and put result in array e
e[globalid]=a[4*globalid]+a[4*globalid+1]+a[4*globalid+2]+a[4*globalid+3];

// Use printf to print the information, work items and results
printf("** Printing from inside krnl_vadd: globalid: %d of \
global_work_size<%d,1,1> localid: %d of local_workgroup_size<%d,1,1>",
globalid,globalsize, localid,localsize);

printf(" - adding %d+%d+%d+%d to result %d **\n",
a[4*globalid],a[4*globalid+1],a[4*globalid+2],a[4*globalid+3], e[globalid]);
}

 

 

0 Kudos
Moderator
Moderator
2,794 Views
Registered: ‎03-27-2012

Re: My SDx IDE can't run the printf example code

Jump to solution

That's strange. 

Have you debugged the host code?

Can you upload ./host and xclbin file?

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Contributor
Contributor
2,790 Views
Registered: ‎03-08-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

Unfortunately, I can not upload cause by my Company's policy.

 

The code works well in Emulation H/W.

Additionally, I modified only some code System target case.

This modification came from xcl2.c's bug? code. (It is another issue. I cleared it.)

 

 

0 Kudos
Newbie tommyliu
Newbie
2,783 Views
Registered: ‎03-13-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

I also face the same situation. But I was upgrading from v2017.2 with xilinx:kcu1500:4ddr-xpr:4.0 to v2017.4 with xilinx_kcu1500_dynamic_5_0. The issue was found when I ported my old project and ran the sw_emu mode.

It seems that the v2017.4 sw_emu has some issue to run opencl in CPU.

Here I paste log in the same example from github and attach .host and .xclbin.

 

Ubuntu 16.04

sdx v2017.4

KCU1500

 

liu@liu-H270M-D3H:~/project/xilinx/SDAccel_Examples/getting_started/debug/debug_printf_ocl$ ./host
Found Platform
Platform Name: Xilinx
XCLBIN File Name: vadd
INFO: Importing xclbin/vadd.sw_emu.xilinx_kcu1500_dynamic_5_0.xclbin
Loading: 'xclbin/vadd.sw_emu.xilinx_kcu1500_dynamic_5_0.xclbin'
CPU emulation compute unit exited unexpectedly
Terminated

0 Kudos
Moderator
Moderator
2,752 Views
Registered: ‎03-27-2012

Re: My SDx IDE can't run the printf example code

Jump to solution

Thanks for reporting this issue.

It seems to happen on Ubuntu only.

I am looking at this and will let you know.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Observer remy561
Observer
2,407 Views
Registered: ‎06-20-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

I'm having the exact same issue with Ubuntu 16.04.4 and SDAccel 2018.2.

 

I am using the latest examples from git, which work fine on their own.

I tested this issue by adding printf("Loop info %d", i); to the end of the loop of the helloworld_ocl example kernel.

 

So, is there any news on this subject?

0 Kudos
Contributor
Contributor
2,387 Views
Registered: ‎03-08-2018

Re: My SDx IDE can't run the printf example code

Jump to solution
The problem does not solved yet.
Xilinx Employee
Xilinx Employee
2,365 Views
Registered: ‎09-08-2011

Re: My SDx IDE can't run the printf example code

Jump to solution

The issue is objcopy in Ubuntu is different then the version called by default from the binutils folder inside the SDx install. It gives an unexpected message when Ubuntu 16.04 is run, and thats what causes the sw_emu with printf to not be able to run.

 

You should be able to swap the objcopys with each other and get past it, just make sure you don't erase your sdx objcopy when making such changes. That should help prevent that SIGSEGV.

 

Regards,

 

Evan

If at first you don't succeed, try redefining success?
Observer remy561
Observer
2,358 Views
Registered: ‎06-20-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

Works like a charm, thanks!!

 

The objcopy that needs to be replaced is located in: 

/opt/Xilinx/SDx/2018.2/gnu/binutils/bin/objcopy

And you can find its replacement with:

whereis objcopy
Observer remy561
Observer
2,350 Views
Registered: ‎06-20-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

It seems I was a bit too early with my reply. The software emulator prints strings just fine now, however it has issues printing variables.

 

When I launch a kernel sized {1, 1, 1} both globally and locally with:

for( int i = 0; i < 10; i++ ) {
   printf("Test %d!\n",i);
}

I get the following as an output:

Test 0!
Test 25637!
Test 25637!
Test 25637!
Test 25637!
Test 25637!
Test 25637!
Test 25637!
Test 25637!
Test 25637!

Any idea what is going wrong here?

0 Kudos
Contributor
Contributor
3,292 Views
Registered: ‎03-08-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

Thank remy561,

 

Finally, I understood what to do.

What I did,

$ cd /opt/Xilinx/SDx/2017.4/gnu/binutils/bin
$ ln -s /usr/bin/objcopy objcopy   ## after backup objcopy binary file

And I do "make clean" and "run on sw-emu target".

The printf works well.

 

Observer remy561
Observer
1,712 Views
Registered: ‎06-20-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

Hey Yilee,

 

I just copied the executable to that folder. But a symlink is way neater, so I changed it to your implementation.

 

Printf does indeed work with the text written in the function, but can you check whether variables other than 0 are printed correctly at your side?

 

Currently, I have tried the following:

int testArray[4] = {0,2,4,6};
char testArray2[4] = {'A','B','C','D'};
const int testnm = 5;

for (int i = 0; i < 4; i++){
   printf("Looptest: %d, %d, %c, %d", i, testArray[i], testArray2[i], testnm);
}

Which results in:

Loopnr: 0, 0,  , 0, 0
Loopnr: 25637, 0,  , 0, 0
Loopnr: 25637, 0,  , 0, 0
Loopnr: 25637, 0,  , 0, 0


So, for some reason, the first variable printed results in that number, and the rest just prints 0 for integers and nothing for chars.

0 Kudos
Contributor
Contributor
1,693 Views
Registered: ‎03-08-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

I tested and the results are normal.

 

The result is

Looptest: 0, 0, A, 5
Looptest: 1, 2, B, 5
Looptest: 2, 4, C, 5
Looptest: 3, 6, D, 5

 

My system use 2017.4 SDx and Ubuntu 16.04.3 LTS with binutils 2.26.1-1ubuntu1~16.04.3.

I am sorry I can't give my help.

Observer remy561
Observer
1,658 Views
Registered: ‎06-20-2018

Re: My SDx IDE can't run the printf example code

Jump to solution

Thank you for verifying.


My binutils is version 2.26.1-1ubuntu1-16.04.6, so the issues might be caused by the unsupported Ubuntu version.


Will try to install 16.04.3 tomorrow to see whether the issue is still present.

0 Kudos