diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2023-09-07 12:50:33 +0200 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-10-18 05:25:19 -1000 |
commit | 099fdd3441e8569c969c19e964575e1a83ff19c3 (patch) | |
tree | c2f4bcc0cd0e3924fae7bc0c6b6744db2f7db0de /scripts | |
parent | 559ed4ecd57e490cd234cc657e21f10a7cc75c91 (diff) | |
download | poky-099fdd3441e8569c969c19e964575e1a83ff19c3.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: 12ae43abbc4e7d6184198a912487ace3a4e66e50)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit acd85925cb197b7a31a25b60e8de762e2c3697ef)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index ef24ddc6b2..ea44600e64 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -1374,8 +1374,18 @@ to your build configuration. | |||
1374 | 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.""" | 1374 | 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.""" |
1375 | try: | 1375 | try: |
1376 | content = os.listdir("/dev/dri") | 1376 | content = os.listdir("/dev/dri") |
1377 | if len([i for i in content if i.startswith('render')]) == 0: | 1377 | nodes = [i for i in content if i.startswith('renderD')] |
1378 | raise RunQemuError("No render nodes found in /dev/dri: %s. %s" %(content, render_hint)) | 1378 | if len(nodes) == 0: |
1379 | raise RunQemuError("No render nodes found in /dev/dri/: %s. %s" %(content, render_hint)) | ||
1380 | for n in nodes: | ||
1381 | try: | ||
1382 | with open(os.path.join("/dev/dri", n), "w") as f: | ||
1383 | f.close() | ||
1384 | break | ||
1385 | except IOError: | ||
1386 | pass | ||
1387 | else: | ||
1388 | 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)) | ||
1379 | except FileNotFoundError: | 1389 | except FileNotFoundError: |
1380 | raise RunQemuError("/dev/dri directory does not exist; no render nodes available on this machine. %s" %(render_hint)) | 1390 | raise RunQemuError("/dev/dri directory does not exist; no render nodes available on this machine. %s" %(render_hint)) |
1381 | 1391 | ||