Running large language models (LLMs) on IBM Power systems presents challenges, especially when the most popular tools do not offer official support for the ppc64le architecture. This post describes how we developed and validated the execution of Ollama with GPU acceleration on the IBM Power9 server, with NVIDIA Tesla V100 GPUs and CUDA 12.2.
Ollama is a framework based on llama.cpp, designed to simplify the deployment and execution of language models, offering a user-friendly interface and support for a wide range of tasks. Figure 1 illustrates the request flow using Ollama on the IBM POWER9 environment.
However, Ollama does not offer official support for ppc64le with CUDA. A previous approach, described in this IBM Community post, used a community fork of Ollama to enable GPU inference on AlmaLinux ppc64le. However, after using and compiling Ollama through that fork, we found that, due to it being an outdated version, the tool lacked support for current models.
To address this, we created a fork from the repository mentioned above, updating Ollama to version 0.23.2 with the necessary patches for the ppc64le architecture and GPU support via CUDA, enabling inference with current models such as Gemma and DeepSeek.
What this work enables
-
Run GPU-accelerated LLM inference on IBM Power9 (ppc64le architecture) with NVIDIA Tesla V100;
-
Use a pre-compiled binary or install via Conda, without the need to build from source;
-
Access an updated Ollama repository (v0.23.2) compatible with recent models.
Environment
The setup was validated in the following environment:
-
IBM Power9 server (AC922);
-
ppc64le architecture;
-
Operating system: AlmaLinux 8.10;
-
RAM: 512 GB;
-
GPU: 4× NVIDIA Tesla V100 SXM2 (16 GB);
-
NVIDIA driver: 535.54.03;
-
Conda virtual environment.
Modifications made
To compile Ollama on the ppc64le architecture, adaptations were required on three fronts: missing files in ggml, removal of incompatible backends, and build system adjustments. Each is discussed below.
-
PowerPC support files in ggml
llama.cpp, the inference backend underlying Ollama, did not include the necessary files for the PowerPC architecture. It was necessary to manually add cpu-feats.cpp and quants.c from the upstream ggml repository, as well as create Go wrappers (powerpc.go and cpu_ppc64le.go) so that the compiler would recognize the new CPU backend.
-
Removal of unsupported CPU variants
The ggml CMakeLists.txt referenced the power10 and power11 variants, which do not exist in the AC922 environment. The corresponding entries were removed to prevent compilation failures.
-
CMake and Go build adjustments
The ggml-cuda module had to be decoupled from the root CMakeLists.txt and re-enabled via compilation flags (-DGGML_CUDA=ON, CUDA_ARCHITECTURES=70). The CUDA_ARCHITECTURES=70 flag is specific to the Tesla V100, which belongs to the Volta architecture (sm_70). In the Go build, the flag -extldflags=-lstdc++fs was required for compatibility with GCC 11 on AlmaLinux 8.
The complete step-by-step guide for building the binary from source, including exact dependency versions, environment configuration, ppc64le-specific fixes, and the compilation flags mentioned above, is documented in the README_POWER9 of the repository: https://github.com/llm-pt-ibm/ollama-ppc64le.
Installation
Two options are available for those who do not want to build from source.
Option 1 — Pre-compiled binary (GitHub Releases):
|
# download the binary
wget https://github.com/llm-pt-ibm/ollama-ppc64le/releases/download/v0.23.2-ppc64le-power9/ollama-ppc64le
# make it executable
chmod +x ollama-ppc64le
|
Option 2 — Conda package:
|
conda install ufcg-ibm::ollama-ppc64le
|
For instructions on running inference, including starting the server, confirming GPU detection, and pulling/running a model, see the How to use section of the README_POWER9.
Conclusion
This work presents a reproducible path for running GPU-accelerated LLM inference on IBM Power9 systems using Ollama, addressing the lack of official ppc64le support through the development of a repository that uses a fork to update the tool and provide pre-compiled binaries. By making these resources available, we aim to lower the barrier for developers working in this environment and to contribute to the expansion of the ppc64le ecosystem.
This work is part of a collaboration between the Federal University of Campina Grande (UFCG, Brazil) and IBM, within the scope of the Multi-Arq project, which focuses on porting, validating, and optimizing applications for the ppc64le architecture.
Resources
#PowerDataandAI