Skip to content

Instantly share code, notes, and snippets.

@Knifa
Knifa / vr-power
Last active September 1, 2025 13:30
A "nice" script for setting power management controls for AMD cards on Linux, as per the recommendations on the Linux VR Adventures wiki.
#!/bin/bash
set -eou pipefail
CARD=""
for card_path in /sys/class/drm/card*/device; do
if [[ -L "$card_path/driver" ]] && [[ $(basename $(readlink "$card_path/driver")) == "amdgpu" ]]; then
CARD="$card_path"
break
fi