feat: Add ROCm support and update Ollama configurations

- Created ansible playbooks for setting up AMD ROCm container environment.
- Added ROCm and AMD Graphics repositories in ansible tasks.
- Installed necessary ROCm packages including rocm-dkms and developer tools.
- Updated Dockerfile for Ollama to use version 0.13.4 and created a new Dockerfile for ROCm support.
- Enhanced game station scripts for better performance and added MangoHud configuration.
- Modified systemd service files to allow CPU core allocation.
- Updated playbooks for Ollama and Qwen2 to include new configurations and environment variables.
- Added Wake-on-LAN systemd service configuration.
- Updated Terraform configurations to include secret management for the web UI.
- Refactored Kubernetes deployment for open-webui to include secret handling and improved volume management.
This commit is contained in:
2025-12-25 16:37:05 +01:00
parent 4781ddbaff
commit 03d5b39a4b
31 changed files with 497 additions and 80 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
FROM docker.io/ollama/ollama:0.9.6
FROM docker.io/ollama/ollama:0.13.4
ARG UID=1000
ARG GID=1000
@@ -0,0 +1,12 @@
FROM docker.io/ollama/ollama:0.13.4-rocm
ARG UID=1000
ARG GID=1000
RUN groupadd --system --gid ${GID} worker && \
useradd --system --gid ${GID} --uid ${UID} --home /home/worker worker && \
mkdir -p /home/worker && chown worker:worker /home/worker
WORKDIR /home/worker
USER worker
ENTRYPOINT ["/bin/ollama"]
CMD ["serve"]
@@ -10,13 +10,14 @@ CONF_FILE="$HOME/.config/gamescope/gamescope.conf"
RESOLUTION=${RESOLUTION:-1920x1080}
WIDTH="${RESOLUTION%x*}"
HEIGHT="${RESOLUTION#*x}"
FRAMERATE=${FRAMERATE:-60}
export __GL_GSYNC_ALLOWED=1
export __GL_VRR_ALLOWED=1
export __GL_SHADER_DISK_CACHE=1
export __GL_SYNC_TO_VBLANK=0
export LIBVA_DRIVER_NAME=nvidia
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export LIBVA_DRIVER_NAME=nvidia
export NVD_BACKEND=direct
GAMESCOPE_BIN="$(command -v gamescope || true)"
@@ -45,6 +46,15 @@ if [[ -z $tmpdir || -z ${XDG_RUNTIME_DIR+x} ]]; then
exit 0
fi
# Setup MangoHud config file in temp directory
export MANGOHUD_CONFIGFILE="${tmpdir:+$tmpdir/mangohud.config}"
# Initially write no_display to our config file
# so we don't get mangoapp showing up before Steam initializes
# on OOBE and stuff.
mkdir -p "$(dirname "$MANGOHUD_CONFIGFILE")"
echo "no_display" > "$MANGOHUD_CONFIGFILE"
# Chromium (and therefore Steam) ignore XCursor and use on the GTK config
kwriteconfig6 --file gtk-3.0/settings.ini --group Settings --key gtk-cursor-theme-name steam
@@ -21,7 +21,7 @@ export VKD3D_SWAPCHAIN_LATENCY_FRAMES=3
# Let's try this across the board to see if it breaks anything
# Helps performance in HZD, Cyberpunk, at least
# Expose 8 physical cores, instead of 4c/8t
export WINE_CPU_TOPOLOGY=8:0,1,2,3,4,5,6,7
# export WINE_CPU_TOPOLOGY=8:0,1,2,3,4,5,6,7
# To expose vram info from radv's patch we're including
export WINEDLLOVERRIDES=dxgi=n
@@ -20,7 +20,7 @@ if [[ $# -eq 1 ]]; then
exit 0
;;
"stable" | "rc" | "beta" | "bc" | "preview" | "pc" | "main" | "staging")
log "Branch '$1' requested"
log "Branch '$1' requested"
exit 0
;;
esac
@@ -12,4 +12,5 @@ Description=User Core Session Slice
Documentation=man:systemd.special(7)
[Slice]
CPUWeight=100
CPUWeight=100
# AllowedCPUs={{ general_cores }}
@@ -12,4 +12,5 @@ Description=User Core Session Slice
Documentation=man:systemd.special(7)
[Slice]
CPUWeight=100
CPUWeight=100
# AllowedCPUs={{ general_cores }}
@@ -6,3 +6,4 @@ After=graphical-session.target
ExecStart=/usr/local/bin/steamos
EnvironmentFile=%t/steamos-environment
Restart=on-failure
# AllowedCPUs={{ general_cores }}
@@ -12,4 +12,5 @@ Description=User Core Session Slice
Documentation=man:systemd.special(7)
[Slice]
CPUWeight=100
CPUWeight=100
# AllowedCPUs={{ sunshine_cores }}
+21 -1
View File
@@ -22,7 +22,7 @@ if ! command -v nvidia-smi &> /dev/null; then
else
# Check 3: Is GPU idle?
GPU_UTIL=$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | head -n 1)
GPU_THRESHOLD=10
GPU_THRESHOLD=0
if (( GPU_UTIL > GPU_THRESHOLD )); then
echo "GPU is busy (utilization=${GPU_UTIL}%). Skipping suspend."
@@ -37,5 +37,25 @@ else
fi
fi
if | command -v amd-smi &> /dev/null; then
# Check 5: Is AMD GPU idle?
AMD_GPU_UTIL=$(amd-smi monitor --csv | head -n 2 | tail -n 1 | cut -d ',' -f 8)
AMD_GPU_THRESHOLD=0
if (( AMD_GPU_UTIL > AMD_GPU_THRESHOLD )); then
echo "AMD GPU is busy (utilization=${AMD_GPU_UTIL}%). Skipping suspend."
exit 0
fi
if amd-smi process --csv | head -n 2 | tail -n 1 | grep -q "No running processes detected"; then
echo "No processes running on AMD GPU."
else
echo "Processes are running on AMD GPU. Skipping suspend."
exit 0
fi
else
echo "amd-smi not found, skipping AMD GPU check"
fi
echo "System idle. Suspending..."
shutdown now