Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

AMD GPU not returning to suspended (D3hot) state after VM shutdown

Featured Replies

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-13600K

  • Mainboard: ASUS TUF H770-Pro WiFi

  • GPU: AMD Radeon RX 9070 XT

  • OS: 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!

Solved by iceball09

  • 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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.