Where to Learn Vulkan for parallel computation (with references to porting from CUDA)

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/vulkan

Our great sponsors
  • SonarLint - Clean code begins in your IDE with SonarLint
  • Scout APM - Less time debugging, more time building
  • SaaSHub - Software Alternatives and Reviews
  • vuda

    VUDA is a header-only library based on Vulkan that provides a CUDA Runtime API interface for writing GPU-accelerated applications.

    There is actually a project on Github which tries to mimic the CPU-side code from CUDA to Vulkan projects, called VUDA.

  • shaders

    Circle C++ shaders

    First we have Circle C++ shaders, which pretty much would tick all the boxes. Problem is it's closed source and only compiles host code on linux. Closed source isn't the biggest of issues actually, but prevents anyone from fixing the developers issue with interfacing with the windows ABI and getting the thing working on windows (which itself isn't something they are able to fix because windows doesn't provide the documentation to work with their ABI). However you could use it separately to compile your SPIR-V for windows since SPIR-V doesn't care about platform itself.

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

  • rust-gpu

    🐉 Making Rust a first-class language and ecosystem for GPU shaders 🚧

    Second we have Rust GPU is better as a "all in one solution" as in you can integrate it directly into your rust projects with out real issue regardless of platform. The issue with this is it isn't finished, and doesn't have near the feature complete-ness of Circle C++, only supports vertex, fragment and compute IIRC, and compute does not have all the support it needs right now. The only other minor downside (which isn't that big of a deal once you realize you have to do this half the time in CUDA anyway) is that you can't have rust GPU modules and rust host modules in the same file. But that's never practically been an issue for me. It does aim to have rust facilities in it, and you can get around some of the alpha-ness by using inline SPIR-V. And like Circle C++, you don't have to use rust in your host code to use this, you can just use it separately only for your compute sharers if you wanted to.

  • autograph

    Machine Learning Library for Rust

    I'm working on a machine learning library https://github.com/charles-r-earp/autograph implemented in Rust that uses rust-gpu to compile Rust compute shaders to spirv, and then gfx_hal to target metal and dx12. Training performance is currently about 2x slower than pytorch (cuda) on my laptop but I've made significant progress recently and I am targeting 1.5x. While rust-gpu itself has it's own restrictions, it does support inline spirv assembly, which provides direct access to operations not provided in its std lib, thus it's lower level than GLSL. For example, it should be possible to target cuda tensor cores via cooperative matrix operations (I believe Metal supports these as well but this may not be implemented in spirv-cross and certainly isn't in naga). Once I have things a bit more stabilized I'd like to provide more examples, like porting from cuda / opencl, but I'm still figuring out patterns like how to work with 16 and 8 bit types in a nice and portable way.

  • VkFFT

    Vulkan/CUDA/HIP/OpenCL/Level Zero Fast Fourier Transform library

    https://github.com/DTolm/VkFFT is a project to look at.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts