AMD Versal AI Edge Series Gen 2 - Mali-G78AE Linux DDK

AMD Versal AI Edge Series Gen 2 - Mali-G78AE Linux DDK

 

The purpose of this page is to describe how the ARM MALI-G78AE Linux driver and user-space drivers are integrated into AMD Versal AI Edge Series Gen 2 and Versal Prime Series Gen 2 devices.

 

GPU SW Stack Overview and Features

Versal AI Edge Series Gen 2 SoC uses Arm® Mali-G78AE GPU for 2D/3D graphics acceleration. Mali-G78AE is the second generation Valhall architecture-based GPU and first to be developed for autonomous use cases to suit both automotive and industrial applications.

Refer to UG1784 for more details about Software stack and IP features.

Driver Access & License Information

malig78ae-kbase/license.txt at r54p1-12eac0 · Xilinx/malig78ae-kbase

GitHub - Xilinx/malig78ae-arbitration

Yocto Build Steps

  1. Create a Yocto repository by following the steps mentioned at AMD EDF Getting started.

  2. Adding custom packages in yocto by adding below lines to build/conf/local.conf

    1. Enabling linuxfb plugin for QT (This is optional step. Only needed to test linuxfb plugin)

      IMAGE_INSTALL:append = "packagegroup-xilinx-qt” PACKAGECONFIG:append:pn-qtbase = " linuxfb"
    2. Enabling Virtual KMS in kernel configuration for running fbdev applications

      1. Add config file with VKMS kernel config at meta-xilinx/meta-xilinx-core/recipes-kernel/linux/linux-xlnx/config_changes.cfg

        CONFIG_DRM_VKMS=y
      2. Add this config file in meta-xilinx/meta-xilinx-core/recipes-kernel/linux/linux-xlnx.inc

        SRC_URI += "file://config_changes.cfg "
      3. Fbdev applications can also run on HDMI-based designs by enabling the HDMI modules

        IMAGE_INSTALL:append = " kernel-module-hdmi21"
    3. Enabling configs for generating gpu-unfied-sdk applications

      1. EXTRA_IMAGE_FEATURES = "debug-tweaks dev-pkgs" IMAGE_INSTALL:append = " glmark2 packagegroup-core-weston kmscube wayland-protocols wayland vulkan-loader vulkan-headers libpng opencl-headers opencl-headers-dev opencl-icd-loader-dev libmali-xlnx-dev glm-dev vulkan-tools"
      2. For running fbdev applications, enable HDMI or VKMS.

  3. Building Image and rootfs

    MACHINE=amd-cortexa78-mali-common bitbake edf-linux-disk-image
  4. Generating SDK

    MACHINE=amd-cortexa78-mali-common bitbake edf-linux-disk-image -c do_populate_sdk cd build/tmp/deploy/sdk/ ./amd-edf-glibc-x86_64-edf-linux-disk-image-cortexa72-cortexa53-amd-cortexa78-mali-common-toolchain-26.06+release-<...>.sh
  5. Generating boot.bin

  • RevA

    • MACHINE=versal-2ve-2vm-vek385-multidomain bitbake xilinx-bootbin
  • RevB

    • MACHINE=versal-2ve-2vm-vek385-revb-multidomain bitbake xilinx-bootbin
  • RevA

    • MACHINE=versal-2ve-2vm-vek385-sdt-seg bitbake xilinx-bootbin
  • RevB

    • MACHINE=versal-2ve-2vm-vek385-revb-sdt-seg bitbake xilinx-bootbin

Example GPU Applications

Prerequisites

  1. Installing packages

    dnf install packagegroup-core-weston dnf install glmark2 dnf install packagegroup-xilinx-qt dnf install kmscube
    1. Installing OpenCL loader

      dnf install opencl-icd-loader-dev
    2. Running CTS/externally compiled apps

      dnf install libmali-xlnx-dev
  2. Selecting the dma_heap node (Prerequisites)

    1. By default dma_heap node used will be /dev/dma_heap/reserved and it will link to /dev/dma_heap/*cma*

    2. If you are using custom reserved node, reserved node is not having “cma” string in it, then you need to follow below steps.

      1. For example, if the heap node is /dev/dma_heap/xxxx@yyyyyyyy,
        users should set the environment variable as follows:
        AMD_HEAPS_MEMORY_HEAP_NAME="xxxx@yyyyyyyy" in /etc/environment.

      2. Exit the login shell and re-login

  3. On boot, connect a keyboard to access the kmscon login. After logging in, Weston should start automatically, allowing you to run Wayland applications.

  4. Run kmscube after ensuring that Weston is not running. You can stop it by disabling kmscon or terminating the /bin/sh /usr/bin/kmscon-launch-gui weston process.

    kmscube
  5. Weston

    1. Weston will automatically start when you log in through kmscon.

  1. Installing packages

    dnf install packagegroup-core-weston dnf install glmark2 dnf install packagegroup-xilinx-qt dnf install kmscube
    1. Installing Opencl loader

      dnf install opencl-icd-loader-dev
  2. Selecting the dma_heap node (Prerequisites)

    1. For example, if the heap node is /dev/dma_heap/cma_reserved@0840000000,
      users should set the environment variable as follows:
      AMD_HEAPS_MEMORY_HEAP_NAME="cma_reserved@0840000000" in /etc/environment.

    2. If no custom heap name is provided, the default heap name /dev/dma_heap/reserved
      will be used.

    3. DMA heap nodes

      1. RevA
        /dev/dma_heap/cma_reserved@0840000000

      2. RevB
        /dev/dma_heap/cma_reserved@800000000

    4. Exit the login shell and re-login

  3. Update user-space library soft links manually while running externally cross-compiled GPU applications

    cd /usr/lib/ ln -sf libEGL.so.1 libEGL.so ln -sf libGLESv1_CM.so.1 libGLESv1_CM.so ln -sf libGLESv2.so.2 libGLESv2.so ln -sf libgbm.so.1 libgbm.so
  4. Running kmscube (Make sure weston is not running)

    kmscube
  5. Weston

    1. Update weston.service with username to root from weston

      sed -i 's/User=weston/User=root/g' /usr/lib/systemd/system/weston.service
    2. Start weston service

      systemctl daemon-reload systemctl start weston

GPU Unified SDK Application Development

SDK repo: GitHub - Xilinx/gpu-unified-sdk

  1. Source SDK

    unset LD_LIBRARY_PATH source /yocto/build/tmp/deploy/sdk/environment-setup-cortexa72-cortexa53-amd-linux
  2. Configure and build

    export AMD_SDK=<SDK_INSTALL_PATH> cmake -G Ninja \ -D CMAKE_BUILD_TYPE=Release \ -D CMAKE_TOOLCHAIN_FILE=sdk.cmake \ -D SDK_Platform=<wayland/fbdev> \ -D SDK_PLATFORM_TARGET=versal-2ve-2vm \ -D CMAKE_MAKE_PROGRAM=ninja \ -D GLES_WINDOW_W=3840 \ -D GLES_WINDOW_H=2160 \ -B build_dir ninja -C build_dir

Running applications

  1. Wayland backend

    1. Weston will be launched based on above steps

    2. Running glmark2

      export XDG_RUNTIME_DIR=/run/ glmark2-es2-wayland
  2. QT application

    export DISPLAY=:0.0 export XDG_RUNTIME_DIR=/run/ export QT_QPA_PLATFORM=wayland export QT_WAYLAND_SHELL_INTEGRATION=xdg-shell cd /usr/share/examples/widgets/animation/animatedtiles/ ./animatedtiles cd /usr/share/examples/widgets/animation/stickman/ ./stickman cd /usr/share/examples/widgets/widgets/calculator/ ./calculator cd /usr/share/examples/widgets/widgets/analogclock ./analogclock
  3. Fbdev backend (Need to run with VKMS or HDMI dual display design)

    1. QT application

      1. eglfs plugin

        export DISPLAY=:0.0 export QT_QPA_EGLFS_INTEGRATION=eglfs_kms export QT_QPA_EGLFS_FB=/dev/fb0 export QT_QPA_PLATFORM=eglfs::fb=/dev/fb0 export QT_QPA_GENERIC_PLUGINS=evdevkeyboard,evdevmouse
      2. linuxfb plugin

        export DISPLAY=:0.0 export QT_QPA_EGLFS_INTEGRATION=linuxfb export QT_QPA_PLATFORM=linuxfb::fb=/dev/fb0 export QT_QPA_EGLFS_FB=/dev/fb0 export QT_QPA_EGLFS_WIDTH=1920 export QT_QPA_EGLFS_HEIGHT=1080 export QT_QPA_GENERIC_PLUGINS=evdevmouse,evdevkeyboard export QT_QPA_ENABLE_TERMINAL_KEYBOARD=1 export QT_QPA_FONTDIR=/usr/share/fonts/ export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/plugins export QML2_IMPORT_PATH=/usr/lib/qml
      3. Running application

        cd /usr/share/examples/widgets/animation/animatedtiles/ ./animatedtiles cd /usr/share/examples/widgets/animation/stickman/ ./stickman cd /usr/share/examples/widgets/widgets/calculator/ ./calculator cd /usr/share/examples/widgets/widgets/analogclock ./analogclock
    2. eglfbdev

      export DISPLAY=:0.0 ./eglfbdev -p -f 100000
    3. eglfbdev_gears

      export DISPLAY=:0.0 ./eglfbdev_gears -p -f 100000
  4. Headless

    1. glmark2 application

      glmark2-es2-gbm --winsys-options drm-device=/dev/dri/card0 --off-screen

Troubleshooting

  1. If GPU kernel modules have not loaded properly.

    1. Make sure kernel modules are loaded properly and /dev/mali0 node is populated before executing GPU applications; if not then try removing all GPU kernel modules and reloading again using the below commands:

      rmmod /lib/modules/{kernel_version}/*.ko /usr/bin/load-mali-modules.sh
  2. Make sure that the MMI-DC display is up before running GPU apps. You can run the modetest pattern to confirm display sanity, for example:

    modetest -M mmi-dc -s 45:1920x1080-60@XR24

CTS Test results

Mali-G78AE CTS Test results

Release Notes

2026.1

  • Features:

    • Upgrade to r54p1-12eac0

    • System shutdown handler support

  • Fixes:

    • Fixing EAM error observed on loading G78AE kernel modules

    • Launch weston by default on kmscon login.

    • Fix translation faults by using dma_alloc_pages for 40-bit GPU addressing

2025.2

  • Features:

    • Add support for selecting a specific /dev/dma_heap region.

    • Add support for updating max GPU clock without DVFS

    • VK_KHR_wayland_surface extension support for Vulkan applications

  • Fixes:

    • Fixing GPU modules autoload issue

    • Fixing GPU translation fault issues

    • Switch to OpenCL ICD Loader

    • Filter libs now referencing libmail with version suffix ".0" in FILTER dynamic section.

2025.1

  • Supports ARM Mali Linux DDK r51p0-00eac0

  • Supports OpenGLES 3.2, Vulkan 1.2 and OpenCL 3.0 APIs

  • Supports Wayland (Default), FBDev and Headless backends

  • GPU Multi-Partition support (2 partitions)