diff --git a/tinygrad/runtime/ops_metal.py b/tinygrad/runtime/ops_metal.py index 939f913e5f..c721f3818b 100644 --- a/tinygrad/runtime/ops_metal.py +++ b/tinygrad/runtime/ops_metal.py @@ -33,7 +33,9 @@ class MetalProgram: with tempfile.NamedTemporaryFile(delete=True) as shader: shader.write(lib) shader.flush() - os.system(f"cd {pathlib.Path(__file__).parents[2]}/extra/disassemblers/applegpu && python3 compiler_explorer.py {shader.name}") + ret = os.system(f"cd {pathlib.Path(__file__).parents[2]}/extra/disassemblers/applegpu && python3 compiler_explorer.py {shader.name}") + if ret: + print("Error running disassembler: Make sure you have https://github.com/dougallj/applegpu cloned to tinygrad/extra/disassemblers/applegpu") assert lib[:4] == b"MTLB", "Invalid Metal library. Could be due to using conda. Try system python or METAL_XCODE=1 DISABLE_COMPILER_CACHE=1." data = libdispatch.dispatch_data_create(lib, len(lib), None, None) self.library = unwrap2(self.device.device.newLibraryWithData_error_(data, None))