-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Will the Metal framework be wrapped? #264
Comments
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). Maybe, but that will be a lot of work and requires some serious design work to get a usable API. It doesn't help that I have no use case for using these APIs myself. To be honest I'm still hoping that someone else builds something like PyOpenGL but for Metal instead of OpenGL. |
Original comment by Aaron Elkins (Bitbucket: [Aaron Elkins](https://bitbucket.org/Aaron Elkins), ). Yep, I was thinking using PyOpenGL for my project, but since OpenGL is deprecated in the new macOS Mojave, so I think I should use Metal instead, but no Metal binding for Python. Hope there will be a good solution for Python in the near future. |
Original comment by Yuan Chuan Kee (Bitbucket: yuanchuankee, GitHub: yuanchuankee). I have been looking at this too. My use case is to use the MPS for machine learning as currently most popular ML framework such as Tensorflow and PyTorch only supports CUDA. |
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). I agree that having bindings to the Metal framework would be useful, but creating these would likely require more time than I have available. That said, I just took a quick look at the headers and the main API appears to be a regular Objective-C class-based API and that should be fairly easy to wrap (although still quite some work due to the size of the API). A complicating factor is passing memory to/from Metal in a sane way, and possibly dealing with SIMD types (such as vector_float3). I'll definitely add looking into this to my list for the summer, but might get around to this earlier. Do you know if there are interesting, but simple, Objective-C examples for using Metal that could be used to functionally test a Python binding? |
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). FWIW I plan to wrap the Metal frameworks for PyObjC 6.0 (later this year). |
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). I’ve started work on these bindings, but it is going slower than expected. One reason for that is that my tooling for creating bindings breaks on the Metal headers. I expect similar problems with the MetalPerformanceShader framework (which is a pretty large framework). I still expect to ship PyObjC 6.0 with support for these frameworks though. |
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). Given the current rumours about a macOS 10.15 release later this week I’ll probably not ship Metal bindings with 6.0. A ran into a problem with generating metadata for this framework, these headers contain constructs that are not understood by the Python bindings to libclang that I’m using. I’m hoping that I can “just” move to the Python bindings in the clang repository, but that will take some time. Creating metadata manually is not really an option due to the sheer size of these frameworks. |
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). I’ve made some progress on this, I’ve tweaked the metadata generator to not crash on the metal headers, and that should make it a lot easier to make progress. My current plan is to have a release with Metal support before the holidays (both Metal itself and MetalPerformanceShaders). |
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). Initial bindings are in changeset 4264900dfc8b. The bindings are far from finished though, tests don’t pass yet and are not complete. |
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). I’ve done some updates over the last couple of days and the bindings are nearing completion. With some luck I’ll release a version of PyObjC with these binding before the end of the year. |
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). Changeset bc938aaa4c76 finishes work on pyobjc-framework-Metal |
Original report by Aaron Elkins (Bitbucket: [Aaron Elkins](https://bitbucket.org/Aaron Elkins), ).
Hey, do you have any plan to wrap the Metal framework into PyObjc?
The text was updated successfully, but these errors were encountered: