Official VPU torizon sample not working

I am trying to run the gstreamer vpu example from here: torizon-samples/vpu/generic/vpuGeneric at bookworm-new · toradex/torizon-samples

However the vpu does not seem to work and i get an error: vpugeneric-1 | ERROR: from element /GstPipeline:pipeline0/vpuenc_h264:vpuenc_h264-0: Could not initialize supporting library.

I build the image via:

docker build --build-arg BASE_NAME=wayland-base-vivante --build-arg IMAGE_ARCH=arm64/v8 -t vpugeneric .

and then run via:

 env TAG=latest docker compose up

My device is verdin-imx8mp.
This is the full output i get:

 ⠦ Container vpugeneric-weston-1      Recreated                                                                                                    1.5s
 ⠙ Container vpugeneric-vpugeneric-1  Recreated                                                                                                    0.1s
Attaching to vpugeneric-1, weston-1
weston-1      | Switching VT tty1 to text mode if currently in graphics mode
weston-1      | Switching to VT 7
weston-1      | SoC is: 'i.MX8MP'
weston-1      | SoC has GPU: true
weston-1      | SoC has DPU: false
weston-1      | g2d implementation: viv
weston-1      | Removing previously created '.X*-lock' entries under /tmp before starting Weston. Pass 'IGNORE_X_LOCKS=1' environment variable to Weston container to disable this behavior.
weston-1      | dos2unix: converting file /etc/xdg/weston/weston.ini to Unix format...
weston-1      | dos2unix: converting file /etc/xdg/weston-dev/weston.ini to Unix format...
weston-1      | 00:00:00.000 [INFO] [seatd/seat.c:39] Created VT-bound seat seat0
weston-1      | 00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started
weston-1      | Date: 2025-06-27 UTC
weston-1      | [14:15:30.809] weston 10.0.1
weston-1      |                https://wayland.freedesktop.org
weston-1      |                Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
weston-1      |                Build: lf-5.15.52-2.1.0-10-g9452feba
weston-1      | [14:15:30.809] Command line: weston -Bdrm-backend.so --current-mode -Swayland-0
weston-1      | [14:15:30.809] OS: Linux, 6.6.84-7.2.0-g87bfb710b6f1, #1-Torizon SMP PREEMPT Mon Mar 31 08:47:48 UTC 2025, aarch64
weston-1      | [14:15:30.809] Flight recorder: enabled
weston-1      | [14:15:30.810] Using config file '/etc/xdg/weston/weston.ini'
weston-1      | [14:15:30.811] Output repaint window is 7 ms maximum.
weston-1      | [14:15:30.811] Loading module '/usr/lib/aarch64-linux-gnu/libweston-10/drm-backend.so'
weston-1      | [14:15:30.831] initializing drm backend
weston-1      | [14:15:30.831] Trying libseat launcher...
weston-1      | 00:00:00.072 [INFO] [seatd/server.c:145] New client connected (pid: 28, uid: 1000, gid: 1000)
weston-1      | 00:00:00.073 [INFO] [seatd/seat.c:170] Added client 7 to seat0
weston-1      | 00:00:00.073 [INFO] [seatd/seat.c:480] Opened client 7 on seat0
weston-1      | [14:15:30.832] libseat: session control granted
weston-1      | [14:15:30.837] using /dev/dri/card1
weston-1      | [14:15:30.837] DRM: supports atomic modesetting
weston-1      | [14:15:30.837] DRM: does not support GBM modifiers
weston-1      | [14:15:30.837] DRM: supports picture aspect ratio
weston-1      | [14:15:30.837] Loading module '/usr/lib/aarch64-linux-gnu/libweston-10/gl-renderer.so'
weston-1      | [14:15:30.872] EGL client extensions: EGL_EXT_client_extensions
weston-1      |                EGL_EXT_platform_base EGL_KHR_platform_wayland
weston-1      |                EGL_EXT_platform_wayland EGL_EXT_device_query
weston-1      |                EGL_EXT_device_drm EGL_EXT_device_drm_render_node
weston-1      |                EGL_KHR_platform_gbm
weston-1      | [14:15:30.873] failed to initialize display
weston-1      | [14:15:30.873] EGL error state: EGL_NOT_INITIALIZED (0x3001)
weston-1      | [14:15:30.873] failed to initialize egl
weston-1      | 00:00:00.114 [INFO] [seatd/seat.c:418] No clients on seat0 to activate
weston-1      | 00:00:00.115 [INFO] [seatd/seat.c:524] Closed client 7 on seat0
weston-1      | 00:00:00.115 [INFO] [seatd/seat.c:192] Removed client 7 from seat0
weston-1      | [14:15:30.874] fatal: failed to create compositor backend
weston-1      | Internal warning: debug scope 'drm-backend' has not been destroyed.
weston-1      | 00:00:00.115 [INFO] [seatd/client.c:471] Client disconnected
weston-1      | 00:00:00.121 [INFO] [seatd/seatd.c:218] seatd stopped
weston-1      | Switching back to vt 1
weston-1 exited with code 1
vpugeneric-1  | xz: (stdin): File format not recognized
vpugeneric-1  | tar: Child returned status 1
vpugeneric-1  | tar: Error is not recoverable: exiting now
vpugeneric-1  |  _______________________________
vpugeneric-1  | /                               \
vpugeneric-1  | |  Running H.264 Encode test... |
vpugeneric-1  | \                               /
vpugeneric-1  |  -------------------------------
vpugeneric-1  |     \
vpugeneric-1  |      \
vpugeneric-1  |          .--.
vpugeneric-1  |         |o_o |
vpugeneric-1  |         |:_/ |
vpugeneric-1  |        //   \ \
vpugeneric-1  |       (|     | )
vpugeneric-1  |      /'\_   _/`\
vpugeneric-1  |      \___)=(___/
vpugeneric-1  |
vpugeneric-1  | (gst-plugin-scanner:15): GStreamer-CRITICAL **: 14:15:31.924: gst_element_class_add_pad_template: assertion 'GST_IS_PAD_TEMPLATE (templ)' failed
vpugeneric-1  |
vpugeneric-1  | (gst-plugin-scanner:15): GStreamer-CRITICAL **: 14:15:31.927: gst_element_class_add_pad_template: assertion 'GST_IS_PAD_TEMPLATE (templ)' failed
vpugeneric-1  | Setting pipeline to PAUSED ...
vpugeneric-1  | ERROR: from element /GstPipeline:pipeline0/vpuenc_h264:vpuenc_h264-0: Could not initialize supporting library.
vpugeneric-1  | Additional debug info:
vpugeneric-1  | ../gst-libs/gst/video/gstvideoencoder.c(1804): gst_video_encoder_change_state (): /GstPipeline:pipeline0/vpuenc_h264:vpuenc_h264-0:
vpugeneric-1  | Failed to start encoder
vpugeneric-1  | ERROR: pipeline doesn't want to preroll.
vpugeneric-1  | Failed to set pipeline to PAUSED.

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

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


Hello! Thank you for providing such a detailed description and logs. Let’s break down what’s happening and some steps that can help you resolve the VPU initialization issue with your Verdin iMX8M Plus.

Key Points to Check

  1. BSP Version and VPU Plugin Support
    There are known issues with VPU support in certain BSP and Torizon OS versions. Please verify the Torizon OS/BSP version you are using. If you are using Torizon OS 6 or 7, VPU plugins and device support differ. Details on BSP-related VPU issues can be found here:
    https://community.toradex.com/t/verdin-imx8m-mini-gstreamer-error-when-opening-vpuenc_h264/26621

  2. Device Nodes
    Ensure the VPU device nodes are present on your system. Run:

    ls /dev/video*
    

    You should see device files like /dev/video0, /dev/video1, etc. If these are missing, the VPU driver may not be loaded correctly.
    (reference)

  3. Container Base Image
    You are already using wayland-base-vivante, which is correct. This base contains needed VPU-related GStreamer plugins for i.MX8M Plus devices.
    (reference)

  4. GStreamer Pipeline Structure
    To test if basic VPU support is working, run a simple test pipeline on your system:

    gst-launch-1.0 videotestsrc ! video/x-raw ! vpuenc_h264 ! video/x-h264 ! fakesink
    

    If this fails with a similar error, the issue is likely related to the environment or base image.
    (reference)

  5. Plugin Installation
    Make sure your container includes the necessary GStreamer plugins, specifically the imxvpudec and imxvpuenc plugins or their equivalents for your board variant. You can list available plugins inside the container using:

    gst-inspect-1.0 | grep vpu
    

    If vpuenc_h264 does not appear, you need to install the appropriate GStreamer plugin packages.

  6. Weston and EGL Errors (Non-VPU)
    The failure to initialize Weston and EGL (EGL_NOT_INITIALIZED) typically relates to graphics/display, not directly to VPU operation. However, misconfiguration in weston or GPU driver stack might point to a broader kernel or userland mismatch affecting multimedia hardware. Still, for VPU encoding, display is not required unless your pipeline displays the output.

Recommendations

  • Run the simple GStreamer pipeline above inside your container, after connecting to it with docker exec -it <container> /bin/bash.
  • Confirm the presence of device nodes /dev/video*.
  • List VPU-related plugins using gst-inspect-1.0 | grep vpu inside the container.
  • Double check your Dockerfile/packages—make sure all runtime packages (drivers, gstreamer plugins) are being installed correctly.
  • Check the OS/BSP version. Consider testing with the latest Torizon OS 6.x stable.

References

Please try these checks and share the output of:

  • ls /dev/video*
  • gst-inspect-1.0 | grep vpu

This will help to further identify the problem.

Best regards,
Toradex AI Assistant.

Greetings @mbcel,

This is a known issue currently. That VPU example was more of a proof-of-concept that was initially created for a much older version of software than what our current software releases are based upon.

We have it in our product backlog to update this example and keep it better maintained going forward.

I assume you require VPU usage for your product, correct? Do you have a rough timeline of when this would be needed?

Best Regards,
Jeremias

Hi Jeremias,

yes we desperately need it. The software encoder is not usable in our case since it consumes 100% cpu and basically freezes our device. Also we need a free CPU for other calculations.

Regarding timeline, we need it now. Is there any workaround or older version we can use as a quick fix now? Or what changes need to be made to the current vpu example? We are currently using Torizon OS 7.2.0.

Best,
Marcel

Let me check with our team internally and see if there’s any options that can be done in the short-term.

Best Regards,
Jeremias

Perhaps you can try the VPU sample on Torizon 6 instead of 7. It was originally designed for that version in the first place. So there’s a greater chance it will work. Though you’ll need to see if it can fulfill your specific use-case.

Best Regards,
Jeremias