Skip to content

Commit 2f5cbd4

Browse files
Erik-Lundellfacebook-github-bot
authored andcommitted
Capture output of Vela and print on error (#3057)
Summary: Change-Id: I0443a6ab26766a51511d9e4ea532fc8e76836ede Pull Request resolved: #3057 Reviewed By: mergennachin Differential Revision: D56476746 Pulled By: digantdesai fbshipit-source-id: 4b6d9738a9202980fa06bb8f4232fb4a916a7633
1 parent 6712185 commit 2f5cbd4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

backends/arm/arm_vela.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ def vela_compile(tosa_graph, args: List[str]):
4343

4444
# invoke vela
4545
vela_command = f"cd {tmpdir}; vela {' '.join(args)} {tosaname}"
46-
subprocess.run([vela_command], shell=True, check=True)
46+
try:
47+
subprocess.run([vela_command], shell=True, check=True, capture_output=True)
48+
except subprocess.CalledProcessError as process_error:
49+
raise RuntimeError(
50+
f"Vela compiler ('{vela_command}') failed with error:\n \
51+
{process_error.stderr.decode()}\n \
52+
Stdout:\n{process_error.stdout.decode()}"
53+
)
4754

4855
np_path = os.path.join(tmpdir, "output", "out_sg0_vela.npz")
4956
blocks = b""

0 commit comments

Comments
 (0)