radeonsi/ci: handle glinfo errors better

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32288>
This commit is contained in:
Marek Olšák 2024-11-21 14:19:36 -05:00 committed by Marge Bot
parent 738a501e92
commit 3ff8111fc6

View file

@ -251,14 +251,19 @@ skips_list = os.path.normpath(os.path.join(os.path.dirname(__file__), skips_list
env_glinfo = dict(env)
env_glinfo["AMD_DEBUG"] = "info"
p = subprocess.run(
["./glinfo"],
capture_output="True",
cwd=os.path.join(piglit_path, "bin"),
check=True,
env=env_glinfo,
)
try:
p = subprocess.run(
["./glinfo"],
capture_output="True",
cwd=os.path.join(piglit_path, "bin"),
check=True,
env=env_glinfo,
)
except subprocess.CalledProcessError:
print('piglit/bin/glinfo failed to create a GL context')
exit(1)
renderer = None
for line in p.stdout.decode().split("\n"):
if "GL_RENDER" in line:
line = line.split("=")[1]
@ -270,6 +275,10 @@ for line in p.stdout.decode().split("\n"):
elif "gfx_level" in line:
gfx_level = int(line.split("=")[1])
if renderer is None:
print('piglit/bin/glinfo failed to create a GL context')
exit(1)
output_folder = args.output_folder
if is_amd:
print_green("Tested GPU: '{}' ({}) {}".format(gpu_name_full, gpu_name, gpu_device))