public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] qemu: add a hint on how to enable CPU render nodes when a suitable GPU is absent
@ 2021-08-22 20:22 Alexander Kanavin
  0 siblings, 0 replies; only message in thread
From: Alexander Kanavin @ 2021-08-22 20:22 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

This is particularly useful for llvm-accelerated GL rendering from qemu guest to
an offscreen buffer (accessible over vnc or spice) using llvmpipe on the
host, rather than using unaccelerated swrast renderer in the guest.

This is the best that can be done in the absence of a host GPU with render node
support (such as old Matrox cards common in servers, or fully virtualized cloud
environments with no GPU at all).

Note: even though NVidia blob drivers do support render nodes, they do not
support gbm (yet?), and so rendering will fall back to llvmpipe as well even when
the system has a 3000 euro NVidia GPU. Cue Linus picture.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 meta/lib/oeqa/selftest/cases/runtime_test.py | 6 ++++--
 scripts/runqemu                              | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 4cfec94d85..129503de63 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -212,12 +212,14 @@ class TestImage(OESelftestTestCase):
         Author: Alexander Kanavin <alex.kanavin@gmail.com>
         """
         import subprocess, os
+
+        render_hint = """If /dev/dri/renderD* is absent due to lack of suitable GPU, 'modprobe vgem' will create one sutable for mesa llvmpipe sofware renderer."""
         try:
             content = os.listdir("/dev/dri")
             if len([i for i in content if i.startswith('render')]) == 0:
-                self.skipTest("No render nodes found in /dev/dri: %s" %(content))
+                self.skipTest("No render nodes found in /dev/dri: %s. %s" %(content, render_hint))
         except FileNotFoundError:
-            self.skipTest("/dev/dri directory does not exist; no render nodes available on this machine.")
+            self.skipTest("/dev/dri directory does not exist; no render nodes available on this machine. %s" %(render_hint))
         try:
             dripath = subprocess.check_output("pkg-config --variable=dridriverdir dri", shell=True)
         except subprocess.CalledProcessError as e:
diff --git a/scripts/runqemu b/scripts/runqemu
index 0976273eb0..c467b0eb19 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -72,6 +72,8 @@ of the following environment variables (in any order):
     gl - enable virgl-based GL acceleration (also needs gtk or sdl options)
     gl-es - enable virgl-based GL acceleration, using OpenGL ES (also needs gtk or sdl options)
     egl-headless - enable headless EGL output; use vnc (via publicvnc option) or spice to see it
+    (hint: if /dev/dri/renderD* is absent due to lack of suitable GPU, 'modprobe vgem' will create
+    one sutable for mesa llvmpipe sofware renderer)
     serial - enable a serial console on /dev/ttyS0
     serialstdio - enable a serial console on the console (regardless of graphics mode)
     slirp - enable user networking, no root privileges is required
-- 
2.31.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-22 20:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-22 20:22 [PATCH] qemu: add a hint on how to enable CPU render nodes when a suitable GPU is absent Alexander Kanavin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox