cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
612 Views
Registered: ‎06-06-2019

ERROR: [XOCC 60-398] sdx_link failed - OpenCL kernel

Jump to solution

I am using sdx 2018.2. I am trying to compile a very simple saxpy kernel for testing compilation but I cannot get the bitstream (see the second compilation step).

I am following this documentation: https://www.xilinx.com/html_docs/xilinx2018_2_xdf/sdaccel_doc/compiling-your-opencl-kernel-using-xilinx-opencl-compiler-(xocc)-wrj1504034328013.html

First compilation from OpenCL to object file (.xo) with no errors:

$ xocc -c --platform xilinx_kcu1500_dynamic_5_0 mykernel.cl -o mykernel.xo

****** xocc v2018.2 (64-bit)
  **** SW Build 2258646 on Thu Jun 14 20:02:38 MDT 2018
    ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.

Attempting to get a license: ap_opencl
Feature available: ap_opencl
INFO: [XOCC 60-585] Compiling for hardware target
Running SDx Rule Check Server on port:45291
INFO: [XOCC 60-895]   Target platform: /localhome/opt/Xilinx/SDx/2018.2/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: 'saxpy'
===>The following messages were generated while  performing high-level synthesis for kernel: saxpy Log file:/home/juan/fpga-opencl-examples/c++/saxpy/_x/mykernel/saxpy/vivado_hls.log :
INFO: [XOCC 204-61] Option 'relax_ii_for_timing' is enabled, will increase II to preserve clock frequency constraints.
INFO: [XOCC 204-61] Pipelining loop 'XCL_WG_DIM_X'.
INFO: [XOCC 204-61] Pipelining result : Target II = 1, Final II = 2, Depth = 155.
INFO: [XOCC 60-594] Finished kernel compilation
INFO: [XOCC 60-244] Generating system estimate report...
INFO: [XOCC 60-1092] Generated system estimate report: /home/juan/fpga-opencl-examples/c++/saxpy/_x/reports/mykernel/system_estimate_mykernel.xtxt
WARNING: [XOCC 17-1525] IP definition with the same IP name already exists in XO container. Will overwrite the existing IP definition.
INFO: [XOCC 60-586] Created mykernel.xo
INFO: [XOCC 60-791] Total elapsed time: 0h 0m 20s

 

However, during the linking process and bitstream generation:

$ xocc -l --platform xilinx_kcu1500_dynamic_5_0 mykernel.xo -o mykernel.xclbin

****** xocc v2018.2 (64-bit)
  **** SW Build 2258646 on Thu Jun 14 20:02:38 MDT 2018
    ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.

INFO: [XOCC 60-629] Linking for hardware target
Running SDx Rule Check Server on port:33625
INFO: [XOCC 60-895]   Target platform: /localhome/opt/Xilinx/SDx/2018.2/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-825] xocc command line options for sdx_link are --xo mykernel.xo 
using /localhome/opt/Xilinx/SDx/2018.2/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm
extracting xo v3 file /home/juan/fpga-opencl-examples/c++/saxpy/mykernel.xo
couldn't compile regular expression pattern: quantifier operand invalid
    while executing
"regsub $source_dir $source_file $target_dir target_file"
    (procedure "::sdsoc::file::copyDirectoryIfDifferent" line 10)
    invoked from within
"::sdsoc::file::copyDirectoryIfDifferent $ip_root_dir $ip_dir"
    (body of "dict with")
    invoked from within
"dict with kdata {
      # an IP may be referenced by more than one kernel, but there is only
      # one copy of each IP
      set ip_base [file tail ..."
    (procedure "sdsoc::link::extract_xo_v3_file" line 103)
    invoked from within
"sdsoc::link::extract_xo_v3_file ${xo} $num ${extract_dir}"
    (procedure "sdsoc::link::extract_xo_file" line 24)
    invoked from within
"sdsoc::link::extract_xo_file $xo $count"
    (procedure "sdsoc::link::process_xo_files" line 9)
    invoked from within
"sdsoc::link::process_xo_files"
    (procedure "runMain" line 12)
    invoked from within
"runMain"
    (file "/localhome/opt/Xilinx/SDx/2018.2/bin/sdxl.tcl" line 430)
ERROR: [XOCC 60-398] sdx_link failed
ERROR: [XOCC 60-626] Kernel link failed to complete
ERROR: [XOCC 60-703] Failed to finish linking

 

Note: if I compile with `-t sw_emu`, it works.

I am also using an ssh terminal with no access to X-Windows. So I can't open Vivado/Eclipse project. So I have my own OpenCL/C++ project to use the FPGA. 

Any ideas/pointers about how to address this? Am I missing something?

Thank you

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
526 Views
Registered: ‎01-11-2011

Just to clarify, this new compile and link was done outside of the below directory correct?

/home/juan/fpga-opencl-examples/c++/saxpy

The intent is to not to necessarily separate the compile and linking directories, but to move all of the files outside of the 'c++' directory, so for example you would have your sources in '/home/juan/fpga-opencl-examples/cplusplus/saxpy' and compile in there.

-------------------------------------------------------------------------
Please don’t forget to reply, kudo, and accept as solution!
-------------------------------------------------------------------------

View solution in original post

4 Replies
Xilinx Employee
Xilinx Employee
552 Views
Registered: ‎01-11-2011

Hello @jjfumero, the error seems to indicate something is going wrong when trying to extract the .xo content. My initial thoughts would be because this processing is occurring within a directory that contains the '+' symbol. Could you try running the xocc linking outside of your 'c++' directory and see if you get the same errors?

-------------------------------------------------------------------------
Please don’t forget to reply, kudo, and accept as solution!
-------------------------------------------------------------------------
0 Kudos
Highlighted
Visitor
Visitor
533 Views
Registered: ‎06-06-2019

Hello @kmorris

   I created separated directories for the source and the generated binaries but I get the same error.

xocc -c -o bin/mykernel.xo -t hw --platform /localhome/opt/Xilinx/SDx/2018.2/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm sources/mykernel.cl 
xocc -l -o bin/mykernel.xclbin -t hw --platform /localhome/opt/Xilinx/SDx/2018.2/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm bin/mykernel.xo 

Error:

couldn't compile regular expression pattern: quantifier operand invalid
    while executing
"regsub $source_dir $source_file $target_dir target_file"
    (procedure "::sdsoc::file::copyDirectoryIfDifferent" line 10)
    invoked from within
"::sdsoc::file::copyDirectoryIfDifferent $ip_root_dir $ip_dir"
    (body of "dict with")
    invoked from within
"dict with kdata {
      # an IP may be referenced by more than one kernel, but there is only
      # one copy of each IP
      set ip_base [file tail ..."
    (procedure "sdsoc::link::extract_xo_v3_file" line 103)
    invoked from within
"sdsoc::link::extract_xo_v3_file ${xo} $num ${extract_dir}"
    (procedure "sdsoc::link::extract_xo_file" line 24)
    invoked from within
"sdsoc::link::extract_xo_file $xo $count"
    (procedure "sdsoc::link::process_xo_files" line 9)
    invoked from within
"sdsoc::link::process_xo_files"
    (procedure "runMain" line 12)
    invoked from within
"runMain"
    (file "/localhome/opt/Xilinx/SDx/2018.2/bin/sdxl.tcl" line 430)
ERROR: [XOCC 60-398] sdx_link failed
ERROR: [XOCC 60-626] Kernel link failed to complete
ERROR: [XOCC 60-703] Failed to finish linking

 

 

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
527 Views
Registered: ‎01-11-2011

Just to clarify, this new compile and link was done outside of the below directory correct?

/home/juan/fpga-opencl-examples/c++/saxpy

The intent is to not to necessarily separate the compile and linking directories, but to move all of the files outside of the 'c++' directory, so for example you would have your sources in '/home/juan/fpga-opencl-examples/cplusplus/saxpy' and compile in there.

-------------------------------------------------------------------------
Please don’t forget to reply, kudo, and accept as solution!
-------------------------------------------------------------------------

View solution in original post

Highlighted
Visitor
Visitor
515 Views
Registered: ‎06-06-2019

Hi @kmorris  yes you were right. The problem was the directory name "c++" with the '+' symbols. By using any other name works perfectly

PS: It would be great to improve the `xocc` error messages to get this ;-)

Thank you.

Juan

0 Kudos