Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Install Ollama AMD GPU: Full Setup Guide

· 6 min read · Home Tech

In this article
  1. What Ollama Is and Why GPU Matters
  2. AMD GPU Support: ROCm vs. CUDA
  3. Requirements and Supported AMD GPUs
  4. Installation on Linux (Ubuntu/Debian)
  5. Installation on Windows (Native and WSL2)
  6. Verifying GPU Acceleration
  7. Common Problems and Solutions
  8. Frequently Asked Questions
  9. Safety and Stability Tips

Yes, you can install Ollama with AMD GPU support, and on most Linux systems it works out of the box using the ROCm stack. On Windows, you may need to install the AMD ROCm preview driver or use the Linux version via WSL2. This guide covers the exact steps, requirements, and common pitfalls for both platforms.

What Ollama Is and Why GPU Matters

Ollama is a command-line tool that lets you run large language models (LLMs) like Llama 3, Mistral, and Phi locally on your own hardware. It handles model downloading, quantization, and the inference loop, so you can chat with a model without sending data to a cloud server. The GPU is crucial because LLM inference involves massive matrix multiplication—a GPU can be 10–50x faster than a CPU for this workload, and it also frees your CPU for other tasks.

AMD GPU Support: ROCm vs. CUDA

NVIDIA GPUs use CUDA, which Ollama supports natively. AMD GPUs use ROCm, AMD's open-source compute platform. Ollama builds with ROCm support for Linux, but Windows support is newer and requires a specific driver. The key difference is that ROCm is not a drop-in replacement for CUDA—it has its own set of supported GPUs and kernel versions. As of now, Ollama's official docs state that AMD support is experimental on Windows and stable on Linux for many cards.

Requirements and Supported AMD GPUs

Before you start, check if your GPU is on the ROCm supported list. Generally, you need:

  • An AMD Radeon RX 5000 series or newer (RDNA 1/2/3) or an Instinct data center card.
  • At least 8 GB of VRAM (more is better for larger models).
  • Linux: a recent kernel (5.15+ recommended) and ROCm 5.7.1 or newer.
  • Windows: the AMD ROCm preview driver (available from AMD's site) or use WSL2 with Ubuntu.
  • For integrated GPUs (like Ryzen's Vega), they are not officially supported by ROCm for Ollama.

Check the official Ollama GitHub issues for your exact model if you are unsure—many users report success with RX 6000 and 7000 series cards.

Installation on Linux (Ubuntu/Debian)

The easiest way is to use the official install script, which automatically detects your GPU and installs the necessary ROCm components:

  1. Open a terminal and run: curl -fsSL https://ollama.com/install.sh | sh
  2. After installation, verify with ollama --version.
  3. Start the server with ollama serve (or it runs as a systemd service).
  4. Pull a model, e.g., ollama pull llama3.
  5. Run a test: ollama run llama3. If it works, you should see output.

If the script doesn't detect your GPU, you may need to install ROCm manually. The official ROCm documentation provides steps for adding the AMD repository and installing the rocm package. After that, re-run the Ollama install script.

Installation on Windows (Native and WSL2)

Windows support is less straightforward. Here are the two main paths:

  • Native Windows: Download the Ollama installer from the official site. Then, download and install the AMD ROCm preview driver (search for "AMD ROCm preview driver for Windows" on AMD's site). After that, Ollama should detect your GPU. Some users report needing to set an environment variable HSA_OVERRIDE_GFX_VERSION to match your GPU's architecture (e.g., 10.3.0 for RDNA2).
  • WSL2 (recommended): Install WSL2 with Ubuntu 22.04, then follow the Linux installation steps inside the WSL terminal. This often works better because the Linux ROCm stack is more mature. Ensure you have the latest WSL2 kernel and that your GPU is accessible—check with lspci | grep -i amd.

If you use WSL2, you do not need the Windows ROCm driver; the Linux driver inside WSL handles it.

Verifying GPU Acceleration

To confirm Ollama is using your AMD GPU, run ollama run llama3 and then in another terminal run rocm-smi (Linux) or check task manager (Windows). You should see GPU utilization spike. Alternatively, you can run ollama ps while a model is loaded—it will show the GPU memory used. If you see 0 MiB, the GPU is not being used.

Common Problems and Solutions

Here are typical issues and fixes:

  • Ollama says "no GPU" or falls back to CPU: Check that your GPU is visible to the system (run lspci | grep -i amd on Linux). Ensure you have the correct ROCm driver installed. For some cards, you need to set HSA_OVERRIDE_GFX_VERSION (e.g., for RX 6700 XT, set to 10.3.0).
  • Performance is slow: If you are using a model larger than your VRAM, Ollama will offload to CPU, which is slow. Use a smaller quantized model (e.g., llama3:8b-instruct-q4_0) or reduce context length.
  • Install script fails on Linux: Make sure you have curl and sudo privileges. Also, some distros need manual ROCm installation—follow the official ROCm instructions for your distro.
  • Windows driver issues: The ROCm preview driver is not stable on all cards. If you encounter crashes, try the WSL2 route instead.

Frequently Asked Questions

Does Ollama work with AMD integrated graphics?

Officially, no. ROCm does not support most integrated GPUs (like Vega in Ryzen APUs). You might get it to work with unofficial hacks, but it is not recommended. You can still run Ollama on CPU, just slower.

Can I use an AMD GPU with Ollama on macOS?

macOS with AMD GPUs (e.g., in older iMacs) is not supported by Ollama's ROCm path. Ollama uses Metal on Mac, which only works with Apple Silicon or Intel Macs with AMD GPUs? Actually, Ollama on Mac uses Metal, which supports AMD GPUs on Intel Macs, but it is not officially tested. For Apple Silicon, it works out of the box.

How do I set the HSA_OVERRIDE_GFX_VERSION?

On Linux, you can set it temporarily: export HSA_OVERRIDE_GFX_VERSION=10.3.0 before running Ollama. To make it permanent, add it to your shell profile. On Windows, set it as a system environment variable. The correct value depends on your GPU architecture: RDNA1 = 10.1.0, RDNA2 = 10.3.0, RDNA3 = 11.0.0. Check your GPU's architecture online.

Is there a performance difference between AMD and NVIDIA for Ollama?

In general, NVIDIA GPUs with CUDA tend to have better performance and stability because CUDA is more mature and Ollama is optimized for it. AMD GPUs can be competitive, but you may need to tweak settings. The gap is smaller on Linux with ROCm 5.7+.

Can I run Ollama on an AMD GPU without installing ROCm?

No. Ollama requires ROCm to use AMD GPUs on Linux. On Windows, the preview driver includes the necessary components. Without it, Ollama will fall back to CPU.

Safety and Stability Tips

When installing drivers or running heavy GPU loads, keep these in mind:

  • Always unplug your PC and ground yourself before opening the case—though for software installs, you don't need to open it.
  • Ensure your power supply can handle the GPU under load. Running a model can draw significant power.
  • Monitor temperatures with tools like rocm-smi or nvtop (for AMD). If temps exceed 85°C, consider improving airflow.
  • Overclocking or undervolting is not necessary and can cause instability or void warranty. Stick to stock settings.

If you follow the steps above, you should have Ollama running on your AMD GPU within minutes. The key is to use the right driver and verify that the GPU is being utilized. For the most up-to-date troubleshooting, check the official Ollama GitHub issues and ROCm documentation.