User Tools

Site Tools


linux:notes:max_performance_scripts

Table of Contents

Game Performance

AMD

mkdir -p ~/'.local/scripts' && nano ~/'.local/scripts/Game.sh' && chmod +x ~/'.local/scripts/Game.sh'
#!/bin/sh

sync

##############
# CPU Tuning #
##############

# Performance Governor
# 16-core CPU

echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu8/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu9/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu10/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu11/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu12/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu13/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu14/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu15/cpufreq/scaling_governor'

##############
# GPU Tuning #
##############

# Reset OC
echo 'r' | sudo tee '/sys/class/drm/card'*'/device/pp_od_clk_voltage'

# Performance Hack
# drm/amd#1500
echo 'manual' | sudo tee '/sys/class/drm/card'*'/device/power_dpm_force_performance_level'
echo '1' | sudo tee '/sys/class/drm/card'*'/device/pp_power_profile_mode'

# Max Power Limit
echo "$(cat '/sys/class/drm/card'*'/device/hwmon/hwmon'*'/power1_cap_max')" | sudo tee '/sys/class/drm/card'*'/device/hwmon/hwmon'*'/power1_cap' > '/dev/null'

# 2700MHz Core
echo 's 1 2700' | sudo tee '/sys/class/drm/card'*'/device/pp_od_clk_voltage'

# 2200MHz Memory
echo 'm 1 1100' | sudo tee '/sys/class/drm/card'*'/device/pp_od_clk_voltage'

# OC Confirm
echo 'c' | sudo tee '/sys/class/drm/card'*'/device/pp_od_clk_voltage'

############
# Finalize #
############

sync
echo 'Game tune complete!'
sleep '5'

# End

GNOME

  • F6
gnome-terminal -- sh -c ~/'.local/scripts/Game.sh'

NVIDIA

  • AMD Ryzen 7 2700X
  • RTX 3060
  • :!: NVIDIA requires running Xorg as Root for overclocking, see NVIDIA notes
mkdir -p ~/'.local/scripts' && nano ~/'.local/scripts/Game.sh' && chmod +x ~/'.local/scripts/Game.sh'
#!/bin/sh

sync

# CPU Tuning
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu8/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu9/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu10/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu11/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu12/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu13/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu14/cpufreq/scaling_governor'
echo 'performance' | sudo tee '/sys/devices/system/cpu/cpu15/cpufreq/scaling_governor'

# GPU Tuning
sudo nvidia-smi --reset-gpu-clocks
nvidia-settings --assign='GPUPowerMizerMode'='1'
nvidia-settings --assign='GPUGraphicsClockOffsetAllPerformanceLevels'='125'
nvidia-settings --assign='GPUMemoryTransferRateOffsetAllPerformanceLevels'='1100'
sudo nvidia-smi --power-limit='190'

sync
echo 'Game tune complete!'
sleep '5'

# End

GNOME

  • F6
gnome-terminal -- sh -c ~/'.local/scripts/Game.sh'
/var/www/wiki/data/pages/linux/notes/max_performance_scripts.txt · Last modified: by 127.0.0.1