September 6, 2025Sep 6 Hi everyone,I’m running into an issue with my GPU power states and would like to ask for some advice.My system:CPU: Intel Core i5-13600KMainboard: ASUS TUF H770-Pro WiFiGPU: AMD Radeon RX 9070 XTOS: Unraid (latest stable)Setup:I’m using the GPU in a VM (CacheOS). I did not bind the GPU to VFIO at boot. Instead, I just assign it directly to the VM in the Unraid VM manager.Behavior:After a clean Unraid reboot, the GPU is correctly suspended (runtime_status: suspended, power_state: D3hot), and my system idles at ~30 W.The VM starts and shuts down without problems.However, once the VM is stopped, the GPU no longer returns to suspended mode. Instead, it stays active (runtime_status: active, power_state: D3) As a result, idle consumption is noticeably higher at ~50 W.Question:Is there a way to use a hook to reset or fully release the GPU after the VM stops, so that it reliably returns to the suspended (D3hot) state?Any hints or example scripts would be much appreciated.Thanks in advance!
September 6, 2025Sep 6 Author Solution Hi everyone,I have a solution. This is a modified hook from space invaders script from his yt-video (https://www.youtube.com/watch?v=0uZODoPQH9c&t)# anlegen als Hook, z.B.: # /etc/libvirt/hooks/qemu.d/ANY/release/end/amd-gpu-reset-and-suspended.sh cat <<'EOF' > /etc/libvirt/hooks/qemu.d/ANY/release/end/amd-gpu-reset-and-suspended.sh #!/bin/bash GPU_GFX="0000:03:00.0" GPU_AUD="0000:03:00.1" LOG="/var/log/libvirt/hooks-gpu-status.log" echo "disconnecting amd graphics and sound" | tee -a "$LOG" echo 1 > /sys/bus/pci/devices/$GPU_AUD/remove 2>/dev/null || true echo 1 > /sys/bus/pci/devices/$GPU_GFX/remove 2>/dev/null || true # S3 auskommentiert (nicht genutzt) # echo "entered suspended state press power button to continue" | tee -a "$LOG" # echo -n mem > /sys/power/state echo "reconnecting amd gpu and sound" | tee -a "$LOG" echo 1 > /sys/bus/pci/rescan sleep 1 # zurück an Host-Treiber binden echo $GPU_AUD > /sys/bus/pci/drivers/snd_hda_intel/bind 2>/dev/null || true echo $GPU_GFX > /sys/bus/pci/drivers/amdgpu/bind 2>/dev/null || true # Power-Management setzen [ -w /sys/bus/pci/devices/$GPU_GFX/power/control ] && echo auto > /sys/bus/pci/devices/$GPU_GFX/power/control [ -w /sys/bus/pci/devices/$GPU_GFX/d3cold_allowed ] && echo 1 > /sys/bus/pci/devices/$GPU_GFX/d3cold_allowed [ -w /sys/bus/pci/devices/$GPU_AUD/power/control ] && echo auto > /sys/bus/pci/devices/$GPU_AUD/power/control [ -w /sys/bus/pci/devices/$GPU_AUD/d3cold_allowed ] && echo 1 > /sys/bus/pci/devices/$GPU_AUD/d3cold_allowed exit 0 EOF chmod +x /etc/libvirt/hooks/qemu.d/ANY/release/end/amd-gpu-reset-and-suspended.sh
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.