This commit is contained in:
2025-12-27 14:51:58 -05:00
parent 762bfb29fa
commit c69943692b

View File

@@ -6,7 +6,6 @@ job "ai-backend" {
group "ollama-group" { group "ollama-group" {
count = 1 count = 1
# Pin to P52 Laptop (eGPU Host)
constraint { constraint {
attribute = "${meta.device}" attribute = "${meta.device}"
value = "p52-laptop" value = "p52-laptop"
@@ -22,44 +21,34 @@ job "ai-backend" {
env { env {
OLLAMA_HOST = "0.0.0.0" OLLAMA_HOST = "0.0.0.0"
OLLAMA_ORIGINS = "*" OLLAMA_ORIGINS = "*"
# 1. Force 6900XT Support
HSA_OVERRIDE_GFX_VERSION = "10.3.0"
# 2. Debugging
OLLAMA_DEBUG = "1" OLLAMA_DEBUG = "1"
# --- THE FIX: USE VULKAN INSTEAD OF ROCm ---
OLLAMA_VULKAN = "1"
# We keep this just in case Vulkan falls back to ROCm,
# but Vulkan should take priority.
HSA_OVERRIDE_GFX_VERSION = "10.3.0"
} }
config { config {
image = "docker.io/ollama/ollama:latest" image = "docker.io/ollama/ollama:latest"
ports = ["api"] ports = ["api"]
# Required to talk to hardware (This handles most security opts)
privileged = true privileged = true
# --- Explicit Device Mapping --- # --- MOUNT EVERYTHING ---
# Map the Compute interface and the Physical Card # Since Vulkan scans all GPUs to pick the best one,
devices = [ # we give it access to the whole folder.
"/dev/kfd",
"/dev/dri/card1",
"/dev/dri/renderD128"
]
# --- Volumes ---
volumes = [ volumes = [
# 1. Your Custom Storage Path
"/mnt/local-ssd/nomad/stacks/ai/ai-backend/ollama:/root/.ollama", "/mnt/local-ssd/nomad/stacks/ai/ai-backend/ollama:/root/.ollama",
"/dev/kfd:/dev/kfd",
# 2. Shared Memory Workaround (Replaces ipc_mode = "host") "/dev/dri:/dev/dri"
# This helps the AMD driver communicate efficiently
"/dev/shm:/dev/shm"
] ]
} }
service { service {
name = "ollama" name = "ollama"
port = "api" port = "api"
check { check {
type = "http" type = "http"
path = "/" path = "/"
@@ -70,7 +59,7 @@ job "ai-backend" {
resources { resources {
cpu = 2000 cpu = 2000
memory = 8192 # 8GB System RAM memory = 8192
} }
} }
} }