GPU acceleration in Chromium container on Torizon OS iMX8M-Plus

Simliar topic has been discussed on the community. As an example:

In the KB, I can read

The last known version that works with GPU acceleration in i.MX modules is Chromium v101. Any newer versions do not support GPU hardware acceleration.

And for this reason, even the latest torizon/chromium:3.0.1 contains v101.

But in OSSystems/meta-browser I cannot find this limitation.
This issue reports some problems with v110+, and it links about://gpu of last working version, which is v109

Graphics Feature Status
Canvas: Hardware accelerated
Canvas out-of-process rasterization: Disabled
Direct Rendering Display Compositor: Disabled
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
OpenGL: Enabled
Rasterization: Hardware accelerated
Raw Draw: Disabled
Video Decode: Hardware accelerated
Video Encode: Software only. Hardware acceleration disabled
Vulkan: Disabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
...

Are you sure that Chromium versions above v101 doesn’t support GPU HW acceleration?

I found this blog post online, that details the steps used to enable HW acceleration for iMX8M-Mini.
It uses an older release of Chromium (v96), but I see come differences from Toradex approach:
As an example

    volumes:
    - /run/user/63:/run/user/63
    - /dev/dri:/dev/dri
    - /dev/galcore:/dev/galcore
    device_cgroup_rules:
    - 'c 199:* rmw'
    - 'c 226:* rmw'

in docker-compose.yml
And starting chromium with the following flags

echo "Starting Chromium: $@"
/usr/lib/chromium/chrome \
    --use-gl=egl \
    --ozone-platform=wayland \
    --no-sandbox \
    --disable-features=VizDisplayCompositor \
    --in-process-gpu \
    --start-maximized \
    --disk-cache-size=33554432 \
    "$@"

I see from the last screenshot in the blog post, that benchmark of https://webglsamples.org/fishtank/fishtank.html with 10 fishes and sharks is 22 fps.
I tried the same benchmark with Torizon OS + Chromium on iMX8M-Plus, but I have 14 fps.

Do you see any space for improvements on Torizon OS?

Hi @vix ,

In the KB, I can read

The last known version that works with GPU acceleration in i.MX modules is Chromium v101. Any newer versions do not support GPU hardware acceleration.

Right, I think this last sentence in our article isn’t entirely accurate to what we meant. It should be something like:

Any newer versions may not support GPU hardware acceleration.

I’ll bring this up to the team to clarify the article in question, thanks!


Are you sure that Chromium versions above v101 doesn’t support GPU HW acceleration?

From what I gathered internally Chromium v101 is currently the version we’re sure GPU acceleration is supported for the iMX8 SoMs. Others versions might work, but right now we can’t guarantee HW acceleration for those.

Do you see any space for improvements on Torizon OS?

I think it’s a valid point for discussion. I’ll bring this up to the container team, thank you!

Best regards,
Lucas Akira

Is this one (bookworm branch) the repo with the Dockerfiles used to build Chromium and Cog containers inclued in Torizon OS with Evaluation Containers?

I see that Cromium and Cog are installed through apt-get, so I think that the latest release of them is picked when the container is built.
Is this the case?

Hi @vix ,

That’s the repo we use to build our browser container images, yes. They are installed with apt-get, but we use our own feeds for some packages, and that includes Chromium. You can see in the Chromium image Dockerfile that it is based on torizon/wayland-base-vivante, and that is based on our base container image torizon/debian:3-bookworm.

In this base image Dockerfile you can see our package feeds being added:

In our feeds you can see that we still use Chromium v101 in our latest snapshot:


Earlier this year when we updated our Chromium container images to bookworm we were having some build problems with the iMX8 SoCs in versions newer than v101: chromium 103 does not build for imx8qm · Issue #649 · OSSystems/meta-browser · GitHub .

v101 was at the time the latest version supported by meta-imx (the kirkstone branch I believe) and that built successfully, so we decided to use this version.

Hope this clarifies.

Best regards,
Lucas Akira

1 Like

I can give some details that I hope can be useful to Toradex engineers.
If I’m right, Toradex installs Vivante drivers inside wayland-base-vivante container

This is done running apt-get

On the other side, foundries.io installs them with a script, wget-ting the binaries from NXP and copying them into the container
https://github.com/foundriesio/containers/blob/c53467d847d2f5860606e179be51b4dffd7d037f/0debian-base-imx8-aarch64/imx8-libs.sh#L13-L20

Based on what I see on their blog post, they have 22 fps on FishTank example witn the Mini (GPU GC7000NanoUltra) which has a GPU less performant than the GC7000UltraLite of the Plus.
And, as I show on this topic the Toradex Chromium container get only 14 fps on the same FishTank example on the Plus.

I’m going to do other tests, but maybe this is a direction to look into
Since foundries.io is one of the Toradex partners, is it possible for Toradex to investigate their way to handle this topic?

1 Like

Hi Vix! :smiley:

On the other side, foundries.io installs them with a script, wget -ting the binaries from NXP and copying them into the container

The issue is probably not in the way we install drivers, we also just package those exact binaries provided by NXP, imx-gpu-viv-wayland is a package of ours and it’s heavily tested. Rather, it’s most likely our Chromium build.

I’ve raised this issue internally and we’ll review the build. 8 FPS can really make a difference from 14 to 22. As always, I appreciate the detailed report.

Cheers,

1 Like