From a9fa1643912c3c70d60d5f090039b33a7de37182 Mon Sep 17 00:00:00 2001 From: Stephen Jia Date: Fri, 7 Mar 2025 10:54:31 -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-poisoned] --- 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)