Ross Masters

Running ollama & open-webui on Nvidia AGX Orin

It took me about a day to find this, hopefully it comes up in your Google search.

I found that out of the box, ollama could not discover the GPU in the Nvidia AGX Orin. Through various tests I found that:

I eventually stumbled on dusty-nv/jetson-containers. This repo contains a whole host of container images for various use-cases, that work on Jetson SoCs.

I believe this all boils down to Tegra (the SoC name) having specific CUDA drivers, and that pytorch comes bundled with a more generic library set. When you dig through the images, you can find the ollama image in jetson-containers depends on the cuda imag, which pulls drivers depending on the Jetpack version.

To wrap up, you can run ollama and open-webui using a compose config like this:

services:
  ollama:
    runtime: nvidia
    image: dustynv/ollama:r36.2.0
    command: ollama serve
    environment:
      OLLAMA_HOST: 0.0.0.0
    volumes:
      - ~/.ollama:/root/.ollama

  openwebui:
    image: ghcr.io/open-webui/open-webui:v0.1.124
    volumes:
      - openwebui:/app/backend/data
    depends_on:
      - ollama
    ports:
      - 0.0.0.0:8080:8080
    environment:
      OLLAMA_BASE_URL: http://ollama:11434
      WEBUI_SECRET_KEY: secret

volumes:
  openwebui: {}