Skip to content

Commit fe0ccb9

Browse files
pytorchbotSS-JIA
andauthored
[ET-VK][ez] Log GLSL file path on compile error (#9064)
## Context Make it much easier to debug GLSL compile errors by logging the path of the GLSL file when it fails to compile. This makes it easy to quickly open up the generated GLSL and see what the compiler is complaining about. Differential Revision: [D70795732](https://our.internmc.facebook.com/intern/diff/D70795732/) ghstack-source-id: 270409395 Pull Request resolved: #9050 Co-authored-by: Stephen Jia <[email protected]>
1 parent e6d44fa commit fe0ccb9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

backends/vulkan/runtime/gen_vulkan_spv.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,12 @@ def process_shader(shader_paths_pair):
769769
+ self.glslc_flags.split()
770770
)
771771

772-
subprocess.check_call(cmd)
772+
try:
773+
subprocess.check_call(cmd)
774+
except subprocess.CalledProcessError as e:
775+
raise RuntimeError(
776+
f"Failed to compile {os.getcwd()}/{glsl_out_path}"
777+
) from e
773778

774779
return (spv_out_path, glsl_out_path)
775780

0 commit comments

Comments
 (0)