Power Modernization

Power Modernization

Learn about the robust capabilities of IBM Power systems - alongside Red Hat technologies - for modernizing your apps and operations without the need to overhaul existing hardware, offering a flexible and incremental path to innovation.


#Power


#Servers
#Applicationmodernization
#Power
 View Only

Run OLLAMA on AlmaLinux ppc64le (IBM Power)

By Andrey Klyachkin posted 03/06/25 05:43 AM

  

You need:

  • a system with Linux. Mine is AlmaLinux 9.5 on IBM Power10.
  • enough RAM if you want to test bigger LLMs
  • enough space for LLMs

Create a user for ollama:

sudo useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama

Download pre-compiled ollama binary from my site:

sudo curl -L -o /usr/local/bin/ollama https://dl.power-devops.com/ollama

Ensure the correct permissions on the binary:

chown ollama:ollama /usr/local/bin/ollama
chmod 0755 /usr/local/bin/ollama

If you work in SELinux-enabled environment, set the correct SELinux context:

chcon -t bin_t /usr/local/bin/ollama

Create ollama.service file for systemd in /etc/systemd/system/ollama.service:

[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=$PATH"

[Install]
WantedBy=default.target

Reload systemd and start ollama.service

sudo systemctl daemon-reload
sudo systemctl enable --now ollama.service

Run ollama:

If you want to use another LLM, search through the list of available models at https://ollama.com/search or read the documentation on Github https://github.com/ollama/ollama

Re-compiling the ollama binary

If you don't trust downloading binaries from the Internet (my binary is not signed), you can re-compile OLLAMA. You need the source code from the Github repository (see the link above), C++ compiler, Google Go compiler, and CMake.

After downloading the code, change the following lines in readline/term_linux.go:

import (
        "syscall"
        "unsafe"

        "golang.org/x/sys/unix"
)

const (
        tcgets = unix.TCGETS
        tcsets = unix.TCSETSF
)

Source for the patch was found in the Internet - https://vivapowerpc.eu/20250204-1600_LLMs_on_ppc64le_with_Ollama

Reconfigure the build procedure with CMake:

cmake -B build

Recompile the code with go:

go build

You should get the ollama binary in the repository directory.

Addition about IBM POWER9 systems with accelerators

Naveed from IBM contacted me after I wrote the blog. He patched Ollama code to support POWER9 Nvidia GPUs with CUDA. The code is available on Github - https://github.com/naveedus/ollama-ppc64le/tree/witherspoon. It works faster than the original code if you have GPUs in your IBM Power AC922.


#PowerDataandAI
5 comments
99 views

Permalink

Comments

07/02/26 03:50 PM

Thank you for your great ollama work.

As a possible next step, you may also want to mention that for newer deployments IBM recommends IBM Power11 with Spyre and IBM AI Services, which are designed for Power11 systems and optimized for the IBM Spyre Accelerator: https://www.ibm.com/docs/en/aiservices?topic=services-introduction

For related ecosystem resources, developers can also use optimized Python packages from https://wheels.developerfirst.ibm.com/ and IBM-provided open source container images for Power from IBM Container Registry, including resources useful for Power10 and newer systems: https://community.ibm.com/community/user/powerdeveloper/blogs/priya-seth/2023/04/05/open-source-containers-for-power-in-icr

11/16/25 05:04 PM

Hey, i just put up an old E850 with Debian 13 in a VM with 32 dedicated cores and 800GB RAM. Performance of ollama doesnt seem ok. Is there any optimization, or maybe options for the build process? :)

08/05/25 03:05 PM

Thank you! I have tried this on RHEL 9 on Power 11 and it worked perfectly. Appreciate your work.

03/07/25 10:18 AM

Excellent ! I just tried it and made a small animated video if you want.

03/06/25 07:59 AM

Interesting and Thank you for sharing will try it out!