Is it possible to run a ROS 2 ws using the GPU/NPU on the Rock 5

I am currently working with a Rock 5 Model B and a ROS 2 Humble workspace that includes several nodes. One of these nodes is a publisher that performs object detection using YOLOv8. The model is currently in the .pt format.

I would like to know if it is possible to make this workspace, or at least the object detection node, run on the GPU or NPU instead of the CPU to improve performance.

1 Like

hi, @CuriousROS

I am not familiar with the ROS 2, but if you want to use it with python or C (I think they support on ROS 2), you may could do this in the nodes,

First step, you need to conver the YOLOV8.pt to YOLOv8.rknn which format support on rk3588 npu. Secondly, use rknpu runtime api to inference it wirh npu, after you get the inference result you can use them on your ROS project.

For more details to use NPU or how to inference YOLOv8 by NPU, please reference the following links:
official doc:


source code:

rknpu docs:

i hope you can find your way to run on ROS 2 with NPU

best,
Morgan

1 Like