High cpu usage on VPU encoder with Verdin IMX8MP

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


VPU CPU Usage Analysis for Verdin iMX8M Plus

Based on the documentation and your setup with the Framos FSM:GO IMX662 camera on Verdin iMX8M Plus with Torizon 6, here are several factors that could contribute to high CPU usage:

Pipeline Optimization Recommendations

For the Verdin iMX8M Plus, the recommended GStreamer pipeline structure for hardware-accelerated encoding includes specific elements(1):

gst-launch-1.0 videotestsrc ! videoconvert ! vpuenc_h264 ! video/x-h264 ! h264parse ! qtmux ! filesink location=videotestsrc.mp4

(1)

Potential CPU Usage Sources

  1. Format Conversion: While NV12 is typically optimal for VPU encoding, ensure no unnecessary format conversions are happening. The videoconvert element might be performing CPU-based conversions(2).

  2. Buffer Management: Your current queue configuration (max-size-buffers=2) might be causing buffer management overhead. Consider adjusting buffer sizes or using hardware buffer pools.

  3. VPU Configuration: The VPU encoder parameters like bitrate=4000 and gop-size=30 should be optimized for your use case.

Debugging Steps

To identify the CPU usage source, you can use GStreamer debugging tools(2):

export GST_DEBUG=2

(2)

This will show warning and error messages that might indicate where CPU-intensive operations are occurring.

Torizon OS 7 VPU Status

Regarding VPU support in Torizon OS 7, the documentation indicates that there is currently no official VPU support for any SoM on Torizon OS 7.x, though this is planned for future development(3). This confirms your observation about VPU functionality in Torizon 7.

Container Configuration

Ensure your container has proper access to VPU devices and is using the appropriate base image. For hardware-accelerated multimedia on iMX8M Plus, the wayland-base-vivante container image is recommended(3).

Next Steps

  1. Add debugging output to identify bottlenecks
  2. Experiment with different buffer configurations
  3. Verify that hardware acceleration is actually being used by checking /dev/video* devices
  4. Consider pipeline restructuring to eliminate unnecessary conversions

Could you provide the exact version of Torizon OS 6 you’re running? This will help provide more specific guidance for your setup.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.