summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-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.
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."""
try:
content = os.listdir("/dev/dri")
- if len([i for i in content if i.startswith('render')]) == 0:
- raise RunQemuError("No render nodes found in /dev/dri: %s. %s" %(content, render_hint))
+ nodes = [i for i in content if i.startswith('renderD')]
+ if len(nodes) == 0:
+ raise RunQemuError("No render nodes found in /dev/dri/: %s. %s" %(content, render_hint))
+ for n in nodes:
+ try:
+ with open(os.path.join("/dev/dri", n), "w") as f:
+ f.close()
+ break
+ except IOError:
+ pass
+ else:
+ 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))
except FileNotFoundError:
raise RunQemuError("/dev/dri directory does not exist; no render nodes available on this machine. %s" %(render_hint))