Steps required for p2p data transfer - 2022.2 English - XD099

Vitis Tutorials: Hardware Acceleration (XD099)

Document ID
XD099
Release Date
2022-12-01
Version
2022.2 English

To transfer the data through p2p the following steps are needed

  1. Enable the p2p of the source device

  2. Declare the source buffer out1 as P2P buffer

Step 1: Enabling p2p of the device

sudo /opt/xilinx/xrt/bin/xbutil configure --device 0000:65:00.1 --p2p enable

After the warm reboot (sudo reboot now) check the p2p enablement status through xbutil examine

xbutil examine -d 0000:65:00.1 -r platform

----------------------------------------------------
1/1 [0000:65:00.1] : xilinx_u50_gen3x16_xdma_base_5
----------------------------------------------------
Platform
    ...
    ...
   P2P Status             : enabled

Step 2: P2P version of the host-code inspection

The final p2p version of the host code is host_p2p.cpp. There are only two differences

  1. Output buffer of the source device is declared as p2p buffer

auto out1 = xrt::bo(device1, vector_size_bytes, xrt::bo::flags::p2p, krnl.group_id(1));
  1. Output buffer synchronization of the source device is commented out out1.sync(XCL_BO_SYNC_BO_FROM_DEVICE)

 for (int i = 0; i < loop; i++) {
  //out1.sync(XCL_BO_SYNC_BO_FROM_DEVICE);
  in2.sync(XCL_BO_SYNC_BO_TO_DEVICE);
}