KomputeProject / kompute

General purpose GPU compute framework built on Vulkan to support 1000s of cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usecases. Backed by the Linux Foundation.
http://kompute.cc/
Apache License 2.0
1.97k stars 151 forks source link

Add example showing how existing vulkan graphical engine can integrate Kompute #41

Open axsaucedo opened 4 years ago

axsaucedo commented 4 years ago

Currently all the examples show how to use Vulkan Kompute from scratch, but it will be important to show how vulkan kompute can be used on an existing vulkan application. A potential way to explore this may be by converting some of the Sacha Willems Vulkan examples but using Kompute for the computational aspect https://github.com/SaschaWillems/Vulkan

ttddee commented 3 years ago

Seconded! I am working on this and would like to add some machine learning features in the future. Would I be able to pass my existing Vulkan instance to Kompute?

Once I have figured out how this works I could contribute a tutorial on f.e. how to use Kompute in a Qt application...

axsaucedo commented 3 years ago

@ttddee that project looks really interesting - I would be very keen on providing guidance / pointers on how this could be done. As of today you can actually just initialise a kp::Manager by passing your existing Vulkan Device/Instance, you can see the constructor in the documentation here https://kompute.cc/overview/reference.html#manager

Is this along the lines of what you're looking for?

ttddee commented 3 years ago

@axsaucedo Yes thank you that looks like a good starting point. I will see if I can get something working alongside my renderer. Just for testing right now but it would be great for me if I can integrate Kompute and avoid having to ship some larger library.

I haven't had much time to look at this, so it might be a silly question, but are you planning to have support for convolutional networks in the future?

axsaucedo commented 3 years ago

Definitely, something that I would be really keen to explore! As of today, it would have to be implemented as a set of shaders - I would be very keen to work towards providing a set of kp::Operators that specialised for this, but it should be possible as of today to write these on top of Kompute, and would decrease the amount of boiler plate required for compute purposes.

ttddee commented 3 years ago

Being able to do things like this in a simple manner would be amazing for image processing: https://github.com/kritiksoman/GIMP-ML/blob/master/gimp-plugins/PyTorch-Image-Dehazing/net.py