summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2023-09-07 12:50:33 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-09 12:04:55 +0100
commit560a70a198c9a2a4efcbf077305af51ea259682c (patch)
tree9834aef8d648d0b5246dc873b37c7f1bf89c659a
parentdd7fdb4dee079e7b3d8f1567c5d6576dc2170ab1 (diff)
downloadpoky-560a70a198c9a2a4efcbf077305af51ea259682c.tar.gz
runqemu: check permissions of available render nodes as well as their presence
qemu itself is not helpful when render nodes exist, but can't be opened: qemu-system-x86_64: egl: render node init failed To fix this, users likely need to * modprobe vgem (presence when physical graphic card is absent or has a driver without support for render nodes, such as many older cards found in server machines) * add their user to "render" group to write to /dev/dri/renderD* (permissions) With this change runqemu should print hints for the above as appropriate from probing the nodes. (From OE-Core rev: acd85925cb197b7a31a25b60e8de762e2c3697ef) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/runqemu14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 0e105a918b..3a17033268 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1383,8 +1383,18 @@ to your build configuration.
1383 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.""" 1383 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."""
1384 try: 1384 try:
1385 content = os.listdir("/dev/dri") 1385 content = os.listdir("/dev/dri")
1386 if len([i for i in content if i.startswith('render')]) == 0: 1386 nodes = [i for i in content if i.startswith('renderD')]
1387 raise RunQemuError("No render nodes found in /dev/dri: %s. %s" %(content, render_hint)) 1387 if len(nodes) == 0:
1388 raise RunQemuError("No render nodes found in /dev/dri/: %s. %s" %(content, render_hint))
1389 for n in nodes:
1390 try:
1391 with open(os.path.join("/dev/dri", n), "w") as f:
1392 f.close()
1393 break
1394 except IOError:
1395 pass
1396 else:
1397 raise RunQemuError("None of the render nodes in /dev/dri/ are accessible: %s; you may need to add yourself to 'render' group or otherwise ensure you have read-write permissions on one of them." %(nodes))
1388 except FileNotFoundError: 1398 except FileNotFoundError:
1389 raise RunQemuError("/dev/dri directory does not exist; no render nodes available on this machine. %s" %(render_hint)) 1399 raise RunQemuError("/dev/dri directory does not exist; no render nodes available on this machine. %s" %(render_hint))
1390 1400