F1实例出现运行时错误:[XRT] ERROR: No devices found

0

【以下的问题经过翻译处理】 我是 FPGA 开发的新手,在 AWS 实例上使用 Vitis 进行项目开发。主机和内核代码都是用 C/C++ 编写,它们已经在 Vitis 中成功地通过了软件和硬件仿真。

为了进行综合和仿真,我使用了一个 c4.4xlarge 实例,其中安装的是 FPGA Developer AMI - 1.8.1。在进行系统硬件构建、创建 AFI 并等待 AFI 可用后,我停止了 c4.4xlarge 实例,并将它更改为 f1.2xlarge 实例。

然后,在 f1.2xlarge 实例中,我按照链接 https://github.com/aws/aws-fpga/blob/master/Vitis/README.md 中的步骤来source vitis_runtime_setup.sh,这个脚本显示:

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

然后我用 $ systemctl status mpd 来检查 mpd 的状态,它显示:

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

然后我通过 ./host ./binary_container_1.awsxclbin 来执行主机代码,但出现了错误:

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

目前已经使用了最新的 FPGA AMI,理论上XRT 应该是预装的,目前这个错误的原因会是什么?

profile picture
EXPERTE
gefragt vor 5 Monaten31 Aufrufe
1 Antwort
0

【以下的回答经过翻译处理】 需要确认下是否使用“centos”用户运行相关命令?启动mpd后,可以检查以下内容:

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

然后可以用 root 用户来 source 代码

[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>
profile picture
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen