UHD applications, including GNU Radio flowgraphs, can use DPDK by adding the following device argument:
use_dpdk=1
Important: UHD applications must be run as the root user when using DPDK. Use sudo to launch the application or switch to the root user using sudo su.
The following example demonstrates benchmark_rate using DPDK transport:
$ cd /usr/local/lib/uhd/examples
$ sudo nice -n -20 taskset -c 13-20 ./benchmark_rate \
--args="addr=192.168.10.2,second_addr=192.168.20.2,mgmt_addr=192.168.30.2,\
use_dpdk=1,type=x4xx,send_frame_size=8192,recv_frame_size=8192,\
num_send_frames=8192,num_recv_frames=8192,master_clock_rate=500e6" \
--rx_rate 500e6 \
--tx_rate 500e6 \
--rx_channels 0,1,2,3 \
--tx_channels 0,1,2,3 \
--rx_delay 1 \
--tx_delay 1 \
--priority high \
--multi_streamer
[INFO] [UHD] linux; GNU C++ version 13.3.0; Boost_108300; DPDK_23.11; UHD_4.10.0.HEAD-0-g2af4ddb9
EAL: Detected CPU lcores: 24
EAL: Detected NUMA nodes: 1
EAL: Detected shared linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: Probe PCI driver: mlx5_pci (15b3:1017) device: 0000:a2:00.0 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:1017) device: 0000:a2:00.1 (socket 0)
TELEMETRY: No legacy callbacks, legacy socket not created
[00:00:00.000132] Creating the usrp device with: addr=192.168.10.2,second_addr=192.168.20.2,mgmt_addr=192.168.30.2,use_dpdk=1,type=x4xx,send_frame_size=8192,recv_frame_size=8192,num_send_frames=8192,num_recv_frames=8192,master_clock_rate=500e6...
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.30.2,type=x4xx,product=x410,serial=3246861,name=ni-x4xx-3246861,fpga=CG_400,rpc_version=1,claimed=False,addr=192.168.10.2,second_addr=192.168.20.2,use_dpdk=1,send_frame_size=8192,recv_frame_size=8192,num_send_frames=8192,num_recv_frames=8192,master_clock_rate=500e6
[INFO] [MPM.PeriphManager] init() called with device args `fpga=CG_400,master_clock_rate=(500000000.0,),mgmt_addr=192.168.30.2,name=ni-x4xx-3246861,num_recv_frames=8192,num_send_frames=8192,product=x410,recv_frame_size=8192,rpc_version=1,second_addr=192.168.20.2,send_frame_size=8192,use_dpdk=1,clock_source=internal,time_source=internal,initializing=True'.
Using Device: Single USRP:
Device: X400-Series Device
Mboard 0: x410
RX Channel: 0
RX DSP: n/a
RX Dboard: A
RX Subdev: 0
RX Channel: 1
RX DSP: n/a
RX Dboard: A
RX Subdev: 1
RX Channel: 2
RX DSP: n/a
RX Dboard: B
RX Subdev: 0
RX Channel: 3
RX DSP: n/a
RX Dboard: B
RX Subdev: 1
TX Channel: 0
TX DSP: n/a
TX Dboard: A
TX Subdev: 0
TX Channel: 1
TX DSP: n/a
TX Dboard: A
TX Subdev: 1
TX Channel: 2
TX DSP: n/a
TX Dboard: B
TX Subdev: 0
TX Channel: 3
TX DSP: n/a
TX Dboard: B
TX Subdev: 1
[00:00:03.697105621] Setting device timestamp to 0...
[INFO] [MULTI_USRP] 1) catch time transition at pps edge
[INFO] [MULTI_USRP] 2) set times next pps (synchronously)
[00:00:04.813216119] Testing receive rate 500.000000 Msps on 1 channels
[00:00:04.813856225] Testing receive rate 500.000000 Msps on 1 channels
[00:00:04.814491729] Testing receive rate 500.000000 Msps on 1 channels
Setting TX samples per packet (spp) to 1984
Setting TX samples per burst (spb) to 1984
[00:00:04.815134443] Testing receive rate 500.000000 Msps on 1 channels
Setting TX samples per packet (spp) to 1984
Setting TX samples per burst (spb) to 1984
[00:00:04.817057879] Testing transmit rate 500.000000 Msps on 1 channels
[00:00:04.818885744] Testing transmit rate 500.000000 Msps on 1 channels
Setting TX samples per packet (spp) to 1984
Setting TX samples per burst (spb) to 1984
Setting TX samples per packet (spp) to 1984
Setting TX samples per burst (spb) to 1984
[00:00:04.821423291] Testing transmit rate 500.000000 Msps on 1 channels
[00:00:04.824170578] Testing transmit rate 500.000000 Msps on 1 channels
[00:00:15.108870012] Benchmark complete.
Benchmark rate summary:
Num received samples: 20518086644
Num dropped samples: 0
Num overruns detected: 0
Num transmitted samples: 20070632064
Num sequence errors (Tx): 0
Num sequence errors (Rx): 0
Num underruns detected: 0
Num late commands: 0
Num timeouts (Tx): 0
Num timeouts (Rx): 0
Done!