hello_world example error with clean FPGA developer AMI (AL2)

0

Issue:
Seeing hello_world example failing while following instructions on the aws-fpga Repo.

Failure signature:
INFO: [ConfigUtil 60-1032]
emulation configuration file emconfig.json is created in ./_x.sw_emu.xilinx_aws-vu9p-f1_shell-v04261818_201920_2 directory
cp -rf ./_x.sw_emu.xilinx_aws-vu9p-f1_shell-v04261818_201920_2/emconfig.json .
XCL_EMULATION_MODE=sw_emu ./hello_world ./build_dir.sw_emu.xilinx_aws-vu9p-f1_shell-v04261818_201920_2/vadd.xclbin
/home/ec2-user/src/project_data/aws-fpga/Vitis/examples/xilinx_2020.2/common/includes/xcl2/xcl2.cpp:50 Error calling err = cl::Platform::get(&platforms), error code is: -1001
make[1]: *** [run] Error 1
make[1]: Leaving directory `/home/ec2-user/src/project_data/aws-fpga/Vitis/examples/xilinx_2020.2/hello_world'
make: *** [check] Error 2

Reproduce:

  1. Launch EC2 instance with FPGA developer AMI (Amazon Linux 2) with Vitis 2020.2.
  2. Install XRT libraries following instructions here (https://github.com/aws/aws-fpga/blob/master/Vitis/docs/XRT_installation_instructions.md )
  3. Source setup script and try to compile SW_Emulation following instructions here (https://github.com/aws/aws-fpga/blob/master/Vitis/README.md )
  4. $ cd $VITIS_DIR/examples/xilinx/hello_world // no error
    $ make clean // Seeing "basename: missing operand"
    $ make check TARGET=sw_emu DEVICE=$AWS_PLATFORM all // Seeing failure signature above

Greatly appreciate any input on why I'm seeing this failure. This is supposed to be a simple example? Please let me know if I have missed anything from the getting started guide. Thanks!

Owenoool

asked 3 years ago454 views
5 Answers
0
Accepted Answer

The problem is that we have Vitis bundled libstdc++ in the LD_LIBRARY_PATH which is ABI incompatible with the update g++ on AL2. The fix is to use a libstdc++ that is ABI compatible with the system you are compiling on.

By default g++ should look at /lib64 if you do not set an LD_LIBRARY_PATH. However, since it finds libstdc++ in the Vitis paths, it doesn't look for it there and fails.

So your workaround should work without issue as it adds the library to the '/opt/xilinx/xrt/lib' path specified in LD_LIBRARY_PATH. We're also fixing the code not not include Vitis to LD_LIBRARY_PATH - and that should lead g++ to automatically find the library in /lib64. We'll release the fix soon.

-Deep

Deep_P
answered 3 years ago
profile picture
EXPERT
reviewed 6 months ago
0

Hi owenool,

We're looking at this issue with Xilinx and will provide an update on it by tomorrow.

-Deep

Deep_P
answered 3 years ago
0

Hi Owenool,

It seems like there is some sort of an incompatibility between stdc++ symbols provided by Xilinx tools versus the ones on the AL2 AMI.
I'm looking into this further, but for now could you run this and re-run your executable:

sudo cp /lib64/libstdc++.so.6 /opt/xilinx/xrt/lib/

Let me know if this doesn't work for you for now.

Thanks,

Deep

Deep_P
answered 3 years ago
0

Thank you Deep for the temporary fix! It is working for me now. Are there any pitfalls with this method?

Owenoool

answered 3 years ago
0

Thank you Deep for the temporary fix! It is working for me now. Are there any pitfalls with this method?

Owenoool

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions