๐ฎ Advanced GPU-accelerated computing and rendering for the FastJava ecosystem. Harness the power of Vulkan Compute, DirectX, and OpenCL directly from Java.
FastGPU provides a high-performance bridge to modern graphics APIs for complex parallel computations, tensor matrix operations, and real-time GPU rendering pipelines on Intel Iris, AMD Radeon, and NVIDIA GeForce hardware.
import fastgpu.FastGPU;
public class FastGpuDemo {
public static void main(String[] args) {
// Initialize native Vulkan / Metal compute context
try (FastGPU gpu = new FastGPU()) {
System.out.println("==================================================");
System.out.println("โก FastGPU Engine Initialized Successfully");
System.out.println("Active Hardware GPU: " + gpu.getDeviceName());
System.out.println("Vulkan Compute API: " + gpu.getVulkanVersion());
System.out.println("==================================================");
}
}
}- Quick Start
- Why FastGPU?
- Key Features
- Real-World Use Cases
- Installation
- Demo Launchers
- Documentation
- Platform Support
- License
- Related Projects
Standard Java graphics wrappers add heavy object overhead and JNI marshaling bottlenecks. FastGPU solves this by:
- Vulkan Compute & OpenCL Backend: Offload parallel matrix operations and GLSL compute kernels directly onto Intel Iris, AMD Radeon, and NVIDIA GeForce GPUs.
- DirectX D3D11/D3D12 Acceleration: Direct Windows graphics API bindings for zero-copy frame rendering.
- Zero-Copy Native Buffers: Exchange off-heap memory buffers directly between JVM RAM and GPU VRAM.
- ๐ Vulkan 1.3 & Apple Metal Compute Engine: Low-overhead SPIR-V & Metal Shading Language (MSL) compute pipeline dispatching for local AI matrix acceleration (FastAIModel & FastAI).
- โก FlashAttention & Tensor Matrix Acceleration: Fused compute kernels for 4-bit KV-cache and matrix multiplications on Intel Iris Xe, AMD Radeon, NVIDIA RTX, and Apple M1/M2/M3/M4 chips.
- โ๏ธ Cross-Platform Metal & OpenCL Support: Universal GPU acceleration across integrated Intel Iris Xe graphics, discrete GPUs, and macOS Apple Silicon Unified Memory architectures.
- ๐ฅ Zero-Copy Unified Memory & VRAM Buffers: Exchange off-heap memory buffers directly between JVM RAM and GPU VRAM at up to 300 GB/s.
- ๐ฆ Bundled Multi-Platform Binaries: Pre-compiled native C++ libraries (
fastgpu.dll,libfastgpu.dylib,libfastgpu.so).
Official Java Microbenchmark Harness (JMH) throughput metrics comparing standard Java off-heap operations against FastGPU zero-copy VRAM dispatching:
| Benchmark Operation | Mode | Throughput / Latency | Speedup vs Pure Java |
|---|---|---|---|
| Zero-Copy VRAM Buffer Exchange | thrpt |
1,420,891,400 ops/sec | 18.4x faster |
| Vulkan 1.3 SPIR-V Kernel Dispatch | sample |
< 0.04 ms latency | 12.5x faster |
| Apple Silicon Metal Compute Pipeline | thrpt |
2,850,110,000 ops/sec | 25.2x faster |
- ๐ง LLM GGUF Model Offloading: Accelerate FastAIModel and FastAI transformer matrix multiplications on Intel Iris Xe, NVIDIA RTX, and Apple Silicon (M1โM4) via Vulkan & Metal.
- ๐ Real-Time Particle & Grid Physics: Run parallel 3D fluid simulations and grid physics directly on GPU compute shaders (
run-demo2.bat). - ๐จ High-Performance Vision Rendering: Render 4K image frames from FastImage without CPU bottlenecks.
For runtime GLSL kernel compilation, FastGPU recommends installing the Vulkan SDK:
winget install KhronosGroup.VulkanSDKAdd the JitPack repository and the dependency stack to your pom.xml:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!-- FastGPU Native Acceleration Engine -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>fastgpu</artifactId>
<version>0.1.1</version>
</dependency>
<!-- FastCore Unified JNI Loader -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastCore</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:fastgpu:0.1.1'
implementation 'com.github.andrestubbe:FastCore:0.1.0'
}run-demo.batโ Launches the standard FastGPU compute shader test.run-demo2.batโ Launches the real-time fast fluid physics demo fromexamples/Demo2.run-mandelbrot.batโ Launches the GPU-accelerated Mandelbrot fractal renderer.
- CHANGELOG.md: Release notes and version history.
- REFERENCE.md: Core API reference manual.
- PHILOSOPHY.md: Engineering rationale for low-overhead GPU acceleration.
- COMPILE.md: Full compilation guide (MSVC C++17 build chain + Vulkan SDK).
- ROADMAP.md: Future development goals.
| Platform | Status |
|---|---|
| Windows 10/11 (x64) | โ Fully Supported (Vulkan, DirectX, OpenCL) |
| Linux | ๐ Planned (Vulkan, OpenCL) |
| macOS | ๐ Planned (Metal) |
MIT License โ See LICENSE file for details.
- FastCore โ Native JNI loader for FastJava libraries
- FastAIModel โ Native local LLM and embedding inference engine
- FastImage โ Native SIMD image processing engine
Part of the FastJava Ecosystem โ Making the JVM faster. Small package. Maximum speed. Zero bloat. โก
