llama.cpp b9906 fixes NaN/INFINITY handling on AMD ROCm GPUs
A critical bug fix re-enables infinity handling without sacrificing fast-math optimizations.
The latest release of llama.cpp, tag b9906, addresses a subtle but impactful compiler issue specific to ROCm (AMD's GPU compute platform) when using Clang 22. The problem arose because the widely used -ffast-math flag in Clang implicitly enables -ffinite-math-only, which disables support for INFINITY and NaN values. This triggered a -Wnan-infinity-disabled warning that was treated as an error in CI, breaking builds for users on AMD hardware. The fix explicitly adds -fno-finite-math-only alongside -ffast-math, re-enabling infinity handling without losing other fast-math speedups.
This release is important for the AI community because llama.cpp is the most popular open-source framework for running large language models locally on consumer hardware. AMD GPU users, particularly those using ROCm, can now build the project without workarounds. The release also ships binaries for a wide range of platforms, including macOS (Apple Silicon and Intel), Linux (x64, arm64, s390x with Vulkan, ROCm 7.2, OpenVINO, SYCL), Windows (CPU, CUDA 12/13, Vulkan, OpenVINO, SYCL, HIP), Android (arm64 with OpenCL Adreno), and more. The fix is a small but critical quality-of-life improvement for developers deploying LLMs on AMD GPUs.
- Fixes a build error on ROCm/clang 22 where -ffast-math implied -ffinite-math-only, blocking NaN/INFINITY handling.
- Adds -fno-finite-math-only flag to preserve fast-math optimizations while re-enabling infinity support.
- Release includes prebuilt binaries for 20+ platform configurations, including macOS, Linux, Windows, and Android.
Why It Matters
Enables seamless local LLM inference on AMD GPUs, removing a build blocker for thousands of developers.