packaging: rc.local helper to lock AMD GPU power state (eudev bind unsupported)

Devuan's udev rejects the 'bind' trigger action, so the udev-rule path
can't reliably apply the DPM lock at boot. sysvinit's /etc/rc.local runs
race-free after amdgpu binds — this root-owned helper, called from
rc.local, sets power_dpm_force_performance_level=high on every AMD card
by PCI vendor id.
Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014S8VtAvG499SsCbeESRK7V
parent f1f33a10
#!/bin/sh
# Lock every AMD GPU to its top power/clock state so the amdgpu driver never
# switches DPM power states mid-kernel — those transitions hang Polaris/GCN
# cards under sustained Vulkan compute. Matched by PCI vendor id (0x1002), so
# it is robust to DRM card renumbering across GPU resets/reboots.
#
# Install (root):
# sudo cp amdgpu-dpm-high.sh /usr/local/sbin/ && sudo chmod 755 /usr/local/sbin/amdgpu-dpm-high.sh
# Persist at boot — add before `exit 0` in /etc/rc.local:
# /usr/local/sbin/amdgpu-dpm-high.sh || true
for c in /sys/class/drm/card*; do
[ "$(cat "$c/device/vendor" 2>/dev/null)" = "0x1002" ] && \
echo high > "$c/device/power_dpm_force_performance_level" 2>/dev/null
done
exit 0
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