[HN Gopher] gpu.cpp: A lightweight library for portable low-leve...
       ___________________________________________________________________
        
       gpu.cpp: A lightweight library for portable low-level GPU
       computation
        
       Author : bovem
       Score  : 147 points
       Date   : 2024-07-13 06:12 UTC (16 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | pavlov wrote:
       | Lovely! I like how the API is in a single header file that you
       | can read through and understand in one sitting.
       | 
       | I've worked with OpenGL and Direct3D and Metal in the past, but
       | the pure compute side of GPUs is mostly foreign to me. Learning
       | CUDA always felt like a big time investment when I never had an
       | obvious need at hand.
       | 
       | So I'm definitely going to play with library and try to get up to
       | speed. Thanks for publishing it.
        
       | Arech wrote:
       | Very interesting... I wonder, how does code performance compares
       | to raw Vulkan?
        
       | hpen wrote:
       | Any performance metrics vs Vulkan, metal, etc?
        
         | mpreda wrote:
         | vs OpenCL, ROCm, CUDA?
        
           | zamadatix wrote:
           | Since this library ends up acting as a layer on top of the
           | listed specifications it'd be more applicable to see
           | benchmarks comparing the performance to building on top of
           | said specifications directly to get an idea of overhead. At
           | that point you could layer existing generic comparisons for
           | the specifications you listed (or anything else for that
           | matter) instead of needing them all to be redone specifically
           | with this in mind.
        
       | byefruit wrote:
       | This looks great. Is there an equivalent project in rust?
        
         | LegNeato wrote:
         | https://github.com/charles-r-earp/krnl, and more broadly
         | https://github.com/EmbarkStudios/rust-gpu.
        
       | 01HNNWZ0MV43FF wrote:
       | > The only library dependency of gpu.cpp is a WebGPU
       | implementation.
       | 
       | Noo
        
         | sieste wrote:
         | What's the problem?
        
       | uLogMicheal wrote:
       | This is awesome! Was looking at creating similar, inspired by the
       | miniaudio approach. Will likely contribute a dart wrapper soon.
        
       | almostgotcaught wrote:
       | TIL you can run the WebGPU runtime without a browser.
        
         | summarity wrote:
         | For me that's its most promising feature. At last a truly cross
         | platform compute library (not this, WebGPU itself). With two
         | complete and mature implementations no less (dawn and wgpu).
        
           | binary132 wrote:
           | I do not think of dawn or wgpu as complete and mature, has
           | something changed?
        
             | moffkalast wrote:
             | Yeah does Firefox support it yet in stable, or are they
             | still a solid year behind Chrome as usual?
        
               | rahkiin wrote:
               | WebGPU is interesting outside the browser: both dawn and
               | wgpu-rs can be used as cross playform native gpu layer.
               | That does not depend on firefox having webgpu support
        
       | 0xf00ff00f wrote:
       | This is cool, but they should have just used Vulkan. Dawn is a
       | massive dependency (and a PITA to build, in my experience) to get
       | what's basically a wrapper around Vulkan. Vulkan has a reputation
       | for being difficult to work with, but if you just want to use a
       | compute queue it's not that horrible. Also, since Vulkan uses
       | SPIR-V, the user would have more choices for shading languages.
       | Additionally, with RenderDoc you get source-level shader
       | debugging.
       | 
       | Shameless plug: in case anyone wants to see how doing just
       | compute with Vulkan looks like, I wrote a similar library to
       | compete on SHAllenge [0], which was posted here on HN a few days
       | ago. My library is here: https://github.com/0xf00ff00f/vulkan-
       | compute-playground/
       | 
       | [0] https://shallenge.quirino.net/
        
         | rahkiin wrote:
         | Your suggestion would not work on mac or ios
        
           | rice7th wrote:
           | Moltenvk is a great solution
        
       | austinvhuang wrote:
       | Hi, author here! Agh I was intending for the project to fly under
       | the radar for a few more days before making the announcement and
       | blog post (please look/upvote that when you see it haha :)
       | 
       | But since this is starting I'm happy to chat. Nice to see the
       | interest here!
        
       | jph00 wrote:
       | We just published an article introducing this project, what it's
       | for, and how it works:
       | 
       | https://www.answer.ai/posts/2024-07-11--gpu-cpp.html
       | 
       | (@dang if you see this perhaps this would be a better link for
       | this thread?)
        
       ___________________________________________________________________
       (page generated 2024-07-13 23:00 UTC)