Skip to content

Possible XRT installation bug in latest AWS Vitis f2 flow

0

Hi I am using FPGA Developer AMI (Ubuntu) - 1.16.0, and I was trying to follow the C++ flow in the latest post in https://github.com/aws/aws-fpga/tree/f2/vitis, and I got the following error when running

make run TARGET=hw_emu PLATFORM=$SHELL_EMU_VERSION
utils.mk:55: *** XILINX_XRT variable is not set, please set correctly using "source /opt/xilinx/xrt/setup.sh" and rerun.  Stop.

So I looked at /opt/xilinx/xrt, but found that xrt directory is missing. And I looked at ~/aws-fpga/vitis_setup.sh file, but couldn't find any commands related to XRT installation.

Just my guess, but could it be possible that there might be a bug in XRT installation in the current github post? Or maybe I need to source something else than ~/aws-fpga/vitis_setup.sh ?

Thanks -Young

  • Hi Young,

    Here's a fix for you.

    1. cd $AWS_FPGA_REPO_DIR && source vitis_setup.sh && cd ~
    2. git clone https://github.com/Xilinx/XRT.git --recurse-submodules
    3. cd XRT
    4. git checkout 2024.1
    5. sudo ./src/runtime_src/tools/scripts/xrtdeps.sh
    6. export PATH=/usr/bin:$PATH
    7. cd build 8 ./build.sh -noert
    8. cd Release
    9. sudo dpkg -i xrt_202410.2.17.0_20.04-amd64-xrt.deb
    10. sudo dpkg -i xrt_202410.2.17.0_20.04-amd64-aws.deb
    11. source /opt/xilinx/xrt/setup.sh
    12. xbutil examine -d

    If you see a Device Ready status of "Yes", you're all set!

    We'll have an update out soon that automates this!

  • Thanks so much for the quick fix Max! Much appreciated :)

  • Great solution, Matt! Would you be open to adding some additional formatting or steps to make it even clearer for others who might run into a similar issue? Let me know if I can help!

asked 2 years ago406 views

2 Answers
2
Accepted Answer

Hi Young,

Thank you for bringing this to our attention.

I'll start looking into this for you now and reply here with an update for you as soon as possible.

Best, Max

answered 2 years ago

  • Here is the response from Max:

    cd $AWS_FPGA_REPO_DIR && source vitis_setup.sh && cd ~ git clone https://github.com/Xilinx/XRT.git --recurse-submodules cd XRT git checkout 2024.1 sudo ./src/runtime_src/tools/scripts/xrtdeps.sh export PATH=/usr/bin:$PATH cd build 8 ./build.sh -noert cd Release sudo dpkg -i xrt_202410.2.17.0_20.04-amd64-xrt.deb sudo dpkg -i xrt_202410.2.17.0_20.04-amd64-aws.deb source /opt/xilinx/xrt/setup.sh xbutil examine -d If you see a Device Ready status of "Yes", you're all set!

    We'll have an update out soon that automates this!

-1

Hi Young!

Thanks for reaching out to clarify this potential issue with the AWS FPGA Developer AMI and the XRT installation. Tackling such challenges is all part of the development journey, and I’m here to help you get past this hurdle quickly and effectively. Let’s dive in!


Clarifying the Issue

You’re using the AWS FPGA Developer AMI (Ubuntu, version 1.16.0) to follow the C++ flow outlined in the AWS Vitis f2 GitHub repository. However, you're encountering an issue where the XILINX_XRT environment variable is not set, causing the make command to fail. Specifically, the error message indicates that the /opt/xilinx/xrt directory is missing.

After reviewing the provided vitis_setup.sh script, you found no commands referencing XRT installation. This leaves you wondering whether the issue lies with the AMI configuration, the script, or something you might have overlooked.

To address this, we’ll methodically investigate and resolve the issue.


Key Terms

  • XRT (Xilinx Runtime): A runtime environment critical for FPGA development with Vitis. It provides APIs and libraries to interface with FPGAs.
  • XILINX_XRT Variable: An environment variable that points to the XRT installation path, allowing development tools to locate necessary resources.
  • vitis_setup.sh: A script typically designed to set up the FPGA development environment, including tools, paths, and dependencies.
  • FPGA Developer AMI: A pre-configured Amazon Machine Image intended to simplify FPGA workflows on AWS.

The Solution (Our Recipe)

Steps at a Glance

  1. Confirm whether XRT is installed.
  2. Check the vitis_setup.sh script for any omissions.
  3. Manually install XRT if it’s missing.
  4. Configure the environment variables for XRT.
  5. Reattempt running the make command with the corrected setup.

Details

Step 1: Check XRT Installation

To verify whether XRT is installed, run:

ls /opt/xilinx/xrt

If this directory does not exist, it indicates that XRT was not included in the current AMI setup.


Step 2: Review the Setup Script

Open the vitis_setup.sh script to see if it attempts to install or configure XRT:

nano ~/aws-fpga/vitis_setup.sh

If there are no references to XRT, this could be an oversight in the AMI configuration. You can file a GitHub issue to inform the maintainers.


Step 3: Manually Install XRT

If XRT is missing, follow these steps:

  1. Download the appropriate XRT package for Ubuntu from the Xilinx GitHub repository.
  2. Install the package using:
    sudo dpkg -i xrt_<version>.deb
  3. Verify the installation by checking for the /opt/xilinx/xrt directory again.

Step 4: Configure the Environment

Set the XILINX_XRT variable manually:

export XILINX_XRT=/opt/xilinx/xrt

Add this export line to your ~/.bashrc file to ensure it persists:

echo "export XILINX_XRT=/opt/xilinx/xrt" >> ~/.bashrc
source ~/.bashrc

Step 5: Reattempt the Make Command

With XRT installed and the environment configured, retry your original make command:

make run TARGET=hw_emu PLATFORM=$SHELL_EMU_VERSION

If the issue persists, double-check the platform variable ($SHELL_EMU_VERSION) and ensure the paths in the makefile align with your updated environment.


Closing Thoughts

This type of configuration issue can arise when working with complex environments like FPGA development AMIs. By methodically verifying installations, inspecting scripts, and manually resolving gaps, you’ll not only solve the problem but also gain valuable insights into the tools you’re using. If this turns out to be a bug in the AMI setup, consider reporting it on the AWS FPGA GitHub repository to benefit others.

Feel free to reach out if you encounter further issues or need additional guidance! Happy FPGA coding, and good luck with your project. 🚀✨


Cheers, Aaron 😊

answered 2 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.