Skip to content
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

Support for MoltenVK? #96

Closed
sbetko opened this issue Nov 11, 2020 · 5 comments
Closed

Support for MoltenVK? #96

sbetko opened this issue Nov 11, 2020 · 5 comments

Comments

@sbetko
Copy link

sbetko commented Nov 11, 2020

Hi! I just wanted to ask if there is a way to use Kompute with MoltenVK? I love Kompute for the portability it brings to GPGPU HPC and this would really enable full coverage of most devices by bringing functionality to MacOS/iOS. If it is possible, even if it isn’t trivial, please point me in the right direction. If it isn’t, then is it something that might be supported eventually, or is it definitely ruled out? Thanks!

@axsaucedo
Copy link
Member

Good morning @pkla, thank you for the words of encouragement. Coincidentally I was able to get my hands on a Macbook this weekend and I was able to build and test the core examples in Kompute by just installing the Vulkan SDK, which abstracts the interaction with the GPU driver through MoltenVK. I would be very keen on adding examples for iOS and MacOS - having said that, looking at some of the Vulkan Examples in xcode, it doesn't seem like there is any modification required in the current codebase to get it to work. Did you run into issues when building on Mac/iOS?

@sbetko
Copy link
Author

sbetko commented Nov 11, 2020

@axsaucedo That's wonderful news. To be honest, I assumed it wouldn't work out of the box so I have not tried it yet. But I'll give it a shot and if I don't run into any barriers then I'll go ahead and close the issue (unless you'd like to keep it open). Thanks!

@axsaucedo
Copy link
Member

Sounds good @pkla - yeah give it a shot, let me know if you run into any issues! Will keep it open in case any issues come up, and can close it otherwise. By the way, it may also be easier to try it out with the python interface https://github.com/EthicalML/vulkan-kompute/tree/master/examples/python as that could make it easier to get up and running quickly.

@sbetko
Copy link
Author

sbetko commented Nov 11, 2020

@axsaucedo So I ran into a slight snag along the way, but I got it working. I was missing the dependency pyshader which isn't mentioned as a dependency in the docs, and there were some missing imports at the top the Python example in the README.

All I had to do was install pyshader and then add this to the top of the example to get it working:

from kp import *
from pyshader import python2shader, ivec3, f32, Array

This should probably be added to the examples and pyshader should be mentioned as a dependency. But other than that, it worked right out of the box.

For anyone looking at this running into the same issue, my final working Anaconda environment can be replicated with running conda env create -f environment.yml, where environment.yml contains the following:

name: kompute
channels:
  - defaults
  - conda-forge
dependencies:
  - python
  - numpy
  - pip
  - pip:
    - pyshader
    - cmake
    - git+git://github.com/EthicalML/vulkan-kompute.git@master

@sbetko sbetko closed this as completed Nov 11, 2020
@axsaucedo
Copy link
Member

This is great! Thanks @pkla - I will add this to the documentation, thank you for giving it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants