docs: add warning message for conda users when using METAL (#3917)

* docs: add warning message for conda users when using METAL

* fix: conda metal warning too long. disabled line length check

* docs: changed conda METAL warning to include DISABLE_COMPILER_CACHE=1

* fix(metal): now detecting invalid library magic

* format: removed noqa E501

* fix(metal): conda error line len

* fix: typo

---------

Co-authored-by: Léo Paillé <leo.paille@enseirb-matmeca.fr>
This commit is contained in:
Léo
2024-04-02 18:22:24 +02:00
committed by GitHub
parent 0147174ad6
commit e879e16c48

View File

@@ -36,6 +36,7 @@ class MetalProgram:
shader.write(lib)
shader.flush()
os.system(f"cd {pathlib.Path(__file__).parents[2]}/disassemblers/applegpu && python3 compiler_explorer.py {shader.name}")
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))
self.fxn = self.library.newFunctionWithName_(name)