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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user