6.4. Chromium Browser - User Guide

6.4.1. Overview

On TI devices with IMG Rogue class GPU’s. The Chromium browser (available from https://chromium.googlesource.com/chromium/src/) is accelerated using OpenGLES.

The version of Chromium that is build can be obtained with this command:

$ chromium --version
Chromium 123.0.6312.122 stable

The version of Chromium shown here is the one that GPU acceleration is verified to work with.

6.4.2. Launching Chromium Browser

Danger

For security reasons it is suggested never to run Chromium as the root user.

To launch the Chromium browser:

Assuming you are logged in as the root user.

Switch to the weston user:

$ su weston

And then run the chromium binary:

$ /usr/bin/chromium [url] [options]

e.g.

$ chromium https://www.ti.com

Will open www.ti.com in a windowed browser on the Weston desktop.

$ chromium https://webglsamples.org/aquarium/aquarium.html --start-fullscreen

Will open the aquarium 3d benchmark in a fullscreen window on the Weston desktop.

The --start-fullscreen switch will make the chromium browser consume the entire screen including overwriting the Weston menu bar.

This will start chromium and provided you have network connectivity to the internet from the TI platform it will connect to an example application that uses WebGL/Javascript and renders fish swimming in a fish bowl using the 3D GPU.

6.4.3. Graphics Feature Status

To see the GPU features that are in use, enter chrome://gpu into the Chromium URL/Navigation bar. A web page will be rendered with this information. The below example shows what is enabled/disabled when GPU acceleration is working correctly

*   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
*   WebGPU: Disabled

If for some reason you suspect the GPU is rending something incorrectly, you can run chromium with GPU disabled using the --disable-gpu flag:

$ chromium https://webglsamples.org/aquarium/aquarium.html --start-fullscreen --disable-gpu

To get raw performance numbers from the GPU, you may want to disable frame sync locking in Chromium. This will tell Chromium never to wait for VSYNC and render as fast as the GPU can achieve.

$ chromium https://webglsamples.org/aquarium/aquarium.html --start-fullscreen --disable-gpu-vsync --disable-frame-rate-limit

6.4.4. Running Chromium as the root user

This is absolutely not recommended, as to do so gives a web page too much access to your system. To run in this mode you also have to provide the --no-sandbox switch, which disables all sandboxing of the browser from the base system and could leave you open for a malicious webpage to do something nefarious.

6.4.5. How to build Chromuim under Yocto

Pull in the meta-browser and meta-clang layer into a Scarthgap Yocto build.

meta-browser should be pinned to commit:

commit 1ed2254d72a4c25879014c98be287a7e3e22904c
Author: Max Ihlenfeldt <max@igalia.com>
Date:   Wed May 22 14:54:02 2024 +0200

    chromium: Backport missing dependency in NewTabPage (#816)

meta-clang needs to be pinned to HEAD commit of branch “scarthgap”, as of the time of writing that equates to this commit:

commit e7dceb1c92caf7f21ef1d7b49c85328c30cffd90 (HEAD -> scarthgap, origin/scarthgap)
Author: Etienne Cordonnier <ecordonnier@snap.com>
Date:   Fri May 3 17:47:46 2024 +0200

    clang: use release tarball instead of git

With these layers pinned to the correct commit, you need to make sure they are referenced in build/conf/bblayers.conf This is done automatically if you use the oe-layersetup tool.

$ cd yocto_dir
$ ./oe-layersetup -f config/arago-scarthgap-chromium-config.txt

Once this is done, use bitbake to create the tisdk-default-image. This will detect the meta-browser and meta-clang layers, automatically building and adding Chromium to the root filesystem image.

Tip

Build times of Chromium can be very long depending on the size of your build machine. It has been found that you need at least 64Gigs of RAM, and on a 28 thread Intel Core-I9 with an SSD for the build driver it will still take upwards of 2 hours just to build Chromium. A full Yocto Scarthgap build that includes Chromium can easily take 400GBytes of SSD.

The following will initiate a full tisdk-default-image build that would include Chromium if the meta-browser and meta-clang layers are present:

$ MACHINE=<machine> bitbake tisdk-default-image

If you want to significantly reduced image size, the IPKs can be built directly using the following:

$ MACHINE=<machine> bitbake core-image-weston
$ MACHINE=<machine> bitbake chromium-ozone-wayland

Where <machine> is defined in the Build Options section of “Building the SDK with Yocto”

tisdk-default-image is the only image that chromium will get built into by default. If you want to build it into another image, then you would need to modify the .bb recipe for the image. Or alternatively add the line:

IMAGE_INSTALL:append = " chromium-ozone-wayland"

Somewhere into your build/conf/local.conf file.

6.4.6. Limitations

  • Audio/video within the browser is not supported.

  • Hardware acceleration of video either decode or encode is not supported.

6.4.7. Performance

Performance of WebGL Aquarium

Standard WebGL benchmarks available at these URLS: https://webglsamples.org/aquarium/aquarium.html

Run as the weston user with the command line chromium https://webglsamples.org/aquarium/aquarium.html --start-fullscreen

Platform

Performance FPS

GPU Utilisation

AM62Px

36 @ 1080p60

72%

Note

GPU Utilisation is captured using,

root@am62pxx-evm:~# cat /sys/kernel/debug/pvr/status

Performance of MotionMarkv1.3

Standard Javascript benchmarks available at these URLS: https://browserbench.org/MotionMark/

Run as the weston user with the command line chromium https://browserbench.org/MotionMark/ --start-fullscreen use the mouse to click the “Run Benchmark” button.

Platform

MotionMark v1.3

AM62Px

51.56 @ 1080p60