ros-acceleration / acceleration_examples

ROS 2 package examples demonstrating the use of hardware acceleration.
Apache License 2.0
39 stars 19 forks source link

The following input file does not exist: vadd.xclbin #15

Closed femust closed 10 months ago

femust commented 2 years ago

Hey,

so I am playing with the FPGA acceleration following this example and first I had a problem with

colcon build --build-base=build-kv260 --install-base=install-kv260 --merge-install --mixin kv260 --packages-select ament_vitis ros2acceleration offloaded_doublevadd_publisher

[0.188s] colcon.colcon_core.verb WARNING Some selected packages are already built in one or more underlay workspaces:
    'ament_vitis' is in: /home/andrzej/code_workspace/krs_ws/install
    'ros2acceleration' is in: /home/andrzej/code_workspace/krs_ws/install
    'offloaded_doublevadd_publisher' is in: /home/andrzej/code_workspace/krs_ws/install
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.

If you understand the risks and want to override a package anyways, add the following to the command line:
    --allow-overriding ament_vitis offloaded_doublevadd_publisher ros2acceleration

This may be promoted to an error in a future release of colcon-core.
Starting >>> ament_vitis
Starting >>> ros2acceleration
Finished <<< ament_vitis [0.31s]                                                        
Starting >>> offloaded_doublevadd_publisher
[0.505s] colcon.colcon_core.shell WARNING The following packages are in the workspace but haven't been built:
- vitis_common
They are being used from the following locations instead:
- /home/andrzej/code_workspace/krs_ws/install
To suppress this warning ignore these packages in the workspace:
--packages-ignore vitis_common
--- stderr: offloaded_doublevadd_publisher                                                               
CMake Error at CMakeLists.txt:18 (find_package):
  By not providing "Findvitis_common.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "vitis_common", but CMake did not find one.

  Could not find a package configuration file provided by "vitis_common" with
  any of the following names:

    vitis_commonConfig.cmake
    vitis_common-config.cmake

  Add the installation prefix of "vitis_common" to CMAKE_PREFIX_PATH or set
  "vitis_common_DIR" to a directory containing one of the above files.  If
  "vitis_common" provides a separate development package or SDK, be sure it
  has been installed.

make: *** [Makefile:296: cmake_check_build_system] Error 1
---
Failed   <<< offloaded_doublevadd_publisher [0.52s, exited with code 2]
Aborted  <<< ros2acceleration [0.87s]

Summary: 1 package finished [0.99s]
  1 package failed: offloaded_doublevadd_publisher
  1 package aborted: ros2acceleration
  1 package had stderr output: offloaded_doublevadd_publisher

so there is lack of *.cmake files, but I figured that in order to solve this problem I can just add vitils_common

colcon build --build-base=build-kv260 --install-base=install-kv260 --merge-install --mixin kv260 --packages-select ament_vitis ros2acceleration offloaded_doublevadd_publisher vitis_common

everything compiles, despite that the following error shows up

ERROR: The following input file does not exist: /home/andrzej/code_workspace/krs_ws/build-kv260/offloaded_doublevadd_publisher/vadd.xclbin

Then when I run on kv260

ros2 run offloaded_doublevadd_publisher offloaded_doublevadd_publisher

the following error appears

INFO: Found Xilinx Platform
ERROR: vadd.xclbin xclbin not available please build

any hints on where this error is coming from or from where the file vadd.xclbin is coming from?

vmayoral commented 2 years ago

hello @femust, let me walk through your comments:

so I am playing with the FPGA acceleration following this example and first I had a problem with

colcon build --build-base=build-kv260 --install-base=install-kv260 --merge-install --mixin kv260 --packages-select ament_vitis ros2acceleration offloaded_doublevadd_publisher

[0.188s] colcon.colcon_core.verb WARNING Some selected packages are already built in one or more underlay workspaces:
  'ament_vitis' is in: /home/andrzej/code_workspace/krs_ws/install
  'ros2acceleration' is in: /home/andrzej/code_workspace/krs_ws/install
  'offloaded_doublevadd_publisher' is in: /home/andrzej/code_workspace/krs_ws/install
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.

If you understand the risks and want to override a package anyways, add the following to the command line:
  --allow-overriding ament_vitis offloaded_doublevadd_publisher ros2acceleration

This may be promoted to an error in a future release of colcon-core.

This ugly warning is being treated at https://github.com/colcon/colcon-core/issues/469, awaiting for Open Robotics.

CMake Error at CMakeLists.txt:18 (find_package):
  By not providing "Findvitis_common.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "vitis_common", but CMake did not find one.

  Could not find a package configuration file provided by "vitis_common" with
  any of the following names:

    vitis_commonConfig.cmake
    vitis_common-config.cmake

  Add the installation prefix of "vitis_common" to CMAKE_PREFIX_PATH or set
  "vitis_common_DIR" to a directory containing one of the above files.  If
  "vitis_common" provides a separate development package or SDK, be sure it
  has been installed.

You are missing vitis_common in your ROS 2 workspace. There's currently no documentation for HAWG packages. The best resource is KRS's alpha documentation if you want to get it working.

Did you follow the installation process appropriately https://xilinx.github.io/KRS/sphinx/build/html/docs/install.html, you'll see that package should be fetched and I can see vitis_common listed as a build dependency, so AFAIK, it should work.

colcon build --build-base=build-kv260 --install-base=install-kv260 --merge-install --mixin kv260 --packages-select ament_vitis ros2acceleration offloaded_doublevadd_publisher vitis_common

everything compiles, despite that the following error shows up

ERROR: The following input file does not exist: /home/andrzej/code_workspace/krs_ws/build-kv260/offloaded_doublevadd_publisher/vadd.xclbin

Well, it sounds like you might not be building the kernel successfully. Can you list /home/andrzej/code_workspace/krs_ws/build-kv260/offloaded_doublevadd_publisher/ for us in here? Can you also inspect the log files from vitis (which should be at that directory) at let us know if there's been any issues while 1) synthesizing or 2) place&routing the kernel?

Make sure you use Vitis 2020.2.2, KRS alpha has only been tested with that.

femust commented 2 years ago

Hey @vmayoral,

the first comments are understandable but I added them for completeness, I use also Vitis 2020.2.2 image

regarding the error

ERROR: The following input file does not exist: /home/andrzej/code_workspace/krs_ws/build-kv260/offloaded_doublevadd_publisher/vadd.xclbin

after ls -la /home/andrzej/code_workspace/krs_ws/build-kv260/offloaded_doublevadd_publisher/

drwxrwxr-x 10 andrzej andrzej   4096 Feb  4 20:56 .
drwxrwxr-x  6 andrzej andrzej   4096 Feb  4 20:55 ..
drwxrwxr-x  3 andrzej andrzej   4096 Feb  4 20:55 ament_cmake_core
drwxrwxr-x  2 andrzej andrzej   4096 Feb  4 20:55 ament_cmake_environment_hooks
drwxrwxr-x  3 andrzej andrzej   4096 Feb  4 20:55 ament_cmake_index
drwxrwxr-x  2 andrzej andrzej   4096 Feb  4 20:55 ament_cmake_package_templates
drwxrwxr-x  2 andrzej andrzej   4096 Feb  4 20:55 ament_cmake_uninstall_target
-rw-rw-r--  1 andrzej andrzej    963 Feb  4 20:55 cmake_args.last
-rw-rw-r--  1 andrzej andrzej  37660 Feb  4 20:55 CMakeCache.txt
drwxrwxr-x  7 andrzej andrzej   4096 Feb  4 20:56 CMakeFiles
-rw-rw-r--  1 andrzej andrzej   8636 Feb  4 20:55 cmake_install.cmake
-rw-rw-r--  1 andrzej andrzej      2 Feb  4 20:56 colcon_build.rc
-rw-rw-r--  1 andrzej andrzej    232 Feb  4 20:55 colcon_command_prefix_build.sh
-rw-rw-r--  1 andrzej andrzej   5808 Feb  4 20:55 colcon_command_prefix_build.sh.env
-rw-r--r--  1 andrzej andrzej   2503 Feb  4 20:55 CTestConfiguration.ini
-rw-rw-r--  1 andrzej andrzej    104 Feb  4 20:55 CTestCustom.cmake
-rw-rw-r--  1 andrzej andrzej    383 Feb  4 20:55 CTestTestfile.cmake
-rw-rw-r--  1 andrzej andrzej   1856 Feb  4 20:56 install_manifest.txt
-rw-rw-r--  1 andrzej andrzej  10221 Feb  4 20:55 Makefile
-rwxrwxr-x  1 andrzej andrzej 711592 Feb  4 20:56 offloaded_doublevadd_publisher
-rw-rw-r--  1 andrzej andrzej    606 Feb  4 20:55 project_offloaded_doublevadd_publisher.tcl
-rw-rw-r--  1 andrzej andrzej    371 Feb  4 20:55 project_offloaded_doublevadd_publisher.tcl.in
-rw-r--r--  1 andrzej andrzej   1361 Feb  4 20:55 vadd.dtbo
-rw-rw-r--  1 andrzej andrzej   5758 Feb  4 20:55 vadd.xo.compile_summary
-rw-rw-r--  1 andrzej andrzej    249 Feb  4 20:55 v++_package.log
-rw-rw-r--  1 andrzej andrzej   2072 Feb  4 20:55 v++_vadd_103074.backup.log
-rw-rw-r--  1 andrzej andrzej    245 Feb  4 20:55 v++_vadd.log
drwxrwxr-x  5 andrzej andrzej   4096 Feb  4 20:55 _x
-rw-rw-r--  1 andrzej andrzej   1367 Feb  4 20:55 xcd.log
drwxrwxr-x  2 andrzej andrzej   4096 Feb  4 20:55 .Xil
-rw-rw-r--  1 andrzej andrzej    959 Feb  4 20:55 xrc.log

Intersting things from log files: In v++_vadd.log

ERROR: [v++ 60-602] Source file does not exist: /home/andrzej/code_workspace/krs_ws/build-kv260/offloaded_doublevadd_publisher/vadd.xo
INFO: [v++ 60-1662] Stopping dispatch session having empty uuid.
INFO: [v++ 60-1653] Closing dispatch client.

There is vadd.xo.compile_summary...

===>The following messages were generated while  performing high-level synthesis for kernel: vadd Log file: /home/andrzej/code_workspace/krs_ws/build-kv260/offloaded_doublevadd_publisher/_x/vadd/vadd/vitis_hls.log :
ERROR: [v++ 200-1023] Part 'xck26-sfvc784-2LV-c' is not installed.
ERROR: [v++ 60-300] Failed to build kernel(ip) vadd, see log for details: /home/andrzej/code_workspace/krs_ws/build-kv260/offloaded_doublevadd_publisher/_x/vadd/vadd/vitis_hls.log
ERROR: [v++ 60-773] In '/home/andrzej/code_workspace/krs_ws/build-kv260/offloaded_doublevadd_publisher/_x/vadd/vadd/vitis_hls.log', caught Tcl error: ERROR: [HLS 200-1023] Part 'xck26-sfvc784-2LV-c' is not installed.
ERROR: [v++ 60-599] Kernel compilation failed to complete
ERROR: [v++ 60-592] Failed to finish compilation
INFO: [v++ 60-1653] Closing dispatch client.

and v++_package.log

ERROR: [v++ 60-602] Source file does not exist: /home/andrzej/code_workspace/krs_ws/build-kv260/offloaded_doublevadd_publisher/vadd.xclbin
INFO: [v++ 60-1662] Stopping dispatch session having empty uuid.
INFO: [v++ 60-1653] Closing dispatch client.

What's xck26-sfvc784-2LV-c ?

vmayoral commented 2 years ago

Oh! I see what's the issue 👍! Thanks for posting all of that.

xck26-sfvc784-2LV-c is the part number used by the KV260 board which was not included by default in Vitis 2020.2.2 and required manual configuration to build kernels against that part. I'm sorry you experienced this hurdle. Unfortunately, there's little I can do about to prevent things like these since I'm not involved in Vitis releases.

I documented this issue a while ago at https://xilinx.github.io/KRS/sphinx/build/html/docs/howto.html#how-do-i-handle-board-part-definition-was-not-found-type-of-issues. Let me know if that works for you.

(I'm being told that newer (which are now archived 🤣) ) versions of 2020.2.2 do include it)

vmayoral commented 2 years ago

@femust did you address your issue?

femust commented 2 years ago

@vmayoral I should be able to get back to you with feedback this week/weekend whether it works (for the time being extremely busy, unfortunately)

vmayoral commented 10 months ago

Closing this for now.