Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
set_voltage() {
echo "before for card #${1}:"
cat /sys/class/drm/card$1/device/pp_od_clk_voltage
echo ""
echo "m 2 1985 900" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "s 7 1100 900" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "c" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "after for card #${1}:"
cat /sys/class/drm/card$1/device/pp_od_clk_voltage
echo -e "------------------------------------\n"
}
set_voltage "1"
set_voltage "2"
set_voltage "3"
set_voltage "4"
set_rig_values() {
echo "[card #${1}]: set performance level to: manual"
echo "manual" > /sys/class/drm/card$1/device/power_dpm_force_performance_level
echo "[card #${1}]: set profile to compute mode."
echo 4 > /sys/class/drm/card$1/device/pp_power_profile_mode
echo "[card #${1}]: set voltages..."
echo "s 3 1100 825" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "s 4 1100 825" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "s 5 1100 825" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "s 6 1100 825" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "s 7 1100 825" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "m 2 2015 850" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "c" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "[card #${1}]: voltage table:"
cat /sys/class/drm/card$1/device/pp_od_clk_voltage
echo -e "------------------------------------\n"
}
set_rig_values "1"
set_rig_values "2"
set_rig_values "3"
set_rig_values "4"
#!/bin/bash
echo -e "reset everything back... \n"
reset_voltages() {
echo "before for card #${1}:"
cat /sys/class/drm/card$1/device/pp_od_clk_voltage
echo ""
echo "r" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "after for card #${1}:"
cat /sys/class/drm/card$1/device/pp_od_clk_voltage
echo -e "-------------------------------\n"
}
reset_voltages "1"
reset_voltages "2"
reset_voltages "3"
reset_voltages "4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment