Renesas RZ/G2L
Run GPU-accelerated LVGL on a Renesas RZ/G2L board with Ubuntu, installing LVGL and the Mali driver with apt and building on the device instead of cross-compiling.
Overview
The RZ/G2L is a dual-core
Cortex-A55 MPU with an Arm Mali-G31 GPU. Canonical publishes Ubuntu images for it, which means LVGL can be
installed with apt from the LVGL PPA instead of being
cross-compiled, and the GPU can be used through the DRM driver's
EGL backend with no compositor in the way.
This guide goes from a booted board to LVGL's 3D truck demo running on the GPU, then to your own
application. It requires two apt repositories:
| PPA | Provides |
|---|---|
ppa:lvgl/lvgl | Prebuilt LVGL, headers, lvgl.pc and CMake config |
ppa:ubuntu-on-renesas/public-ppa | libmali-renesas-rz-g2l-g2lc, the Mali EGL/GLES userspace driver |
The steps were run on an RZ/G2L SMARC Evaluation Board Kit with a 1024x768 display. The libmali
package covers both the RZ/G2L and the RZ/G2LC, and nothing in this guide is specific to the SMARC carrier
board, so a different RZ/G2L board running the same Ubuntu image works the same way.
Prerequisites
Ubuntu on the board
Canonical publishes the images and the flashing instructions:
- Images: Ubuntu for Renesas IoT boards
- Instructions: Quick start guide to RZ/G2L with classic Ubuntu images (PDF)
Use the server image, not the desktop one
Pick Ubuntu Server 24.04 LTS (noble) arm64. The board has 2 GB of RAM, which a GNOME desktop will spend on itself, and LVGL doesn't require it: the DRM driver owns the display directly and renders on the GPU through EGL. Wayland is not required.
Build tooling
Everything from here runs on the board, over SSH or on the serial console:
sudo apt update
sudo apt install software-properties-common build-essential cmake gitsoftware-properties-common provides add-apt-repository and build-essential provides the compiler.
Installing LVGL and the Mali Driver
Add both PPAs:
sudo add-apt-repository ppa:ubuntu-on-renesas/public-ppa
sudo add-apt-repository ppa:lvgl/lvgl
sudo apt updateInstall the driver and LVGL:
sudo apt install libmali-renesas-rz-g2l-g2lc liblvgl-drm-3d-devFor this guide we recommend using liblvgl-drm-3d-dev a package with DRM and 3D support:
| Setting | Value | Description |
|---|---|---|
LV_USE_LINUX_DRM | Enabled | Renders straight to /dev/dri/card0, no compositor |
LV_LINUX_DRM_BACKEND | LV_LINUX_DRM_BACKEND_EGL | Rendering happens on the Mali GPU |
LV_USE_DRAW_NANOVG | Enabled | GPU draw unit, and the only one in this build |
LV_USE_GLTF | Enabled | Required for glTF and the 3D truck demo |
LV_USE_EVDEV | Enabled | Touch, mouse and keyboard input |
LV_COLOR_FORMAT_DEFAULT | LV_COLOR_FORMAT_XRGB8888 | Matches the DRM EGL backend |
The 2D-only liblvgl-drm-dev package works on this board too, but it has no glTF support, so the truck demo
below needs the -3d- one. See the package table for the full
list.
Running the 3D Truck Demo
lv_port_linux is LVGL's reference Linux project. Built with
LVGL_USE_INSTALLED=ON it links against the LVGL that apt installed and compiles nothing but its own glue
code and the demo.
Clone the port:
git clone https://github.com/lvgl/lv_port_linux.git
cd lv_port_linuxNo --recurse-submodules: the lvgl submodule is only needed when building LVGL from source.
Configure and build:
cmake -B build -DCMAKE_BUILD_TYPE=Release -DLVGL_USE_INSTALLED=ON -DCONFIG_LV_USE_DEMO_TRUCK=ON
cmake --build build -j$(nproc)LVGL_USE_INSTALLED=ON makes the project use the installed LVGL through find_package(lvgl) and skips
Kconfig entirely, so .config and the defconfigs are ignored and the feature set comes from the installed
lv_conf.h. Because the CONFIG_LV_* symbols are not available in this mode, the demo is selected on the
command line with -DCONFIG_LV_USE_DEMO_TRUCK=ON.
This takes about 17 seconds on the board.
Run it from the checkout root:
./build/bin/lvglsimThe PPA packages contain no demos
The published packages are built with LV_BUILD_DEMOS disabled, so lv_demo_widgets() and
lv_demo_benchmark() are not available. The truck demo is part of lv_port_linux, not of LVGL, which is
why it still works. Without -DCONFIG_LV_USE_DEMO_TRUCK=ON the simulator starts with a "Demos not enabled"
label, and src/main.c is where your own UI goes.
Useful flags: -B lists the display backends compiled into the binary (only DRM, for this package), -b
picks one when several are available, -R rotates the display, and -h prints the rest.
Permissions
Rendering and input come from two different device classes, each with its own group:
| Device | Group | Needed for |
|---|---|---|
/dev/dri/card0 | video | Opening the DRM device |
/dev/input/event* | input | Touch, mouse and keyboard through evdev |
The default ubuntu user on the Renesas image is already in video so you don't need sudo to run it.
In order to have input support you need to add the user to the input group.
sudo usermod -aG input ubuntuLog out and back in, or run newgrp input in the current shell, for the new group to take effect. Check
what you have with id.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
apt cannot find the packages | The PPAs only publish for 24.04 (noble) | Flash a 24.04 image |
| Blank screen or very low fps | The Mali driver is missing, so there is no GL implementation | sudo apt install libmali-renesas-rz-g2l-g2lc |
| Failure opening the DRM device | The user is not in video, or a desktop session owns the display | Add the user to video; on a desktop image stop the compositor |
| Touch or mouse does nothing | The user is not in input | sudo usermod -aG input ubuntu, then log in again |
| "Demos not enabled" label | Expected, the packages carry no demos | Pass -DCONFIG_LV_USE_DEMO_TRUCK=ON, or write your UI in src/main.c |
| The truck demo cannot load its model | Assets are looked up at ./3d | Run from the lv_port_linux root or set LV_LINUX_3D_PATH |
undefined reference to lv_demo_truck at link time | A 2D package is installed, so the demo compiled to nothing behind its LV_USE_GLTF guard | Install liblvgl-drm-3d-dev |
See Also
- Ubuntu — the PPA, and the full list of published packages
- DRM — backends, mode selection and support matrix
- evdev — finding and calibrating input devices
- NanoVG — the GPU draw unit these packages use
- glTF — loading 3D models
- RZ/G Family — the vendor-SDK projects for the RZ/G boards
- Found a problem with a package, or want another configuration published? Open an issue at github.com/lvgl/lvgl/issues.
Last updated on