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: 
Observer zhengchaofeng
Observer
2,543 Views
Registered: ‎02-01-2018

SDAccel Examples run fail on KCU1500

 

Hi,

 

I get the templets from https://github.com/Xilinx/SDAccel_Examples, and follow the steps in  chapter 2 UG1021.

Emulation-sw, emulation-hw and System complie run successful, and  .exe and .xclbin are generated in System folder.

But when System run in Sdx GUI or execut ./valid_test.exe krnl_vadd.xclbin in bash, I get same error as following:

 

 

Linux:4.13.0-36-generic:#40~16.04.1-Ubuntu SMP Fri Feb 16 23:25:58 UTC 2018:x86_64
Distribution: Ubuntu 16.04.4 LTS
GLIBC: 2.23
--- 
XILINX_OPENCL="/opt/dsa/xilinx_kcu1500_dynamic_5_0/xbinst"
LD_LIBRARY_PATH="/opt/dsa/xilinx_kcu1500_dynamic_5_0/xbinst/runtime/lib/x86_64:"
--- 
Found Platform
Platform Name: Xilinx
XCLBIN File Name: krnl_vadd
*** invalid %N$ use detected ***
Aborted (core dumped)

 

 

Then I dump the core

 

 

#0  0x00007f3b20a54428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
        resultvar = 0
        pid = 9978
        selftid = 9978
#1  0x00007f3b20a5602a in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, 
          sa_mask = {__val = {0 <repeats 14 times>, 33, 140725868978480}}, 
          sa_flags = 33, sa_restorer = 0x7ffd4b6e6050}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007f3b20a967ea in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7f3b20bae2c9 "%s") at ../sysdeps/posix/libc_fatal.c:175
        ap = <error reading variable ap (Attempt to dereference a generic pointer.)>
        fd = 41
        on_2 = <optimized out>
        list = <optimized out>
        nlist = <optimized out>
        cp = <optimized out>
        written = <optimized out>
#3  0x00007f3b20a9680e in __GI___libc_fatal (
    message=0x7f3b20baf700 "*** invalid %N$ use detected ***\n")
---Type <return> to continue, or q <return> to quit---
    at ../sysdeps/posix/libc_fatal.c:185
No locals.
#4  0x00007f3b20a6a51c in printf_positional (s=s@entry=0x7ffd4b6e6cd0, 
    format=format@entry=0x4058aa "%1$s/%2$s.%3$s.%5$s.awsxclbin", 
    readonly_format=readonly_format@entry=0, ap=ap@entry=0x7ffd4b6e6e48, 
    ap_savep=ap_savep@entry=0x7ffd4b6e6868, done=<optimized out>, 
    nspecs_done=0, lead_str_end=0x4058aa "%1$s/%2$s.%3$s.%5$s.awsxclbin", 
    work_buffer=0x7ffd4b6e68a0 "", save_errno=2, grouping=0x0, 
    thousands_sep=0x7f3b20babb25 "") at vfprintf.c:1893
        args_malloced = <optimized out>
        specsbuf = {data = 0x7ffd4b6e62e0, length = 1024, 
          __space = "\377\377\377\377\000\000\000\000s\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\256X@\000\000\000\000\000\257X@\000\000\000\000\000\377\377\377\377\377\377\377\377\000\000\000\000\003\000\000\000\001\000\000\000\000\000\000\000\377\377\377\377\000\000\000\000\377\377\377\377\000\000\000\000s\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\263X@\000\000\000\000\000\264X@\000\000\000\000\000\377\377\377\377\377\377\377\377\001\000\000\000\003\000\000\000\001\000\000\000\000\000\000\000\377\377\377\377\000\000\000\000\377\377\377\377\000\000\000\000s\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\270X@\000\000\000\000\000\271X@\000\000\000\000\000\377\377\377\377\377\377\377\377\002\000\000\000\003\000\000\000"...}
        specs = <optimized out>
        specs_limit = <optimized out>
---Type <return> to continue, or q <return> to quit---
        nspecs = <optimized out>
        nargs = <optimized out>
        bytes_per_arg = <optimized out>
        args_value = <optimized out>
        args_size = <optimized out>
        args_type = 0x7ffd4b6e61b4
        max_ref_arg = 5
        cnt = 3
        workstart = 0x0
        __PRETTY_FUNCTION__ = "printf_positional"
#5  0x00007f3b20a6c4a6 in _IO_vfprintf_internal (s=s@entry=0x7ffd4b6e6cd0, 
    format=<optimized out>, 
    format@entry=0x4058aa "%1$s/%2$s.%3$s.%5$s.awsxclbin", 
    ap=ap@entry=0x7ffd4b6e6e48) at vfprintf.c:1677
        _buffer = {__routine = 0x0, __arg = 0x0, __canceltype = 0, 
          __prev = 0x0}
        _avail = <optimized out>
        thousands_sep = <optimized out>
        grouping = <optimized out>
        done = <optimized out>
        f = 0x4058ac "$s/%2$s.%3$s.%5$s.awsxclbin"
        lead_str_end = 0x4058aa "%1$s/%2$s.%3$s.%5$s.awsxclbin"
        end_of_spec = <optimized out>
---Type <return> to continue, or q <return> to quit---
        work_buffer = '\000' <repeats 584 times>...
        workstart = 0x0
        workend = <optimized out>
        ap_save = <error reading variable ap_save (Attempt to dereference a generic pointer.)>
        nspecs_done = <optimized out>
        save_errno = 2
        readonly_format = <optimized out>
        __PRETTY_FUNCTION__ = "_IO_vfprintf_internal"
#6  0x00007f3b20b35896 in ___vsnprintf_chk (s=0x7ffd4b6e8140 "", 
    maxlen=<optimized out>, flags=1, slen=<optimized out>, 
    format=0x4058aa "%1$s/%2$s.%3$s.%5$s.awsxclbin", 
    args=args@entry=0x7ffd4b6e6e48) at vsnprintf_chk.c:63
        sf = {f = {_sbf = {_f = {_flags = -72515583, 
                _IO_read_ptr = 0x7ffd4b6e8140 "", 
                _IO_read_end = 0x7ffd4b6e8140 "", 
                _IO_read_base = 0x7ffd4b6e8140 "", 
                _IO_write_base = 0x7ffd4b6e8140 "", 
                _IO_write_ptr = 0x7ffd4b6e8140 "", 
                _IO_write_end = 0x7ffd4b6e913f "", 
                _IO_buf_base = 0x7ffd4b6e8140 "", 
                _IO_buf_end = 0x7ffd4b6e913f "", _IO_save_base = 0x0, 
                _IO_backup_base = 0x0, _IO_save_end = 0x0, _markers = 0x0, 
---Type <return> to continue, or q <return> to quit---
                _chain = 0x0, _fileno = 1265528768, _flags2 = 4, 
                _old_offset = 139891942001350, _cur_column = 0, 
                _vtable_offset = 0 '\000', _shortbuf = "", _lock = 0x0, 
                _offset = 0, _codecvt = 0x7f3b20a2af10, 
                _wide_data = 0xffffffffffffffff, _freeres_list = 0x0, 
                _freeres_buf = 0x0, __pad5 = 0, _mode = -1, 
                _unused2 = '\000' <repeats 19 times>}, 
              vtable = 0x7f3b20de24a0 <_IO_strn_jumps>}, _s = {
              _allocate_buffer = 0x0, _free_buffer = 0x0}}, 
          overflow_buf = "\377\377\377\377\377\377\377\377\000\377\377\377\377\377\377\377", '\000' <repeats 47 times>}
        ret = <optimized out>
#7  0x00007f3b20b357f8 in ___snprintf_chk (s=<optimized out>, 
    maxlen=<optimized out>, flags=<optimized out>, slen=<optimized out>, 
    format=<optimized out>) at snprintf_chk.c:34
        arg = <error reading variable arg (Attempt to dereference a generic pointer.)>
        done = 0
#8  0x00000000004036cf in xcl::find_binary_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
No symbol table info available.
#9  0x0000000000402763 in main ()

 

Now, I think this problem caused by lib/xcl2, and have no idea about this error.

 

 

PS: xbsak can query the device and vertiy test application runs fine.

0 Kudos
8 Replies
Highlighted
Xilinx Employee
Xilinx Employee
2,501 Views
Registered: ‎09-08-2011

Re: SDAccel Examples run fail on KCU1500

Hi Zhengchaofeng,

 

   If you go ahead into the archive from the github, and make the example using the provided makefile, are you able to run that version of the build?

 

Is it only when going through the GUI steps that you see the error? or is the xclbin generated by the included makefile also providing the same error?

 

 

If at first you don't succeed, try redefining success?
0 Kudos
Observer zhengchaofeng
Observer
2,451 Views
Registered: ‎02-01-2018

Re: SDAccel Examples run fail on KCU1500

hello evant

 

I just got that error in the GUI steps.

 

When I follow the makefile steps as chapter 2 ug1021, there is another error when I exicute "make check" both in sw_emu or hw_emu. 

 

 

 

mcp@mcp:~/workspace/SDAccel_Exapmles/getting_started/misc/vadd$ sudo -E make check TARGETS=sw_emu DEVICES=xilinx_kcu1500_dynamic_5_0
/opt/Xilinx/SDx/2017.4/bin/emconfigutil --platform 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 
XCL_EMULATION_MODE=sw_emu ./vadd 
Error: Failed to find Xilinx platform
../../..//utility/check.mk:60: recipe for target 'check_sw_emu_xilinx_kcu1500_dynamic_5_0_check' failed
make: *** [check_sw_emu_xilinx_kcu1500_dynamic_5_0_check] Error 1

 

I did a .sh to make sure the variables is right, but it also can not work as only source settings64.sh 

 

source /opt/Xilinx/SDx/2017.4/settings64.sh
export XCL_EMULATION_MODE=sw_emu
export XILINX_SDACCEL=${XILINX_SDX}/
export XILINX_OPENCL=${XILINX_SDX}/
export LD_LIBRARY_PATH=${XILINX_SDX}/platforms/xilinx_kcu1500_dynamic_5_0/sw/lib/x86_64:${XILINX_SDX}/runtime/lib/x86_64:${XILINX_SDX}/lib/lnx64.o:${XILINX_SDX}/lib/lnx64.o/Default:${XILINX_SDX}/lnx64/tools/gcc/lib64

And I confirm that all files are bulided successfully as chapter 2 UG1021, I also get emconfig.json in make check step.

 

"Comment": "This file is auto-generated by the tool. Do not modify",
    "Version": {
        "FileVersion": "2.0",
        "ToolVersion": "2017.4"
    },
    "Platform": {
        "Boards": [
            {
                "Devices": [
                    {
                        "Name": "xilinx_kcu1500_dynamic_5_0",
                        "DdrBanks": [
                            {
                                "Name": "mem0",
                                "Type": "ddr4",
                                "Size": "4GB"
                            },
                            {
                                "Name": "mem1",
                                "Type": "ddr4",
                                "Size": "4GB"
                            },
                            {
                                "Name": "mem2",
                                "Type": "ddr4",
                                "Size": "4GB"
                            },
                            {
                                "Name": "mem3",
                                "Type": "ddr4",
                                "Size": "4GB"
                            }
                        ]
                    }
                ],
                "NumBoards": "1"
            }
        ],
        "UnifiedPlatform": "true",
        "ExpandedPR": "false"
    }

 

 

 

 

 

 

0 Kudos
Visitor loldaa
Visitor
2,425 Views
Registered: ‎12-05-2017

Re: SDAccel Examples run fail on KCU1500

Hello zhengchaofeng

 

May be I can answer your question.

 

I had this problem too.

 

You probably use the xilinx 'xcl2.h' & 'xcl2.c' file to initialize the opencl procedure.

There may be a problem when the file call the function "snprintf" inside 'xcl2.c' file which lead to this problem.

Pay attention the line '193' '219' '239'.

 

You can try debug these lines to see if the 'snprintf' is the killer.

 

If so, you just need to write another initialize program('initialize the platform context device,blabla)

 

I hope this answser may help you.

 

 

 

 

 

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

Re: SDAccel Examples run fail on KCU1500

Hello @zhengchaofeng,

This topic is still open and is waiting for you.

If your question is answered and/or your issue is solved, please mark a response that resolved your issue, as Accepted Solution (more info on this can be found here: https://forums.xilinx.com/t5/help/faqpage/faq-category-id/solutions#solutions). This way, the topic can be completed then.

If this is not solved/answered, please reply in the thread.

Thanks in advance and have a great day.

 

Regards,

Sean

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Observer zhengchaofeng
Observer
2,353 Views
Registered: ‎02-01-2018

Re: SDAccel Examples run fail on KCU1500

loldaa, Thank you for reply.

 

I find the GUI problem is due to the snprintf. too.

The second parameter string of pattern is discontinuities, that cause "snprintf" crash in system run, but in emulation it goes right. 

 

    const char *aws_file_patterns[] = {
        "%1$s/%2$s.%3$s.%4$s.awsxclbin",     // <kernel>.<target>.<device>.awsxclbin
        "%1$s/%2$s.%3$s.%5$s.awsxclbin",     // <kernel>.<target>.

So I only modify the string splicing method of "file_name", the project can work succesfully.

 

But the project cant not work in makefile step, it still "Failed to find xilinx platform" when "make check" like before.

 

 

 

0 Kudos
Visitor jason_yjc
Visitor
1,991 Views
Registered: ‎04-27-2018

Re: SDAccel Examples run fail on KCU1500

怎么生成.xclbin文件的,还有我HW-EMU的时候报VPL和XOCC的错

0 Kudos
Contributor
Contributor
1,271 Views
Registered: ‎05-11-2018

Re: SDAccel Examples run fail on KCU1500

hi, @zhengchaofeng ,

could you show me how do you 'modify the string splicing method' ? 

I got the same problem as yours. 

thanks! 

0 Kudos
Participant mkaiser
Participant
1,227 Views
Registered: ‎07-24-2017

Re: SDAccel Examples run fail on KCU1500

I had the same issue with the VCU1525 and the sdx GUI version 2018.2 (crash in xcl2.cpp, line 194 with the snprintf command). Just came back here to post my solution, because it would have saved me some time...

- In the "Debug" and "Run" settings (do this for all three configurations: Emu-SW, Emu-HW and System) activate the checkbox "Automatically add binary container(s) to arguments" in the second tab "Arguments".

- Host-Code: Remove the call to the xcl:find_binary_file and subsitute it with the xclbin file provided by command line argument argv[1]:

 

/* skipping find_binary_file, which causes issues with snprintf in line 194 of xcl2.cpp */
/* std::string binaryFile = xcl::find_binary_file(device_name,"vector_addition"); */
std::string binaryFile = argv[1]; /* simply take the command line argument  */