Enable opensource GPU stack(Etnaviv)

Hello folks,

I am using verdin I.MX8M plus SOM for yocto(dunfell).
I came to know that by default in this BSP for GPU , it uses

MXC_GPU_VIV

For propritory GPU driver , I want to enable open source (etnaviv) GPU driver
For that I modified,

DRM_ETNAVIV

And I have modified local.conf as below.

MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT = "0"
MACHINEOVERRIDES .= ":use-mainline-bsp"
DISTRO_FEATURES_append = " opengl wayland"
#MACHINE_USES_VIVANTE_KERNEL_DRIVER_MODULE = "0"

Due to this changes i am getting build error as below.

ERROR: linux-toradex-5.4.161+gitAUTOINC+0f00118249-r0 do_kernel_metadata: Could not locate BSP definition for verdin-imx8mp/standard and no defconfig was provided
+ [ -p /data/verdin-imx8mm/build/tmp/work/verdin_imx8mp-tdx-linux/linux-toradex/5.4.161+gitAUTOINC+0f00118249-r0/temp/fifo.2431783 ]
+ printf %b\0 bbfatal_log Could not locate BSP definition for verdin-imx8mp/standard and no defconfig was provided
+ exit 1
+ bb_exit_handler
+ ret=1
+ echo WARNING: exit code 1 from a shell command.
WARNING: exit code 1 from a shell command.
+ exit 1



ERROR: linux-toradex-5.4.161+gitAUTOINC+0f00118249-r0 do_kernel_metadata: Execution of '/data/verdin-imx8mm/build/tmp/work/verdin_imx8mp-tdx-linux/linux-toradex/5.4.161+gitAUTOINC+0f00118249-r0/temp/run.do_kernel_metadata.2431783' failed with exit code 1
ERROR: Logfile of failure stored in: /data/verdin-imx8mm/build/tmp/work/verdin_imx8mp-tdx-linux/linux-toradex/5.4.161+gitAUTOINC+0f00118249-r0/temp/log.do_kernel_metadata.2431783
ERROR: Task (/data/verdin-imx8mm/build/../layers/meta-toradex-nxp/recipes-kernel/linux/linux-toradex_5.4-2.3.x.bb:do_kernel_metadata) failed with exit code '1'
NOTE: cairo-1.16.0-r0 do_patch: Applying patch 'CVE-2018-19876.patch' (../layers/openembedded-core/meta/recipes-graphics/cairo/cairo/CVE-2018-19876.patch)
NOTE: mesa-2_20.0.2-r0 do_patch: Applying patch '0004-Revert-mesa-Enable-asm-unconditionally-now-that-gen_.patch' (../layers/openembedded-core/meta/recipes-graphics/mesa/files/0004-Revert-mesa-Enable-asm-unconditionally-now-that-gen_.patch)
NOTE: systemd-1_244.5-r0 do_patch: Applying patch 'introduce-ordered_set_clear-free-with-destructor.patch' (../layers/openembedded-core/meta/recipes-core/systemd/systemd/introduce-ordered_set_clear-free-with-destructor.patch)
NOTE: alsa-lib-1.2.1.2-r0 do_patch: Applying patch '0002-ucm-return-always-at-least-NULL-if-no-list-is-availa.patch' (../layers/openembedded-core/meta/recipes-multimedia/alsa/alsa-lib/0002-ucm-return-always-at-least-NULL-if-no-list-is-availa.patch)
NOTE: cairo-1.16.0-r0 do_patch: Applying patch 'CVE-2019-6461.patch' (../layers/openembedded-core/meta/recipes-graphics/cairo/cairo/CVE-2019-6461.patch)
NOTE: mesa-2_20.0.2-r0 do_patch: Applying patch '0005-vc4-use-intmax_t-for-formatted-output-of-timespec-me.patch' (../layers/openembedded-core/meta/recipes-graphics/mesa/files/0005-vc4-use-intmax_t-for-formatted-output-of-timespec-me.patch)
NOTE: systemd-1_244.5-r0 do_patch: Applying patch 'network-add-skeleton-of-request-queue.patch' (../layers/openembedded-core/meta/recipes-core/systemd/systemd/network-add-skeleton-of-request-queue.patch)
NOTE: alsa-lib-1.2.1.2-r0 do_patch: Applying patch '0003-namehint-correct-the-args-check.patch' (../layers/openembedded-core/meta/recipes-multimedia/alsa/alsa-lib/0003-namehint-correct-the-args-check.patch)
NOTE: cairo-1.16.0-r0 do_patch: Applying patch 'CVE-2019-6462.patch' (../layers/openembedded-core/meta/recipes-graphics/cairo/cairo/CVE-2019-6462.patch)
NOTE: mesa-2_20.0.2-r0 do_patch: Applying patch '0001-meson-misdetects-64bit-atomics-on-mips-clang.patch' (../layers/openembedded-core/meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch)
NOTE: systemd-1_244.5-r0 do_patch: Applying patch 'network-merge-link_drop-and-link_detach_from_manager.patch' (../layers/openembedded-core/meta/recipes-core/systemd/systemd/network-merge-link_drop-and-link_detach_from_manager.patch)
NOTE: alsa-lib-1.2.1.2-r0 do_patch: Applying patch '0004-namehint-improve-the-previous-patch-check-the-return.patch' (../layers/openembedded-core/meta/recipes-multimedia/alsa/alsa-lib/0004-namehint-improve-the-previous-patch-check-the-return.patch)
NOTE: cairo-1.16.0-r0 do_patch: Applying patch 'CVE-2020-35492.patch' (../layers/openembedded-core/meta/recipes-graphics/cairo/cairo/CVE-2020-35492.patch)
NOTE: systemd-1_244.5-r0 do_patch: Applying patch 'network-also-drop-requests-when-link-enters-linger-state.patch' (../layers/openembedded-core/meta/recipes-core/systemd/systemd/network-also-drop-requests-when-link-enters-linger-state.patch)
NOTE: alsa-lib-1.2.1.2-r0 do_patch: Applying patch '0005-ucm-Do-not-fail-to-parse-configs-on-cards-with-an-em.patch' (../layers/openembedded-core/meta/recipes-multimedia/alsa/alsa-lib/0005-ucm-Do-not-fail-to-parse-configs-on-cards-with-an-em.patch)
NOTE: systemd-1_244.5-r0 do_patch: Applying patch 'network-fix-Link-reference-counter-issue.patch' (../layers/openembedded-core/meta/recipes-core/systemd/systemd/network-fix-Link-reference-counter-issue.patch)
NOTE: alsa-lib-1.2.1.2-r0 do_patch: Applying patch '0001-Fix-alsa-sound-.h-for-external-programs.patch' (../layers/openembedded-core/meta/recipes-multimedia/alsa/alsa-lib/0001-Fix-alsa-sound-.h-for-external-programs.patch)
NOTE: systemd-1_244.5-r0 do_patch: Applying patch 'rm-rf-refactor-rm-rf-children-split-out-body-of-directory.patch' (../layers/openembedded-core/meta/recipes-core/systemd/systemd/rm-rf-refactor-rm-rf-children-split-out-body-of-directory.patch)
NOTE: alsa-lib-1.2.1.2-r0 do_patch: Applying patch '0001-uapi-Move-typedefs-from-uapi-to-sound.patch' (../layers/openembedded-core/meta/recipes-multimedia/alsa/alsa-lib/0001-uapi-Move-typedefs-from-uapi-to-sound.patch)
NOTE: systemd-1_244.5-r0 do_patch: Applying patch 'rm-rf-optionally-fsync-after-removing-directory-tree.patch' (../layers/openembedded-core/meta/recipes-core/systemd/systemd/rm-rf-optionally-fsync-after-removing-directory-tree.patch)
NOTE: systemd-1_244.5-r0 do_patch: Applying patch 'CVE-2021-3997-1.patch' (../layers/openembedded-core/meta/recipes-core/systemd/systemd/CVE-2021-3997-1.patch)
NOTE: systemd-1_244.5-r0 do_patch: Applying patch 'CVE-2021-3997-2.patch' (../layers/openembedded-core/meta/recipes-core/systemd/systemd/CVE-2021-3997-2.patch)
NOTE: systemd-1_244.5-r0 do_patch: Applying patch 'CVE-2021-3997-3.patch' (../layers/openembedded-core/meta/recipes-core/systemd/systemd/CVE-2021-3997-3.patch)
NOTE: Tasks Summary: Attempted 2252 tasks of which 2237 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 3 seconds



Summary: 1 task failed:
/data/verdin-imx8mm/build/../layers/meta-toradex-nxp/recipes-kernel/linux/linux-toradex_5.4-2.3.x.bb:do_kernel_metadata
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

My motive is to try open source and close source GPU drivers for wpewebkit performance analysis.

Can anyone guide me here ?

Thanks.

Hi @kishan,

Please check below link and modify distro if not already done. Let us know if this solves your build issue.

Best Regards
Ritesh Kumar

Hi @ritesh.tx

As per your guide i have modified DISTRO variable in buildconf/local.conf

# Use this distro by default
#DISTRO ?= "tdx-xwayland"
DISTRO ?= "tdx-xwayland-upstream-rt"

Still getting below error.

+ bsp_definition=
+ [ -z  ]
+ [ -z  ]
+ bbfatal_log Could not locate BSP definition for verdin-imx8mp/standard and no defconfig was provided
+ [ -p
ERROR: linux-toradex-5.4.161+gitAUTOINC+0f00118249-r0 do_kernel_metadata: Could not locate BSP definition for verdin-imx8mp/standard and no defconfig was provided
 /data/verdin-imx8mm/build/tmp/work/verdin_imx8mp-tdx-linux/linux-toradex/5.4.161+gitAUTOINC+0f00118249-r0/temp/fifo.1555578 ]
+ printf %b\0 bbfatal_log Could not locate BSP definition for verdin-imx8mp/standard and no defconfig was provided
+ exit 1
+ bb_exit_handler
+ ret=1
+ echo WARNING: exit code 1 from a shell command.
WARNING: exit code 1 from a shell command.
+ exit 1

ERROR: linux-toradex-5.4.161+gitAUTOINC+0f00118249-r0 do_kernel_metadata: Execution of '/data/verdin-imx8mm/build/tmp/work/verdin_imx8mp-tdx-linux/linux-toradex/5.4.161+gitAUTOINC+0f00118249-r0/temp/run.do_kernel_metadata.1555578' failed with exit code 1
ERROR: Logfile of failure stored in: /data/verdin-imx8mm/build/tmp/work/verdin_imx8mp-tdx-linux/linux-toradex/5.4.161+gitAUTOINC+0f00118249-r0/temp/log.do_kernel_metadata.1555578
ERROR: Task (/data/verdin-imx8mm/build/../layers/meta-toradex-nxp/recipes-kernel/linux/linux-toradex_5.4-2.3.x.bb:do_kernel_metadata) failed with exit code '1'
NOTE: Tasks Summary: Attempted 651 tasks of which 642 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 2 seconds

Summary: 1 task failed:
  /data/verdin-imx8mm/build/../layers/meta-toradex-nxp/recipes-kernel/linux/linux-toradex_5.4-2.3.x.bb:do_kernel_metadata
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

Can you please guide.

Hi @kishan,

As per your change, following supposed to build upstream Linux kernel with RT patches:

#DISTRO ?= "tdx-xwayland"
DISTRO ?= "tdx-xwayland-upstream-rt"

However, building tdx-xwayland-upstream* images on iMX8 based platforms is not yet supported due to lack of iMX8 support (including graphics) in the mainline kernel. I’d suggest you to adapt your changes to tdx-xwayland variant.

Best regards,
Andrejs Cainikovs.

Hi @andrejs.tx

Noted, building tdx-xwayland-upstream* images on iMX8 based platforms is not supported.

Than how to enable Etnaviv open source GPU stack in tdx-xwayland?

Thanks for reply.

Hi,

Any updates on this ?

Hi @kishan ,

As mentioned by andrejs at the moment this is not supported.

You can try porting/implementing driver. You can find kernel below link

Best Regards
Ritesh Kumar

Than how to enable Etnaviv open source GPU stack in tdx-xwayland ?

We do not support this, but it’s up to you to play around and try to get it up and running. Please note, etnaviv is already present in the multimedia image.

Update: We are able to replace the etnaviv driver, on top of it we are able to replace the compositor to sway, which is now running smoothly.

As we have done this for a customer, we cannot share more details. However, in case of support we will be happy to do that on kishan.dudhatra@siliconsignals.io or at www.siliconsignals.io