From 12784ccec29907e2606fbe872ff6b3f5ef9d1756 Mon Sep 17 00:00:00 2001 From: Stephen Jia Date: Fri, 7 Mar 2025 10:54:33 -0800 Subject: [PATCH] [ET-VK][ez] Log GLSL file path on compile error ## 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: https://github.com/pytorch/executorch/pull/9050 --- backends/vulkan/runtime/gen_vulkan_spv.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backends/vulkan/runtime/gen_vulkan_spv.py b/backends/vulkan/runtime/gen_vulkan_spv.py index 7d3d2d52950..1db75b7edc9 100644 --- a/backends/vulkan/runtime/gen_vulkan_spv.py +++ b/backends/vulkan/runtime/gen_vulkan_spv.py @@ -769,7 +769,12 @@ def process_shader(shader_paths_pair): + self.glslc_flags.split() ) - subprocess.check_call(cmd) + try: + subprocess.check_call(cmd) + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"Failed to compile {os.getcwd()}/{glsl_out_path}" + ) from e return (spv_out_path, glsl_out_path)