Runtime error on f1 instance: [XRT] ERROR: No devices found

0

Hi!

I am new to FPGA development, and I am working on a project with Vitis on an AWS instance. Both the host and kernel code is written in C/C++, and it successfully passed software and hardware emulations in Vitis.

For synthesis and emulations, I am using a c4.4xlarge instance with the FPGA Developer AMI - 1.8.1. After doing a system hardware build, creating an AFI, and waiting for the AFI to be available, I stop the c4.4xlarge instance, and changed it to a f1.2xlarge instance.

Then in the f1.2xlarge instance, I followed the steps in Link: https://github.com/aws/aws-fpga/blob/master/Vitis/README.md to source the vitis_runtime_setup.sh script, sourcing this script shows

INFO: XRT Runtime setup Done
INFO: XRT Install, non-dev
INFO: Starting MPD
INFO: Vitis runtime check PASSED

Then I do $ systemctl status mpd to check mpd status, and it shows

● mpd.service - Xilinx Management Proxy Daemon (MPD)
Loaded: loaded (/etc/systemd/system/mpd.service; disabled; vendor preset: dis abled)
Active: inactive (dead)

Then I execute the host code by doing ./host ./binary_container_1.awsxclbin. and the error arises:

Current working dir: /home/centos/Vitis-tutorial/aws-fpga/Vitis/tools
File opened successfully!
XRT build version: 2.3.0
Build hash: 9e13d57c4563e2c19bf5f518993f6e5a8dadc18a
Build date: 2020-02-06 15:08:44
Git branch: 2019.2
PID: 3639
UID: 1000
[Tue Jun 30 15:24:36 2020]
HOST: ip-172-31-18-64.ec2.internal
EXE: /home/centos/Vitis-tutorial/aws-fpga/Vitis/tools/host
[XRT] ERROR: No devices found
../src/xcl2.cpp:48 Error calling err = cl::Platform::get(&platforms), error code is: -1

I am not sure where the problem could be since I am using the latest version of the fpga developer AMI which should have the corresponding XRT pre-installed? Please let me know if more details should be provided, and thank you for reading through this post!

Any help is greatly appreciated!!

Thank you,

Owen

asked 2 years ago154 views
3 Answers
0
Accepted Answer

Hi Owen,

Are you by any chance running as 'centos'? To run the application, once mpd has started, you can check:

sudo systemctl status mpd
● mpd.service - Xilinx Management Proxy Daemon (MPD)
   Loaded: loaded (/etc/systemd/system/mpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-07-07 18:21:57 UTC; 3min 11s ago
 Main PID: 1891 (mpd)
   CGroup: /system.slice/mpd.service
           └─1891 /opt/xilinx/xrt/bin/mpd

Jul 07 18:22:10 ip-172-31-39-217.ec2.internal mpd[1891]: [0:0:1d.0] read 72 bytes out of 72 bytes from fd 5, valid: 1
Jul 07 18:22:10 ip-172-31-39-217.ec2.internal mpd[1891]: AwsDev: 0000:00:1d.0(index: 0)
Jul 07 18:22:10 ip-172-31-39-217.ec2.internal mpd[1891]: [0:0:1d.0] mpd daemon: request 11 received(reqSize: 24)
Jul 07 18:22:10 ip-172-31-39-217.ec2.internal mpd[1891]: [0:0:1d.0] write 2104 bytes out of 2104 bytes to fd 5
Jul 07 18:22:10 ip-172-31-39-217.ec2.internal mpd[1891]: [0:0:1d.0] msg arrived on mailbox fd 5
Jul 07 18:22:10 ip-172-31-39-217.ec2.internal mpd[1891]: [0:0:1d.0] retrieved msg size from mailbox: 48 bytes
Jul 07 18:22:10 ip-172-31-39-217.ec2.internal mpd[1891]: [0:0:1d.0] read 80 bytes out of 80 bytes from fd 5, valid: 1
Jul 07 18:22:10 ip-172-31-39-217.ec2.internal mpd[1891]: [0:0:1d.0] mpd daemon: request 10 received(reqSize: 32)
Jul 07 18:22:10 ip-172-31-39-217.ec2.internal mpd[1891]: AwsDev: 0000:00:1d.0(index: 0)
Jul 07 18:22:10 ip-172-31-39-217.ec2.internal mpd[1891]: [0:0:1d.0] write 524360 bytes out of 524360 bytes to fd 5

After that you can source the runtime setup script as root:

[centos@ip-172-31-39-217 aws-fpga]$ sudo -E /bin/bash
[root@ip-172-31-39-217 aws-fpga]# source vitis_runtime_setup.sh
INFO: Setting up environment variables
INFO: Changing AWS_FPGA_REPO_DIR from /home/centos/src/project_data/aws-fpga to /home/centos/aws-fpga
INFO: Sourcing sdk_setup.sh
INFO: Setting up environment variables
DEBUG: AWS_FPGA_REPO_DIR=/home/centos/aws-fpga
Entering /home/centos/aws-fpga/sdk/userspace/utils
rm -f *.o *.a ../lib/libutils.a
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g -std=gnu99 -fPIC -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I. -I../include -I/usr/include   -c -o io.o io.c
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g -std=gnu99 -fPIC -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I. -I../include -I/usr/include   -c -o log.o log.c
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g -std=gnu99 -fPIC -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I. -I../include -I/usr/include   -c -o logger-kmsg.o logger-kmsg.c
mkdir -p ../lib
ar rcs ../lib/libutils.a io.o log.o logger-kmsg.o
Entering /home/centos/aws-fpga/sdk/userspace/fpga_libs/fpga_pci
rm -f *.o ../../lib/libfpga_pci.a
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g -std=gnu99 -fPIC -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I. -I../../include -I/usr/include   -c -o fpga_pci.o fpga_pci.c
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g -std=gnu99 -fPIC -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I. -I../../include -I/usr/include   -c -o fpga_pci_sysfs.o fpga_pci_sysfs.c
mkdir -p ../../lib
ar rcs ../../lib/libfpga_pci.a fpga_pci.o fpga_pci_sysfs.o
Entering /home/centos/aws-fpga/sdk/userspace/fpga_libs/fpga_dma
rm -f *.o ../../lib/libfpga_dma.a
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g -std=gnu99 -fPIC -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I. -I../../include -I/usr/include   -c -o fpga_dma_utils.o fpga_dma_utils.c
mkdir -p ../../lib
ar rcs ../../lib/libfpga_dma.a fpga_dma_utils.o
Entering /home/centos/aws-fpga/sdk/userspace/fpga_libs/fpga_mgmt
rm -f *.o ../../lib/libfpga_mgmt.a ../../lib/so/libfpga_mgmt.so.1.0.0
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g -std=gnu99 -fPIC -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I. -I../../include -I/usr/include   -c -o fpga_mgmt_cmd.o fpga_mgmt_cmd.c
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g -std=gnu99 -fPIC -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I. -I../../include -I/usr/include   -c -o fpga_mgmt.o fpga_mgmt.c
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g -std=gnu99 -fPIC -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I. -I../../include -I/usr/include   -c -o fpga_hal_mbox.o fpga_hal_mbox.c
mkdir -p ../../lib
for library in ../../lib/libfpga_pci.a ../../lib/libutils.a ../../lib/libfpga_dma.a; do ar -x $library; done
ar rcs ../../lib/libfpga_mgmt.a *.o
mkdir -p ../../lib/so
cc -o ../../lib/so/libfpga_mgmt.so.1.0.0 -shared fpga_mgmt_cmd.o fpga_mgmt.o fpga_hal_mbox.o -Wl,-soname,libfpga_mgmt.so.1 -Wl,--whole-archive ../../lib/libfpga_pci.a ../../lib/libutils.a ../../lib/libfpga_dma.a -Wl,--no-whole-archive -lrt -lpthread
ln -sf libfpga_mgmt.so.1.0.0 ../../lib/so/libfpga_mgmt.so
Entering /home/centos/aws-fpga/sdk/userspace/fpga_mgmt_tools/src
rm -f *.o *.a fpga-local-cmd static-fpga-local-cmd
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g  -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I../../include/hal -I../../include -I../. -I.   -c -o fpga_local_cmd.o fpga_local_cmd.c
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g  -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I../../include/hal -I../../include -I../. -I.   -c -o fpga_local_cmd_parse.o fpga_local_cmd_parse.c
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g  -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I../../include/hal -I../../include -I../. -I.   -c -o virtual_jtag_pcie.o virtual_jtag_pcie.c
cc -DCONFIG_LOGLEVEL=0 -DFPGA_PCI_BARS_MAX=64 -DCLI_VERSION='"1.4.14"' -g  -Wall -Werror -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I../../include/hal -I../../include -I../. -I.   -c -o virtual_jtag_server.o virtual_jtag_server.c
cc -o fpga-local-cmd fpga_local_cmd.o fpga_local_cmd_parse.o virtual_jtag_pcie.o virtual_jtag_server.o -L../../lib/so -lfpga_mgmt
cc -o static-fpga-local-cmd fpga_local_cmd.o fpga_local_cmd_parse.o virtual_jtag_pcie.o virtual_jtag_server.o -L../../lib -lfpga_mgmt -lrt -lpthread
Build complete.
Executing as root...

AWS FPGA: Copying Amazon FPGA Image (AFI) Management Tools to /usr/bin
AWS FPGA: Installing shared library to /usr/local/lib64
	libfpga_mgmt.so.1 (libc6,x86-64) => /usr/local/lib64/libfpga_mgmt.so.1
AWS FPGA: Installing python bindings for FPGA management library
Installed /usr/lib64/python2.7/site-packages/fpga_dma.py
Installed /usr/lib64/python2.7/site-packages/fpga_mgmt.py
Installed /usr/lib64/python2.7/site-packages/fpga_pci.py
AWS FPGA: Done with Amazon FPGA Image (AFI) Management Tools install.
Done with SDK install.
INFO: sdk_setup.sh PASSED
INFO: You are using instance with installed vivado tools. determining VIVADO version for runtime setup...
INFO: VIVADO_TOOL_VERSION is 2019.2
INFO: Installed kernel version : 3.10.0-1062.4.1.el7.x86_64
INFO: kernel version 3.10.0-1062.4.1.el7.x86_64 has been validated for this devkit.
INFO: Xilinx Vivado version is 2019.2
INFO: XRT installed. proceeding to check version compatibility
INFO: Installed XRT version : 2019.2:9e13d57c4563e2c19bf5f518993f6e5a8dadc18a
INFO: XRT version 2019.2:9e13d57c4563e2c19bf5f518993f6e5a8dadc18a is supported.
INFO:  Now checking XOCL driver...
INFO: Found 'xocl Driver is installed and running. '
XILINX_XRT      : /opt/xilinx/xrt
PATH            : /opt/xilinx/xrt/bin:/home/centos/aws-fpga/shared/bin/scripts:/opt/Xilinx/Vitis/2019.2/bin:/opt/Xilinx/Vivado/2019.2/bin:/sbin:/bin:/usr/sbin:/usr/bin:/srv/git/centos-git-common
LD_LIBRARY_PATH : /opt/xilinx/xrt/lib:
PYTHONPATH     : /opt/xilinx/xrt/python:/home/centos/aws-fpga/shared/lib:/home/centos/aws-fpga/shared/bin/scripts:/opt/Xilinx/Vitis/2019.2/bin:/opt/Xilinx/Vivado/2019.2/bin:/sbin:/bin:/usr/sbin:/usr/bin:/srv/git/centos-git-common
INFO:  XRT Runtime setup Done
INFO: XRT Install, non-dev
INFO: Starting MPD
INFO: Vitis runtime check PASSED

<Run your application now>

Hope this helps.

-Deep

Deep_P
answered 2 years ago
0

Hi Owen,

XRT is preinstalled on the FPGA Developer AMI.

It seems like MPD failed or did not start in this case. Could you run:

sudo systemctl start mpd
sudo systemctl status mpd

If it still isn't running, could you share the output of:

sudo journalctl -u mpd

That way we can get more information on why MPD failed to start. Also, what region are you running this in? For MPD, we have to load a default AFI to change the PCI Device ID that the driver binds to, so another thing to check is to see is the device id on the slot.

Thanks,

Deep

Edited by: awsdeep on Jun 30, 2020 2:07 PM

Deep_P
answered 2 years ago
0

Hi Deep,

Thank you so much for your reply! I am running in us-east-1 region (N. Virginia). I tried the first two commands but mpd is still not running...

The output of

 $ sudo journalctl -u mpd

shows

 -- No entries --

Could you please let me know how I can check the device ID? I also tried starting another f1 instance (without changing from c4.4xlarge). On that instance, everything works fine: mpd starts successfully and the program runs successfully.

However, I would still prefer being able to change the c4.4xlarge instance to f1 instance to execute the program. This way I don't have to keep two copies of the EBS storage space... Please let me know if there is anything that I can do.

Thank you,

Owen

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.

Guidelines for Answering Questions