All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v7 0/8] Add virglrenderer support
@ 2026-05-16  2:03 Joseph Kogut
  2026-05-16  2:03 ` [Buildroot] [PATCH v7 1/8] package/weston: add EGL dependency for XWayland Joseph Kogut
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Joseph Kogut @ 2026-05-16  2:03 UTC (permalink / raw)
  To: buildroot
  Cc: Adrian Perez de Castro, Eric Le Bihan, Romain Naour, Joseph Kogut,
	Raphael Pavlidis, Thomas Petazzoni

Hello,

This patch series adds support for building the virglrenderer library in
buildroot.

Virglrenderer is a userspace library used to support rendering and
compute in virtual machines over virtio-gpu. Virglrenderer supports
serialized API level access to OpenGL and Vulkan through virgl and venus
respectively, as well as mediated DRM level access using host native
context [0]. Notably libkrun [1] and rutabaga_gfx [2] are also capable of
utilizing virglrenderer.

The first two patches prepare for removing libepoxy's dependency on
GL/EGL, and the third patch removes it. This allows virglrenderer to
build with its libepoxy dependency, without actually depending on
EGL/GLX.

This enables, for example, headless compute through Vulkan using Venus
or host native context inside virtual machines.

The fourth patch adds the new virglrenderer package. Optional configs
enable VirGL (API-level OpenGL passthrough), Venus (API-level Vulkan
passthrough), hardware accelerated video encode/decode through VA-API,
and DRM driver specific backends for host native context support.

The fifth patch adds a patch from upstream virglrenderer that fixes a
build issue with glibc 2.43.

The sixth patch adds an OpenGL config for qemu.

The seventh patch adds a qemu virglrenderer config that selects OpenGL
support, as virgl/venus support in qemu currently requires a GL
accelerated display frontend (a patch series on the mailing list [3] is
proposing decoupling display GL support from Venus). Other VMMs
such as libkrun don't suffer from the same coupling currently.

The eighth and last patch adds a new runtime test for virglrenderer with
qemu using a software GL driver and a nested guest.

For v4 of the series, I realized enabling DRM backends with the optional
dependency on specific Mesa drivers didn't make sense. Host native
context depends on specific *host kernel* interfaces, and the host may
or may not have Mesa at all.

If the host does have Mesa, and a specific DRM consumer (i.e. a vendor's
gallium/vulkan driver) is enabled, it's reasonable to assume that the
host supports that DRM interface, and we should enable the corresponding
DRM backend. For cases where the guest alone runs mesa (headless
compute), I introduced explicit configs to enable DRM backends.

Tested with llama-bench running with the vulkan backend in a nested VM. 
As seen below, the nested guest is sending commands to the host through
virtio-gpu twice.

        # llama-bench -m llama-2-7b.Q4_0.gguf -ngl 100 
        ggml_vulkan: Found 1 Vulkan devices:
        ggml_vulkan: 0 = Virtio-GPU Venus (Virtio-GPU Venus (AMD Radeon RX 6900 XT (RADV NAVI21))) (venus) | uma: 0 | fp16: 1 | warp size: 64 | shared memory: 65536 | int dot: 1 | matrix cores: none
        | model                          |       size |     params | backend    | ngl |            test |                  t/s |
        | ------------------------------ | ---------: | ---------: | ---------- | --: | --------------: | -------------------: |
        | llama 7B Q4_0                  |   3.56 GiB |     6.74 B | Vulkan     | 100 |           pp512 |      1220.99 ± 10.12 |
        | llama 7B Q4_0                  |   3.56 GiB |     6.74 B | Vulkan     | 100 |           tg128 |         82.24 ± 1.00 |

        build: unknown (0)

More information about the benchmark and results from other hardware on
the llama.cpp GitHub discussion here [4].

Build tested with several configs, to ensure correct dependencies and
configuration. Not all toolchains build every configuration
successfully, but every configuration has multiple passing builds.
Failures generally are from warnings treated as errors by default. 

-- qemu-virgl-egl --
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_QEMU=y
BR2_PACKAGE_QEMU_SYSTEM=y
BR2_PACKAGE_QEMU_SYSTEM_TCG=y
BR2_PACKAGE_QEMU_VIRGLRENDERER=y

-- qemu-virgl-glx --
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_QEMU=y
BR2_PACKAGE_QEMU_SYSTEM=y
BR2_PACKAGE_QEMU_SYSTEM_TCG=y
BR2_PACKAGE_QEMU_VIRGLRENDERER=y
BR2_PACKAGE_XORG7=y

-- virglrenderer-venus --
BR2_PACKAGE_VIRGLRENDERER=y
BR2_PACKAGE_VIRGLRENDERER_VENUS=y

-- virglrenderer-drm-amdgpu --
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_VULKAN_DRIVER_AMD=y
BR2_PACKAGE_VIRGLRENDERER=y

Feedback welcome.

[0] https://www.collabora.com/news-and-blog/blog/2025/01/15/the-state-of-gfx-virtualization-using-virglrenderer/
[1] https://github.com/containers/libkrun
[2] https://github.com/magma-gpu/rutabaga_gfx
[3] https://lore.kernel.org/qemu-devel/20260317182049.33848-1-lucaaamaral@gmail.com/
[4] https://github.com/ggml-org/llama.cpp/discussions/10879

Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
---
Changes in v7:
- History cleanup
- Link to v6: https://patch.msgid.link/20260515-virglrenderer-v6-0-d9081c13baf9@gmail.com

Changes in v6:
- Add explicit EGL dependency for weston XWayland support, and only
  enable XWayland glamor when libepoxy has EGL support
- Fix stale libepoxy dependency comments in wpewebkit
- Document why libepoxy can be built without GLX or EGL support
- Improve qemu OpenGL dependency comment
- Add qemu and virglrenderer comments warning when no virglrenderer
  backend is enabled
- Add a runtime test for virglrenderer using nested qemu and virgl
- Link to v5: https://lore.kernel.org/r/20260318-virglrenderer-v5-0-09a3274852d6@gmail.com

Changes in v5:
- Fixed authorship, Signed-off-by, and sent from address
- Link to v4: https://lore.kernel.org/r/20260317-virglrenderer-v4-0-ed223e222bb6@gmail.com

Changes in v4:
- Removed libepoxy dependency on GL/EGL
- Introduce explicit configs for virglrenderer DRM backends, virgl
  (see above note)
- Moved virglrenderer Kconfig from Libraries -> Graphics to 'Graphics
  libraries and applications' (next to mesa3d && X.org)
- Add a patch from upstream virglrenderer to fix glibc 2.43 builds
- select libdrm in virglrenderer only when required (drm backends,
  video)
- BR2_PACKAGE_VIRGLRENDERER_DRM_BACKEND_MSM depends on !BR2_arm
- Explicitly configure GLX and/or EGL when
  BR2_PACKAGE_VIRGLRENDERER_VIRGL=y
- Separate comments for qemu GL/virglrenderer [Romain]
- Split up qemu feature configs into separate commits [Romain]
- Link to v3: https://lore.kernel.org/buildroot/20260219-virglrenderer-v3-0-e2ff1a23be3f@gmail.com/

Changes in v3:
- Bump version to v1.3.0
- Add optional deps for panfrost and i915 native context (new)
- Add config for vaapi support
- Remove GLX in favor of EGL
- Update qemu docs links, as previous ones 404 [Romain]
- Fix invalid config reference in BR2_PACKAGE_QEMU_VIRGLRENDERER
  [Romain]
- Select libepoxy when enabling OpenGL support in qemu [Romain]
- Add depends on gcc >= 4.1 to virglrenderer (from meson.build)
- Add depends on libgbm to virglrenderer [Romain]
- Add comments for missing dependencies to virglrenderer Kconfig
- Select vulkan-headers when venus is enabled [Romain]
- Disable venus explicitly when the symbol isn't selected
- Link to v2: https://lore.kernel.org/buildroot/20251203-virglrenderer-v2-v2-0-2846fc1a579a@gmail.com

Changes in v2:
- Rebase onto next (python-glslang patch merged)
- Bump version to v1.2.0
- Remove hidden configs for virglrenderer vDRM backends [Romain]
- Fixed typo in qemu/Config.in [Romain]
- Split up configs for qemu OpenGL and virglrenderer support [Romain]
- More detailed qemu config help messages
- Link to v1: https://lore.kernel.org/r/20250618-virglrenderer-upstream-v1-0-57525ac8406e@gmail.com

To: buildroot@buildroot.org
Cc: Raphael Pavlidis <raphael.pavlidis@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Adrian Perez de Castro <aperez@igalia.com>
Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Cc: Joseph Kogut <joseph.kogut@gmail.com>
Cc: Romain Naour <romain.naour@gmail.com>

---
Joseph Kogut (8):
      package/weston: add EGL dependency for XWayland
      package/wpewebkit: fix stale libepoxy dependency comments
      package/libepoxy: remove gl/egl dependency
      package/virglrenderer: new package
      package/virglrenderer: Fix build with glibc 2.43
      package/qemu: add OpenGL config
      package/qemu: add virglrenderer integration
      support/testing: add virglrenderer test

 DEVELOPERS                                         |   2 +
 package/Config.in                                  |   1 +
 package/libepoxy/Config.in                         |   8 +-
 package/qemu/Config.in                             |  35 ++++++
 package/qemu/qemu.mk                               |  15 ++-
 .../0001-fix-build-with-glibc-2.43.patch           |  39 +++++++
 package/virglrenderer/Config.in                    | 117 +++++++++++++++++++++
 package/virglrenderer/virglrenderer.hash           |   5 +
 package/virglrenderer/virglrenderer.mk             |  60 +++++++++++
 package/weston/Config.in                           |   6 +-
 package/wpewebkit/Config.in                        |   4 +-
 package/x11r7/xwayland/xwayland.mk                 |   2 +-
 .../testing/tests/package/test_virglrenderer.py    | 117 +++++++++++++++++++++
 .../test_virglrenderer/linux-virgl.fragment        |   6 ++
 .../test_virglrenderer/remove-qemu-blobs.sh        |  12 +++
 .../rootfs-overlay/etc/profile.d/stty-raw.sh       |   3 +
 16 files changed, 422 insertions(+), 10 deletions(-)
---
base-commit: 4ed01e7ed30379b0c1167a2173361269184a3c5d
change-id: 20260219-virglrenderer-c4dad969ad89

Best regards,
--  
Joseph Kogut <joseph.kogut@gmail.com>

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-05-16  2:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-16  2:03 [Buildroot] [PATCH v7 0/8] Add virglrenderer support Joseph Kogut
2026-05-16  2:03 ` [Buildroot] [PATCH v7 1/8] package/weston: add EGL dependency for XWayland Joseph Kogut
2026-05-16  2:03 ` [Buildroot] [PATCH v7 2/8] package/wpewebkit: fix stale libepoxy dependency comments Joseph Kogut
2026-05-16  2:03 ` [Buildroot] [PATCH v7 3/8] package/libepoxy: remove gl/egl dependency Joseph Kogut
2026-05-16  2:03 ` [Buildroot] [PATCH v7 4/8] package/virglrenderer: new package Joseph Kogut
2026-05-16  2:03 ` [Buildroot] [PATCH v7 5/8] package/virglrenderer: Fix build with glibc 2.43 Joseph Kogut
2026-05-16  2:03 ` [Buildroot] [PATCH v7 6/8] package/qemu: add OpenGL config Joseph Kogut
2026-05-16  2:03 ` [Buildroot] [PATCH v7 7/8] package/qemu: add virglrenderer integration Joseph Kogut
2026-05-16  2:03 ` [Buildroot] [PATCH v7 8/8] support/testing: add virglrenderer test Joseph Kogut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.