xilinx / xrt Goto Github PK
View Code? Open in Web Editor NEWRun Time for AIE and FPGA based platforms
Home Page: https://xilinx.github.io/XRT
License: Other
Run Time for AIE and FPGA based platforms
Home Page: https://xilinx.github.io/XRT
License: Other
Had some discussion with Hem about freq topology code and I'm listing some cleanup work here:
See JIRA PR: http://jira.xilinx.com/browse/PR-9682
https://github.com/Xilinx/XRT/blob/master/src/runtime_src/driver/xclng/tools/xbflash/flasher.h has a lookup table to determine programming mode from VBNVname in Feature ROM. This lookup table has to be updated in order for new devices to be programmed with xbflash. We should override this check if the user specifies a programming mode (don't call getProgrammingTypeFromDeviceName() ).
const std::vector<std::pair<std::string, E_FlasherType>> flashPairs = { std::make_pair( "7v3", BPI ), std::make_pair( "8k5", BPI ), std::make_pair( "ku3", BPI ), std::make_pair( "vu9p", SPI ), std::make_pair( "ku115", SPI ), std::make_pair( "kcu1500", SPI ), std::make_pair( "vcu1525", SPI ), std::make_pair( "vcu1526", SPI ), std::make_pair( "vcu1550", SPI ), std::make_pair( "vcu1551", SPI ), std::make_pair( "vega-4000", SPI ), std::make_pair( "xbb200", SPI ), std::make_pair( "xbb250", SPI ) };
Build AWS HAL by adding to the CMake Lists.
The relative path in CMakeLists.txt needs to remove "aws-fpga-staging".
We need to fix CMakeLists.txt to ensure that .so files created by the build are fully resolved. In RDI we link with -Wl,-z,defs,--as-needed. Maybe we can do the same with CMake.
I don't see cl2.hpp in the XRT build. Should it be included in /opt/xilinx/xrt/include/CL/ ? Currently I only see
cl_ext.h cl_ext_xilinx.h
I have some incompatible dependencies lingering on my CentOS system.
yum install XRT-2.1.0-Linux.rpm eventually has an issue with some version of libuuid already installed.
bash-4.2$ sudo yum install ./XRT-2.1.0-Linux.rpm
Loaded plugins: fastestmirror, langpacks
Repository 'UIM_install' is missing name in configuration, using id
Repository 'debug' is missing name in configuration, using id
Repository 'opencl' is missing name in configuration, using id
Examining ./XRT-2.1.0-Linux.rpm: xrt-2.1.0-1.x86_64
Marking ./XRT-2.1.0-Linux.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package xrt.x86_64 0:2.1.0-1 will be installed
--> Processing Dependency: dkms >= 2.5.0 for package: xrt-2.1.0-1.x86_64
Loading mirror speeds from cached hostfile
--> Processing Dependency: libuuid-devel >= 2.23.2 for package: xrt-2.1.0-1.x86_64
--> Running transaction check
---> Package libuuid-devel.x86_64 0:2.23.2-43.el7 will be installed
--> Processing Dependency: libuuid = 2.23.2-43.el7 for package: libuuid-devel-2.23.2-43.el7.x86_64
---> Package xrt.x86_64 0:2.1.0-1 will be installed
--> Processing Dependency: dkms >= 2.5.0 for package: xrt-2.1.0-1.x86_64
--> Running transaction check
---> Package libuuid.i686 0:2.23.2-43.el7 will be installed
---> Package xrt.x86_64 0:2.1.0-1 will be installed
--> Processing Dependency: dkms >= 2.5.0 for package: xrt-2.1.0-1.x86_64
--> Finished Dependency Resolution
Error: Package: xrt-2.1.0-1.x86_64 (/XRT-2.1.0-Linux)
Requires: dkms >= 2.5.0
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
bash-4.2$
Use std::thread from the C++ standard thread library.
driver/hw_em/generic_pcie_hal2/mbscheduler.cxx: pthread_mutex_init(&state_lock,NULL);
driver/hw_em/generic_pcie_hal2/mbscheduler.cxx: pthread_cond_init(&state_cond,NULL);
driver/hw_em/generic_pcie_hal2/mbscheduler.cxx: pthread_mutex_init(&state_lock,NULL);
driver/hw_em/generic_pcie_hal2/mbscheduler.cxx: pthread_cond_init(&state_cond,NULL);
driver/hw_em/generic_pcie_hal2/mbscheduler.cxx: pthread_cond_signal(&mScheduler->state_cond);
driver/hw_em/generic_pcie_hal2/mbscheduler.cxx: int returnStatus = pthread_create(&(mScheduler->scheduler_thread) , NULL, scheduler, (void *)mScheduler);
driver/hw_em/generic_pcie_hal2/mbscheduler.cxx: std::cout << func << " pthread_create failed " << " " << returnStatus<< std::endl;
driver/hw_em/generic_pcie_hal2/mbscheduler.cxx: int retval = pthread_join(mScheduler->scheduler_thread,NULL);
driver/hw_em/generic_pcie_hal2/mbscheduler.h: pthread_t scheduler_thread;
driver/hw_em/generic_pcie_hal2/mbscheduler.h: pthread_mutex_t state_lock;
driver/hw_em/generic_pcie_hal2/mbscheduler.h: pthread_cond_t state_cond;
The following message can not be suppressed today:
XILINX_OPENCL="/opt/dsa/advantech_vega-4000_dynamic_5_101/xbinst"
LD_LIBRARY_PATH="/opt/dsa/advantech_vega-4000_dynamic_5_101/xbinst/runtime/lib/x86_64::/usr/local/lib"
We need to redirect this with message manager
I see this error when I try to build document from a new workspace.
$ cd XRT/src/runtime_src/doc/
$ make
/lib/modules/4.4.0-128-generic/build/scripts/kernel-doc -rst ../driver/xclng/include/mgmt-ioctl.h > core/mgmt-ioctl.rst
/bin/sh: core/mgmt-ioctl.rst: No such file or directory
Makefile:22: recipe for target 'core/mgmt-ioctl.rst' failed
make: *** [core/mgmt-ioctl.rst] Error 1
I think this entry to dmesg should indicate the buffer being taken down. Instead it will report the buffer_count for a topology.
Every time git hash changes we should embed git hash (and timestamp) into all our binaries:
xbutil (xbsak)
xbflash
libxrtcore.so
libxilinxopencl.so
HAL libs
The utilities should display the build id when they start.
The libraries could return the build id as part of an API.
The deployment DSA should replace firmware files with XRT compiled ones.
To patch the dsabin, the packaging script should
Additionally, the packaging script should determine the version of XRT from which it copied the firmware files, this version should be encoded as a dependency in the rpm/deb for the deployment DSA. Currently the XRT dependency is encoded through a command line option to the script.
This issues depends on #77 for xclbinsplit and xclbincat.
Linux kernel-doc support reStructuredText format after kernel version 4.7.0. Should check kernel version and print ERROR message in makefile.
The following message is incorrect in some ways and it is overly alarming in some ways. Make it more appropriate and tone it down.
1. [0]user:0x1042:0x7:[???:??:0]
2. xclProbe found 1 FPGA slots with xocl driver running
3. WARNING: AwsXcl - Cannot open userPF: /dev/dri/renderD0
4. WARNING: AwsXcl isGood: invalid user handle.
5. WARNING: xclOpen Handle check failed
6. [0]user:0xf000:0x1d51:[xocl:2017.4.5:128]
7. device[0].user_instance : 128
8. AFI not yet loaded, proceed to download.
L2) "1 FPGA slots" -> "1 FPGA slot(s)"
L2) "with xocl driver running" is probably not correct to say.
L3-5) can we suppress these messages?
Add a message that indicates a shell is not found, initializing or loading a default shell for SDAccel.
Move Xilinx specific extensions to our cl_ext.h which in-turn includes system cl_ext.h. Our cl_ext.h should ship under xrt/include/CL.
The lint target should
Unfortunately the code does not compile because it uses boost::format. I suggest changing the code to not require this utility. Though not as nice, it should be sufficient to format with std::ostream.
Additionally compilation has several warnings that translate into compile errors with -Wall/error. These warnings should be fixed.
Should we enable protected branch for upstream:master so that write permission can be granted to every one, but only "administrator" can merge pull request. Thus, we can grant write permission to everybody, so people can assign issues to themselves.
This is filed explicitly for renaming libxrtcore.so to libxrt_core.so. We are also changing emu .so (to libxrt_hwem.so libxrt_swem.so) as per the below, to make everything in sync
https://github.com/aws/aws-fpga-staging/commit/9345c4811a5eea5456fe9df36f1dee5d82a6b4cb
This was pulled in aws/aws-fpga-staging:develop in July as a bug fix. Merge these changes into user_aws/shim for forward support.
We need to do the following
Currently we have
SJBRD2:/opt/xilinx/xrt>tree lib
lib
├── libcommon_em.so
├── libcpu_em.so
├── libhw_em.so
├── libxilinxopencl.so -> libxilinxopencl.so.2
├── libxilinxopencl.so.2 -> libxilinxopencl.so.2.1.0
├── libxilinxopencl.so.2.1.0
├── libxrtcore.so -> libxrtcore.so.2
├── libxrtcore.so.2 -> libxrtcore.so.2.1.0
└── libxrtcore.so.2.1.0
Current version of XRT is 2.1.0. The install directory should be renamed to /opt/xilinx/xrt-2.1.0
Renaming has implications on how run.sh sets XILINX_XRT (and PATH, LD_LIBRARY_PATH).
Per IM thread, we should probably make sure xbsak.cpp is compiled and linked with only the tools that need it (xbsak and xbflash?). The file should not be included in libxrtcore.so as it adds an otherwise unnecessary dependency on ncurses.
Remove NCURSES_LIBRARIES frm driver/xclng/xrt/CMakeLists.txt
Lots of code duplication exists in HAL for accessing sysfs. As such, we have many instances of slight variations of the same functions. This can cause issues in the future. It would be best to have a sysfs access class or something like that.
Examples:
flasher.cpp L166,175
memaccess.h L62
debug.cpp L137
hwmon.h L38
scan.h L24
shim.cpp L637,749,1362,1366,1388
xbsak.h L197,318,537
xbsak_debug.cpp L42,236
appdebug.cpp L1029
The existing xbflash code relies on VBNV string found from Feature ROM to figure out board name, then flash type. There is not DSA on MFG boards, so xbflash cannot work with it. I think that we need to build a table in xbflash to map MFG device ID to board name and always check the table before read the Feature ROM to get the board name.
New DSA names to replace xilinx_xbb200 and xilinx_xbb250 are xilinx_u200 and xilinx_u250.
This was a request from Ellery on 6/27/18:
Hi Guys,
I’m not sure if Julian already notified you guys but we’re starting to work on the DSAs for the XBB boards. Can you please add driver support for the following devices:
0x7890 | 0x788F | 0x4351 | xilinx:xbb200:dynamic:5.1 | XBB200 (XCU200) dynamic platform with up to 4 DDRs (in 2018.2 for XDF builds only) | ||
---|---|---|---|---|---|---|
0x7890 | 0x788F | 0x4352 | xilinx:xbb200:dynamic:5.2 | XBB200 (XCU200) dynamic platform with up to 4 DDRs (in 2018.2 for XDF builds only) | ||
0x7990 | 0x798F | 0x4352 | xilinx:xbb250:dynamic:5.2 | XBB250 (XCU250) dynamic platform with up to 4 DDRs (in 2018.2 for XDF builds only) |
Thanks,
~Ellery
Or if bin is not the right directory, please suggest better location.
The script is needed in sprite and canary infrastructure to validate the host.
Repeated runs of build/build.sh rebuilds emulation code.
Please fix.
xsjsoren50 505> ./build.sh
-- Looking for DRM - found at /usr 2.4.83
-- Looking for OPENCL - found at /usr 2.1 /usr/include
-- Boost version: 1.58.0
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- Platform/Linux (Ubuntu)
-- Compiler: /usr/bin/c++ /usr/bin/cc
-- Rodin devkits found, preparing ERT build
-- Preparing OpenCL ICD xilinx.icd
-- XRT header files
-- ert.h
-- xcl_axi_checker_codes.h
-- xclbin.h
-- xclerr.h
-- xclfeatures.h
-- xclhal2.h
-- xcl_macros.h
-- xclperf.h
running protoc --cpp_out /wrk/xsjhdnobkup3/soeren/git/Xilinx/XRT/build/Debug/runtime_src/driver/common_em --proto_path /wrk/xsjhdnobkup3/soeren/git/Xilinx/XRT/src/runtime_src/driver/common_em /wrk/xsjhdnobkup3/soeren/git/Xilinx/XRT/src/runtime_src/driver/common_em/rpc_messages.proto 2>&1
-- XRT version: 2.1.0
-- Debug DEB package
-- Configuring done
-- Generating done
-- Build files have been written to: /wrk/xsjhdnobkup3/soeren/git/Xilinx/XRT/build/Debug
[ 0%] Built target impl
[ 1%] Built target xclbin
[ 9%] Built target xrt
[ 15%] Built target management
[ 16%] Built target xdp
[ 17%] Built target scheduler
[ 18%] Built target user_common
Scanning dependencies of target common_em_objects
[ 22%] Built target user_gem
Scanning dependencies of target cpu_em_objects
[ 23%] Building CXX object runtime_src/driver/common_em/CMakeFiles/common_em_objects.dir/rpc_messages.pb.cc.o
Scanning dependencies of target hw_em_objects
[ 24%] Building CXX object runtime_src/driver/cpu_em/CMakeFiles/cpu_em_objects.dir/generic_pcie_hal2/shim.cxx.o
[ 24%] Building CXX object runtime_src/driver/hw_em/CMakeFiles/hw_em_objects.dir/generic_pcie_hal2/debug.cxx.o
[ 89%] Built target xocl
[ 90%] Building CXX object runtime_src/driver/hw_em/CMakeFiles/hw_em_objects.dir/generic_pcie_hal2/perf.cxx.o
[ 92%] Built target common_em_objects
[ 92%] Building CXX object runtime_src/driver/cpu_em/CMakeFiles/cpu_em_objects.dir/generic_pcie_hal2/halapi.cxx.o
[ 92%] Building CXX object runtime_src/driver/hw_em/CMakeFiles/hw_em_objects.dir/generic_pcie_hal2/halapi.cxx.o
[ 92%] Built target xilinxopencl
[ 92%] Built target ert
[ 93%] Building CXX object runtime_src/driver/hw_em/CMakeFiles/hw_em_objects.dir/generic_pcie_hal2/mbscheduler.cxx.o
[ 93%] Built target xrtcore
[ 93%] Building CXX object runtime_src/driver/hw_em/CMakeFiles/hw_em_objects.dir/generic_pcie_hal2/mem_model.cxx.o
[ 94%] Built target xrtcorestatic
[ 94%] Linking CXX shared library libcommon_em.so
[ 94%] Built target common_em
[ 95%] Building CXX object runtime_src/driver/hw_em/CMakeFiles/hw_em_objects.dir/generic_pcie_hal2/shim.cxx.o
[ 95%] Built target cpu_em_objects
[ 98%] Built target xbflash
[ 99%] Built target xbsak
[ 99%] Linking CXX shared library libcpu_em.so
[ 99%] Built target cpu_em
[ 99%] Built target hw_em_objects
[100%] Linking CXX shared library libhw_em.so
[100%] Built target hw_em
We must include license file(s) in the installation path, i.e.:
/opt/xilinx/xrt/license/*
this could be done by checking for the license parameter at the packaging time (make package). if license is defined as a make parameter (e.g. license=) license files should be copied from to /opt/xilinx/xrt/license/
lizhih@ubuntu:/proj/xsjhdstaff4/lizhih/git/XRT/build$ g++ -g -std=c++11 -pthread -IRelease/opt/xilinx/xrt/include loopback_sync_trans_unmgt.c Release/runtime_src/driver/xclng/xrt/libxrtcorestatic.a
In file included from loopback_sync_trans_unmgt.c:29:0:
Release/opt/xilinx/xrt/include/xclhal2.h:44:27: fatal error: xcl_app_debug.h: No such file or directory
compilation terminated.
Please investigate a crash in user_common/util.cpp::unitConvert(). It is being reached in xbutil query. See the output of xbutil and the stack trace. This was reported by @nbalagopal and @cellery.
Running xbutil
Starting program: /opt/xilinx/xrt/bin/xbutil query
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
INFO: Found 1 device(s)
DSA name: xilinx_u200_xdma_201820_1
Vendor: 10ee
Device: 5000
SDevice: e
SVendor: 10ee
DDR size: 64 GB
DDR count: 4
OnChip Temp: 39 C
Power(Beta): 32.192 W
OCL Frequency:
0: 300 MHz
1: 500 MHz
PCIe: GEN3 x 16
DMA bi-directional threads: 2
MIG Calibrated: true
Total DMA Transfer Metrics:
Chan[0].h2c: 0 Byte
Stacktrace:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff70a5203 in size (this=0x7fffffffac78) at /scratch/xbuild/xsjrdevl30_devkits/Tools/gcc/6.2.0/objs/lnx64/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3240
3240 /scratch/xbuild/xsjrdevl30_devkits/Tools/gcc/6.2.0/objs/lnx64/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h: No such file or directory.
(gdb) backtrace
#0 0x00007ffff70a5203 in size (this=0x7fffffffac78) at /scratch/xbuild/xsjrdevl30_devkits/Tools/gcc/6.2.0/objs/lnx64/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3240
#1 std::string::append (this=0x7fffffffac70, __str=...) at /scratch/xbuild/xsjrdevl30_devkits/Tools/gcc/6.2.0/objs/lnx64/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:767
#2 0x0000000000429b50 in **unitConvert**(unsigned long) ()
#3 0x000000000041df5d in xcldev::device::dump(std::ostream&) const ()
#4 0x00000000004153e1 in main ()
CMake allows you to specify the install destination with 'DEST_DIR=', but we add on '/opt/xilinx/xrt' with each install, when DEST_DIR should replace up to '/opt/xilinx' at least. So if I want my installation at '/opt/Xilinx/SDx/' and I pass 'DEST_DIR=/opt/Xilinx/SDx/', it will be installed at '/opt/Xilinx/SDx/opt/xilinx/xrt' instead of '/opt/Xilinx/SDx/xrt'.
Relates to #85
We should not carry a copy of OpenCL includes.
I have many errors building when I follow the README instructions.
I have confirmed the system requirements and the following packages are installed: (centos-release-scl, devtoolset-6). I tried after enabling devtoolset-6 with "scl enable devtoolset-6 bash" and build.sh also failed.
Using CentOS 7.4.
Ryan
Talk to me about the name of the DSA.
I set a wrong path for cmake. It is error out. However it does not recover after I set correct path. I think we need build.sh clean
izhih@xsjminm50:/proj/xsjhdstaff4/lizhih/git/XRT/build$ ./build.sh
-- Checking for module 'libdrm'
-- --short-errors: unknown option
CMake Error at /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:367 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:532 (_pkg_check_modules_internal)
CMakeLists.txt:14 (pkg_check_modules)
This file is included, but I can't find it.
The xrt/setup.* scripts should error out if run on a non conforming host.
Check minimum ubuntu 16.04 or centos/rhel 7.4
MSP432 chip is the BMC chip on XBB board. We need to update xbflash to be able to update its firmware.
Today, we have absolute library path in our OpenCL ICD entry. This is getting in the way when I was trying to debug my app. It'll always load the released version of the libs, not the one in my workspace even when I set LD_LIBRARY_PATH using run.sh correctly.
If I change the entry to just specify "libxilinxopencl.so", it will work since the LD_LIBRARY_PATH now gets control of where the lib is loaded from.
So, we probably need to revisit what we put into the ICD.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.