Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vitis 2024.1 Release #1

Open
0xB4demeister opened this issue Sep 6, 2024 · 15 comments
Open

Vitis 2024.1 Release #1

0xB4demeister opened this issue Sep 6, 2024 · 15 comments

Comments

@0xB4demeister
Copy link

Hi is this repo here still active?
Do you have perhaps a version compatible with Vitis 2024.1 (which uses GCC 12.2.0)

@vmayoral
Copy link
Member

vmayoral commented Sep 9, 2024

None that I know, sorry. Ping @jasvinderkhurana in case you folks are working in this direction.

@jasvinderkhurana
Copy link

@Fatalon, As of today we don't have a version compatible with Vitis 2024.1, but we have plans to update it. I don't have concrete dates.. but we will work on updating KRS on ubuntu 24.04 and Vitis 2024.1 or above..

@0xB4demeister
Copy link
Author

okay, thanks for your reply.
I am kind of working in that direction, but instead of full KRS I would already be happy if I can simply cross-compile ROS2 applications and run them on the Kria.
I experimented with your and the official Ubuntu image from Xilinx, but wasn't able to find a way to even get the host-code (OpenCL) compiled Xilinx Forum Post

So for this moment, I switched back to Petalinux which is supported by the new flow out-of-the-box and try to get the cross-compiling of ROS2 applications working there - if you have any tips regarding that, let me know

@jasvinderkhurana
Copy link

@Fatalon , can you provide some details on what example or application you are trying to compile? I can try to reproduce it at my end and then may be I can guide you well.

@0xB4demeister
Copy link
Author

Thanks a lot!
Its the gaussian filter L2 example from the Vitis Vision Library with very gentle adjustments - which I later want to include into a custom Apriltag implementation.
But before I want to simply run both in parallel.
I know your KRS flow should be capable of realizing this as well but I wanted to use the new kernel object flow because it allows one to simply upload a new binary via dfx and not rebuild an sd-card every time.

@jasvinderkhurana
Copy link

Thanks for sharing the detail on the sample you are trying!

I have recently tried Vitis Vision library function on Ubuntu 22.04 with Vitis 2022.1 release and they work perfectly fine. I have to try with Vitis 2024.1 tools.

I want to understand if Vitis 2024.1 version is a must requirement for your development or can you fallback to Vitis 2022.1? If you can use the older version, I can give you a simple example which you can build Vitis vision functions with KRS and you don't need to flash the sd_card everytime.. you can just copy the bitstream and .xclibin for your new functions.

@0xB4demeister
Copy link
Author

0xB4demeister commented Sep 16, 2024

I am driving an Ubuntu 22.04 as my daily PC and I remember when I started a few months ago, XRT and/or Petalinux installer weren't working for Vitis 2022.1 anymore - because they were already listed in the archive I considered better to move on to the most modern release and put some time also learning the new Python CLI and scripting the whole flow.

If I can get the general flow to work with Ubuntu 22.04 in Vitis 2022.1 would be fine for me as well and I would be very keen on having a look on the example but only as a workaround as I think the new Python CLI is way easier to maintain/extend then the tcl scripts

@0xB4demeister
Copy link
Author

@jasvinderkhurana could you please share the solution with 2022.1 for testing with me? To have at least something working would be really great! :)

@jasvinderkhurana
Copy link

@Fatalon , Sorry for the delay!

Actually I have an internal version of the example and I am working on making it a public release with proper documentation. For you, I have prepared this example with a basic documentation on how to use this. Please have a look at the attached files and let me know if this is helpful for you.
stereolbm_accel.zip
Vitis Vision Library Integration with KRS.pdf

@0xB4demeister
Copy link
Author

no problem :) Thanks a lot for your effort, I will have a look at it next Monday, when I am back at my desk :)

@0xB4demeister
Copy link
Author

I checked it out but I am still unsure, if I got it fully working.

Currently, I have the problem that I only generate the HLS files (when using the "With HLS Kernel" command but not the corresponding host code program.
This is the exact error I get, the executable is missing:

[100%] Linking CXX executable stereolbm_accel_tb
[100%] Built target stereolbm_accel_tb
-- Install configuration: ""
-- Installing: /home/paul/Documents/Spielwiese/krs_ws/install-kr260-ubuntu/lib/stereolbm_accel/stereolbm_accel.xclbin
-- Installing: /home/paul/Documents/Spielwiese/krs_ws/install-kr260-ubuntu/lib/stereolbm_accel/stereolbm_accel.dtbo
-- Installing: /home/paul/Documents/Spielwiese/krs_ws/install-kr260-ubuntu/lib/stereolbm_accel/stereolbm_accel.bit.bin
-- Installing: /home/paul/Documents/Spielwiese/krs_ws/install-kr260-ubuntu/lib/stereolbm_accel/shell.json
CMake Error at cmake_install.cmake:55 (file):
  file INSTALL cannot find
  "/home/paul/Documents/Spielwiese/krs_ws/build-kr260-ubuntu/stereolbm_accel/package":
  No such file or directory.

But I can load the kernel via xmutil into the system.
Now, when I afterward execute the "without HLS Kernel" command, I get all the files including an executable, which I can also successfully run on the board.

ubuntu@kria:~/install-kr260-ubuntu/lib/stereolbm_accel$ ./stereolbm_accel_tb
INFO: Found Xilinx Platform
INFO: Device found - edge
INFO: Loading '/lib/firmware/xilinx/stereolbm_accel/stereolbm_accel.xclbin'
[WARN] [1700601386.691801850] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
...
JASSI DEBUG 6
JASSI DEBUG 7
[INFO] [1700601415.192086238] [opencv_image_publisher]: Image published, count = 56
[INFO] [1700601415.202187649] [opencv_image_publisher]: Image published, count = 56
INside imageCbSync function
JASSI DEBUG 2
JASSI DEBUG 3
[XRT] ERROR: ptr == nullptr
JASSI DEBUG 4
[XRT] ERROR: ptr == nullptr
JASSI DEBUG 5
JASSI DEBUG 6
JASSI DEBUG 7

But I am not sure, if it now uses the kernel or not 😁

Also, your documentation states:
source install-kr260-ubuntu/setup.bash but this file is never copied - I copied the whole install-kr260-ubuntu folder just to be sure, but perhaps you have a more fine-grained approach.

Just as a sidenote - as I have currently 2024.1 and 2022.2 already installed on my system, I tried the whole examples with 2022.2 - I saw some critical warnings in the HLS synthesis phase but I am pretty sure the current issues are unrelated to that.

@jasvinderkhurana
Copy link

@Fatalon,

I think the issue is that it is not able to load the input images. Can you please copy the attached input images (left.png & right.png) to the stereolbm_accel directory on the KR260 board and then check again?

Seems like I have not handled the error properly if the images are not found. Thanks for pointing out I will update the code to handle errors properly.
left.png
right.png

@0xB4demeister
Copy link
Author

I get a segfault now

ubuntu@kria:~$ ros2 run stereolbm_accel stereolbm_accel_tb
XRT build version: 2.13.0
Build hash:
Build date: 2022-09-15 17:01:20
Git branch:
PID: 8508
UID: 1000
[Tue Nov 21 22:53:17 2023 GMT]
HOST: [ros2run]: Segmentation fault

@0xB4demeister
Copy link
Author

resolved it - perhaps you should mention in your documentation that you need to build a few packages for the -DNOKERNELS=false case as well, like colcon-hardware-acceleration, ament_acceleration,.. otherwise your module fails.

the current output I get is now

ubuntu@kria:~$ ros2 run stereolbm_accel stereolbm_accel_tb
INFO: Found Xilinx Platform
INFO: Device found - edge
INFO: Loading '/lib/firmware/xilinx/stereolbm_accel/stereolbm_accel.xclbin'
[WARN] [1700609808.838984725] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[INFO] [1700609810.005533033] [opencv_image_publisher]: Image published, count = 0
[INFO] [1700609810.005533053] [opencv_image_publisher]: Image published, count = 0
INside imageCbSync function
[INFO] [1700609810.032627204] [opencv_image_publisher]: Image published, count = 1
[INFO] [1700609810.033189039] [opencv_image_publisher]: Image published, count = 1
JASSI DEBUG 2
JASSI DEBUG 3
JASSI DEBUG 4
JASSI DEBUG 5
JASSI DEBUG 6
JASSI DEBUG 7
INside imageCbSync function
JASSI DEBUG 2
JASSI DEBUG 3
JASSI DEBUG 4
JASSI DEBUG 5
JASSI DEBUG 6
JASSI DEBUG 7
[INFO] [1700609810.363249860] [opencv_image_publisher]: Image published, count = 2
[INFO] [1700609810.372896177] [opencv_image_publisher]: Image published, count = 2
INside imageCbSync function

@0xB4demeister
Copy link
Author

how can I verify if it uses the HLS kernel or just a testbench executable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants