diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2023-02-27 12:40:08 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-02-27 13:27:37 +0000 |
commit | 5a5ab7cdec7b3e01ddf95f73453e9fcfdd6b986e (patch) | |
tree | 6d292c2ab62d4ea8800190eafb0737e8654e23c1 | |
parent | a87811f255c2154285dc835817608c5f0fb50bbc (diff) | |
download | poky-5a5ab7cdec7b3e01ddf95f73453e9fcfdd6b986e.tar.gz |
scripts/runqemu: move render nodes check to runqemu from selftest
This will produce a more useful hint for those setting
up or testing virgl headless:
runqemu - ERROR - No render nodes found in /dev/dri: ['by-path', 'card0']. If /dev/dri/renderD* is absent due to lack of suitable GPU, 'modprobe vgem' will create one suitable for mesa llvmpipe software renderer.
as qemu itself isn't helpful:
alex@Zen2:/srv/storage/alex/yocto/build-64-alt$ qemu-system-x86_64 -display egl-headless
qemu-system-x86_64: egl: no drm render node available
qemu-system-x86_64: egl: render node init failed
(From OE-Core rev: cbbada6a6c9b0a2e97f7395117dad986555f2db9)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/runtime_test.py | 7 | ||||
-rwxr-xr-x | scripts/runqemu | 10 |
2 files changed, 10 insertions, 7 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py index 13e8760a16..e32c4aff85 100644 --- a/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py | |||
@@ -260,13 +260,6 @@ class TestImage(OESelftestTestCase): | |||
260 | if distro and (distro in ['debian-9', 'debian-10', 'centos-7', 'centos-8', 'ubuntu-16.04', 'ubuntu-18.04'] or distro.startswith('almalinux')): | 260 | if distro and (distro in ['debian-9', 'debian-10', 'centos-7', 'centos-8', 'ubuntu-16.04', 'ubuntu-18.04'] or distro.startswith('almalinux')): |
261 | self.skipTest('virgl headless cannot be tested with %s' %(distro)) | 261 | self.skipTest('virgl headless cannot be tested with %s' %(distro)) |
262 | 262 | ||
263 | render_hint = """If /dev/dri/renderD* is absent due to lack of suitable GPU, 'modprobe vgem' will create one suitable for mesa llvmpipe software renderer.""" | ||
264 | try: | ||
265 | content = os.listdir("/dev/dri") | ||
266 | if len([i for i in content if i.startswith('render')]) == 0: | ||
267 | self.fail("No render nodes found in /dev/dri: %s. %s" %(content, render_hint)) | ||
268 | except FileNotFoundError: | ||
269 | self.fail("/dev/dri directory does not exist; no render nodes available on this machine. %s" %(render_hint)) | ||
270 | qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native') | 263 | qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native') |
271 | features = 'IMAGE_CLASSES += "testimage"\n' | 264 | features = 'IMAGE_CLASSES += "testimage"\n' |
272 | if 'opengl' not in qemu_distrofeatures: | 265 | if 'opengl' not in qemu_distrofeatures: |
diff --git a/scripts/runqemu b/scripts/runqemu index cedf4f62ad..58b0c191e1 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -1366,6 +1366,15 @@ class BaseConfig(object): | |||
1366 | raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!") | 1366 | raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!") |
1367 | self.qemu_system = qemu_system | 1367 | self.qemu_system = qemu_system |
1368 | 1368 | ||
1369 | def check_render_nodes(self): | ||
1370 | render_hint = """If /dev/dri/renderD* is absent due to lack of suitable GPU, 'modprobe vgem' will create one suitable for mesa llvmpipe software renderer.""" | ||
1371 | try: | ||
1372 | content = os.listdir("/dev/dri") | ||
1373 | if len([i for i in content if i.startswith('render')]) == 0: | ||
1374 | raise RunQemuError("No render nodes found in /dev/dri: %s. %s" %(content, render_hint)) | ||
1375 | except FileNotFoundError: | ||
1376 | raise RunQemuError("/dev/dri directory does not exist; no render nodes available on this machine. %s" %(render_hint)) | ||
1377 | |||
1369 | def setup_vga(self): | 1378 | def setup_vga(self): |
1370 | if self.nographic == True: | 1379 | if self.nographic == True: |
1371 | if self.sdl == True: | 1380 | if self.sdl == True: |
@@ -1403,6 +1412,7 @@ class BaseConfig(object): | |||
1403 | 1412 | ||
1404 | self.qemu_opt += ' -display ' | 1413 | self.qemu_opt += ' -display ' |
1405 | if self.egl_headless == True: | 1414 | if self.egl_headless == True: |
1415 | self.check_render_nodes() | ||
1406 | self.set_dri_path() | 1416 | self.set_dri_path() |
1407 | self.qemu_opt += 'egl-headless,' | 1417 | self.qemu_opt += 'egl-headless,' |
1408 | else: | 1418 | else: |