Setting a Proper Queue Depth to Make Full Use of Hardware Resources

Background

You can use a media data processing V2 API on the Ascend 310P AI Processor to set the VPC queue depth within [10, 350]. When user services deliver tasks to a full VPC queue, VPC performs backpressure to block the tasks, which affects performance.

Principles

You can increase the VPC queue depth to address the conflict between user service task delivery and VPC task processing.

You can adjust the queue depth based on the task delivery speed and VPC processing performance of a single channel.

Reference processing performance of a VPC channel: 360 FPS for 1080p images.

Instructions

After a VPC channel is created using the hi_mpi_vpc_create_chn or hi_mpi_vpc_sys_create_chn call, set the attr parameter in the hi_vpc_chn_attr struct to configure the queue depth.

For details about the sample code for setting the VPC queue depth, see the queue_len parameter in the sample_vpc.cpp file.