Installing GPU drivers
Fornax runs its models on your GPU. On Linux, that needs your GPU’s Vulkan driver and the Vulkan loader. Most desktop installs already have both. Minimal installs, servers and containers often don’t.
Fornax checks for a GPU when an engine loads. If it finds none, it stops with an error that points here, rather than quietly running on the CPU, which is many times slower. See Fornax says it found no GPU.
1. Find your GPU
Section titled “1. Find your GPU”lspci | grep -iE 'vga|3d|display'- AMD or Intel: you need Mesa’s Vulkan driver (open source, from your distribution). Go to step 2.
- NVIDIA: you need NVIDIA’s driver, which includes its Vulkan driver. Go to step 3.
2. AMD or Intel: install Mesa’s Vulkan driver
Section titled “2. AMD or Intel: install Mesa’s Vulkan driver”sudo dnf install vulkan-loader mesa-vulkan-drivers vulkan-toolssudo apt install libvulkan1 mesa-vulkan-drivers vulkan-toolssudo pacman -S vulkan-icd-loader vulkan-tools vulkan-radeon # AMDsudo pacman -S vulkan-icd-loader vulkan-tools vulkan-intel # Intelsudo zypper install libvulkan1 vulkan-tools libvulkan_radeon # AMDsudo zypper install libvulkan1 vulkan-tools libvulkan_intel # IntelThen check it.
3. NVIDIA: install NVIDIA’s driver
Section titled “3. NVIDIA: install NVIDIA’s driver”NVIDIA’s driver isn’t in most distributions’ default repositories. Install it the way your distribution recommends, then reboot.
Enable RPM Fusion, then install the driver:
sudo dnf install \ https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \ https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpmsudo dnf install akmod-nvidia vulkan-toolsWait a few minutes for the kernel module to build, then reboot.
On Ubuntu, let it pick the right driver:
sudo ubuntu-drivers installsudo apt install vulkan-toolsOn Debian, enable the contrib, non-free and non-free-firmware components in your apt sources, then:
sudo apt install nvidia-driver firmware-misc-nonfree vulkan-toolsReboot afterwards. See Debian’s NVIDIA guide for older cards.
sudo pacman -S nvidia-open nvidia-utils vulkan-toolsnvidia-utils holds the Vulkan driver. Older cards need a different driver package; see the
Arch wiki. Reboot afterwards.
Follow openSUSE’s NVIDIA guide, then:
sudo zypper install vulkan-toolsReboot afterwards.
4. Check that Vulkan sees your GPU
Section titled “4. Check that Vulkan sees your GPU”vulkaninfo --summaryUnder Devices, look for your GPU, with a deviceType of PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU or
PHYSICAL_DEVICE_TYPE_DISCRETE_GPU. For example:
deviceType = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPUdeviceName = AMD Radeon 8060S Graphics (RADV GFX1151)If the only device is llvmpipe, that’s Mesa’s software renderer running on the CPU: the GPU driver is missing,
or your user can’t reach the GPU (below). If vulkaninfo itself fails with ERROR_INCOMPATIBLE_DRIVER, no driver is
installed at all.
That’s it: Fornax will use the GPU that vulkaninfo lists.
If the GPU still isn’t found
Section titled “If the GPU still isn’t found”Your user can’t reach the GPU. On a desktop, the login session grants access to the GPU. On a server, or over
SSH, your user may need to be in the render and video groups:
sudo usermod -aG render,video $USERLog out and back in (or reboot), then run vulkaninfo --summary again.
After a kernel or driver update, reboot before trying again. The NVIDIA module in particular is built for the running kernel.
In a container
Section titled “In a container”The container needs the GPU device, and its own copy of the driver’s user-space part.
Pass the GPU’s device nodes in, and install Mesa’s Vulkan driver in the image (for example mesa-vulkan-drivers and
libvulkan1 in a Debian or Ubuntu image):
docker run --device /dev/dri --group-add "$(getent group render | cut -d: -f3)" my-fornax-appInstall the NVIDIA Container Toolkit on the host, then ask for the GPU, including the graphics capability that Vulkan needs:
docker run --gpus all -e NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics my-fornax-appFornax says it found no GPU
Section titled “Fornax says it found no GPU”When an engine built for a GPU loads and the GPU runtime reports no usable GPU, Fornax stops with an error like this:
Fornax found no GPU for libfornax_llama.so, which is built for Vulkan. Without one, it would run on the CPU,many times slower, so it won't start.The error lists the install commands above. Follow the steps on this page, check with vulkaninfo --summary, and run
again.
To run on the CPU anyway (on a CI machine, for example), allow it:
java -Dfornax.allowCpu=true ... # or: export FORNAX_ALLOW_CPU=trueFornax then runs, and logs a large warning that it is running on the CPU.
If the error says Fornax has no Vulkan loader (libvulkan.so.1), install the loader package from
step 2 (vulkan-loader, libvulkan1 or vulkan-icd-loader).
HIP (ROCm) and CUDA
Section titled “HIP (ROCm) and CUDA”Fornax’s published natives use Vulkan, which needs only the drivers above. The HIP and CUDA backends are for building
Fornax’s engines yourself, and need ROCm or the CUDA toolkit; see Choosing a GPU backend.
Fornax checks those for a GPU the same way, and its error tells you how to check: rocminfo for ROCm, nvidia-smi
for NVIDIA. For ROCm, your user also needs to be in the render and video groups.
Windows
Section titled “Windows”Fornax doesn’t run on Windows yet.