Set up on your platform
Find your machine below and follow its steps. On Linux with any GPU, and on any Mac, you add Fornax from Maven Central and you’re done. ROCm and CUDA mean building the engines once for your GPU.
| Platform | GPU | Natives | State |
|---|---|---|---|
| Linux, Vulkan | AMD, Intel, NVIDIA | published | tested nightly |
| Linux, ROCm | AMD | build them yourself | tested nightly |
| macOS, Metal | Apple silicon, Intel Macs | published | tested on Apple silicon |
| NVIDIA, CUDA | NVIDIA | build them yourself | not tested yet |
| Windows | planned |
Just want to try the models, with no code? Fornax Studio installs on Linux and macOS.
Linux: AMD, Intel or NVIDIA, with Vulkan
Section titled “Linux: AMD, Intel or NVIDIA, with Vulkan”The quickest path, and the one to pick unless you need ROCm or CUDA. Linux x86-64 with glibc 2.39 or newer (Ubuntu 24.04, Fedora 40 and later).
-
Check the GPU driver. Desktop Fedora and Ubuntu ship it.
vulkaninfo --summaryshould list your GPU; if it doesn’t, follow Installing GPU drivers. -
Add Fornax to your build: an engine module and the Linux natives jar. With Gradle:
dependencies {implementation(platform("org.fornax4j:fornax-bom:0.2.0"))implementation("org.fornax4j:fornax-llama")runtimeOnly("org.fornax4j:fornax-natives-linux-x86_64-vulkan")}Maven, and every module, are in Maven and Gradle.
-
Run on Java 22 or newer, with
--enable-native-access=ALL-UNNAMED. The first call unpacks the natives jar into~/.cache/fornax.
Linux: AMD with ROCm
Section titled “Linux: AMD with ROCm”ROCm (HIP) is faster than Vulkan for video on AMD, and has no compute timeout for long jobs. Its libraries are built for your GPU’s architecture and link the ROCm you installed, so you build Fornax’s engines once on your machine. It passes the test suite on a Radeon 8060S (one rerank score drifts, #80).
-
Install ROCm 7 and the build tools. On Fedora, ROCm comes from Fedora itself:
Terminal window sudo dnf install rocm-hip-devel hipblas-devel rocblas-devel rocminfo cmake ninja-build gcc-c++ gitOn Ubuntu, add AMD’s ROCm repository with AMD’s install guide, then
sudo apt install rocm-hip-sdk cmake ninja-build g++ git. -
Let your user reach the GPU, and find its architecture.
Terminal window sudo usermod -aG render,video $USER # then log out and back inrocminfo | grep -m1 -o 'gfx[0-9a-f]*' # gfx1151 is a Radeon 8060S; gfx1100 a Radeon RX 7900 -
Build the engines at the release you use. About 15 minutes; it writes seven libraries (around 700 MB) to
build/native/linux-x86_64-hip/.Terminal window git clone https://github.com/liberation-data/fornax.git && cd fornaxgit checkout v0.2.0 # the same version as your Fornax dependenciesHIP_ARCH=gfx1100 native/build.sh hip # your architecture from step 2 -
Add the engine modules, without a natives jar, and point Fornax at your libraries:
dependencies {implementation(platform("org.fornax4j:fornax-bom:0.2.0"))implementation("org.fornax4j:fornax-llama")}Terminal window java --enable-native-access=ALL-UNNAMED \-Dfornax.library.path=/path/to/fornax/build/native/linux-x86_64-hip -jar your-app.jarFORNAX_LIBRARY_PATHworks too. Either one takes priority over a natives jar on the classpath. -
Check it found the GPU. If ROCm finds no GPU, Fornax stops with an error that says what to check (
rocminfo, therendergroup), rather than running on the CPU.
Choosing a GPU backend has what Fornax has learned on HIP so far.
macOS, with Metal
Section titled “macOS, with Metal”macOS 13.3 or newer, on Apple silicon or Intel. Nothing to install: Metal is part of macOS. Fornax passes its test suite on an Apple M2 Max.
-
Add Fornax to your build, with the natives jar for your Mac:
dependencies {implementation(platform("org.fornax4j:fornax-bom:0.2.0"))implementation("org.fornax4j:fornax-llama")runtimeOnly("org.fornax4j:fornax-natives-macos-aarch64-metal") // macos-x86_64-metal on an Intel Mac} -
Run on Java 22 or newer, with
--enable-native-access=ALL-UNNAMED.
NVIDIA, with CUDA
Section titled “NVIDIA, with CUDA”NVIDIA GPUs run Fornax through Vulkan today, with the published Linux natives: start there. A CUDA build is possible but hasn’t been tested yet; reports are welcome.
-
Install the CUDA toolkit (with cuBLAS), with
CUDA_PATHpointing at it, and the build tools from the ROCm steps above. -
Build and point Fornax at the libraries, as for ROCm:
Terminal window git checkout v0.2.0 && native/build.sh cudajava --enable-native-access=ALL-UNNAMED -Dfornax.library.path=$PWD/build/native/linux-x86_64-cuda -jar your-app.jar
Windows
Section titled “Windows”Fornax doesn’t run on Windows yet. The Java side is ready; the native build and a Windows natives jar are planned in #83, starting with Vulkan.