packaging: fix amdgpu DPM udev rule — fire on bind via RUN, not add ATTR

An ATTR{}= assignment on the add event races the amdgpu probe (the
power_dpm attribute doesn't exist yet), so it silently no-ops at boot
(observed: level stayed 'auto'). Fire on the bind action — driver bound
and sysfs attrs created — and write via RUN with %p devpath.
Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S8VtAvG499SsCbeESRK7V
parent 2b46b02d
# Lock AMD GPUs to their top power/clock state (power_dpm_force_performance_level # Lock AMD GPUs to their top power/clock state (power_dpm_force_performance_level
# = high) at device bind. Polaris/GCN cards frequently HANG under sustained # = high) so the amdgpu driver never switches DPM power states mid-kernel —
# Vulkan compute when the amdgpu driver switches DPM power states mid-kernel; # those transitions hang Polaris/GCN cards under sustained Vulkan compute.
# pinning to a fixed state avoids those transitions.
# #
# Matched by DRIVER=="amdgpu" (not card number), so it survives DRM card # Fires on the "bind" action (driver bound AND its sysfs attributes created —
# renumbering across GPU resets/reboots. Fires for every AMD GPU present. # an "add"-time ATTR{}= assignment races the probe and silently no-ops). Matched
# by DRIVER==amdgpu so it survives DRM card renumbering across GPU resets. %p is
# the PCI devpath, so /sys%p/... is that card's power_dpm node.
# #
# Install: # Install:
# sudo cp 30-amdgpu-dpm-high.rules /etc/udev/rules.d/ # sudo cp 30-amdgpu-dpm-high.rules /etc/udev/rules.d/
# sudo udevadm control --reload-rules # sudo udevadm control --reload-rules
# sudo udevadm trigger --subsystem-match=pci --attr-match=driver=amdgpu # sudo udevadm trigger --action=bind --subsystem-match=pci --attr-match=driver=amdgpu
# Verify: # Verify:
# cat /sys/class/drm/card*/device/power_dpm_force_performance_level # -> high # cat /sys/class/drm/card*/device/power_dpm_force_performance_level # -> high
ACTION=="add|change", SUBSYSTEM=="pci", DRIVER=="amdgpu", ATTR{power_dpm_force_performance_level}="high" ACTION=="add|bind", SUBSYSTEM=="pci", DRIVER=="amdgpu", RUN+="/bin/sh -c 'echo high > /sys%p/power_dpm_force_performance_level 2>/dev/null || true'"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment