Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phronmophobic/clj-webgpu
A clojure wrapper for webgpu-native
https://github.com/phronmophobic/clj-webgpu
clojure gpu gpu-computing webgpu
Last synced: 4 months ago
JSON representation
A clojure wrapper for webgpu-native
- Host: GitHub
- URL: https://github.com/phronmophobic/clj-webgpu
- Owner: phronmophobic
- License: apache-2.0
- Created: 2024-07-15T03:00:11.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-08-12T23:09:37.000Z (6 months ago)
- Last Synced: 2024-09-29T17:22:04.793Z (5 months ago)
- Topics: clojure, gpu, gpu-computing, webgpu
- Language: Clojure
- Homepage:
- Size: 116 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clj-webgpu
WIP bindings for webgpu.
## Rationale
GPUs are much faster for some workloads. I want to be able to write programs that run on my mac as well as with nvidia gpus on linux. Even running the most basic compute shader with Vulkan is [really gnarly](https://github.com/mcleary/VulkanHpp-Compute-Sample/blob/master/main.cpp).
Webgpu is a new cross platform option that is gaining traction and support. Some of the benefits of webgpu vs similar options are:
- cross platform
- multiple implementations (dawn, webgpu-native)
- some compatibility with the web
- growing ecosystem of tools, technique, documentation, and shaders
- flexible, high level API## Deps
```
com.phronemophobic/clj-webgpu {:git/url "https://github.com/phronmophobic/clj-webgpu" :git/sha "daa0179c51c2689c3fabaef650afa1719416aa7d"}
;; native dependencies
com.phronemophobic.cljonda/webgpu-native-darwin-aarch64 {:mvn/version "v0.19.4.1"}
com.phronemophobic.cljonda/webgpu-native-linux-x86-64 {:mvn/version "v0.19.4.1"}
com.phronemophobic.cljonda/webgpu-native-darwin-x86-64 {:mvn/version "v0.19.4.1"}
```## Usage
See [examples](https://github.com/phronmophobic/clj-webgpu/tree/master/examples).
## Native Dependencies
In theory, these examples could run against any webgpu implemtation, but this example has only been tested with [webgpu-native](https://github.com/gfx-rs/wgpu-native), the implementation by Mozilla. The maven native binaries are just reuploads of the [releases](https://github.com/gfx-rs/wgpu-native/releases) provided by the wgpu-native github project. You can build or download the native dependencies yourself as long as the shared library is somewhere that JNA can find it. For example, in a folder specified with `:jvm-opts ["-Djna.library.path=/path/to/folder/"]`.
## Inspiration
- WebGPU is Not Just about the Web: https://youtu.be/qHrx41aOTUQ
- https://github.com/AnswerDotAI/gpu.cpp## License
Copyright © 2024 Adrian
Distributed under the under Apache License v2.0.