A powerful Bash script for optimizing system performance on Linux, specifically tuned for AMD Ryzen processors and NVIDIA GPUs. This tool provides an interactive menu to easily switch between performance modes and optimize CPU, GPU, and system settings.
- 🚀 Ultimate Performance Mode: Maximum CPU and GPU performance for gaming and heavy workloads
- ⚖️ Balanced Mode: Optimized daily use with good performance and efficiency
- 🔋 Power Saving Mode: Reduce power consumption when on battery or idle
- 📊 Real-time Monitoring: View detailed CPU, GPU, and memory status
- 💾 Persistent Settings: Option to save configurations across reboots
- 🎨 Color-coded Interface: Easy-to-read terminal output
- OS: Any Linux distribution with
cpupower(tested on Arch Linux) - CPU: AMD Ryzen processors (tested on Ryzen 5 1600, works with other CPUs)
- GPU: NVIDIA graphics card (tested on GTX 1660 SUPER)
- Privileges: Root access required
sudo pacman -S cpupowersudo pacman -S nvidia-utils nvidia-settingsFor other distributions:
- Debian/Ubuntu:
sudo apt install linux-cpupower nvidia-utils - Fedora:
sudo dnf install kernel-tools nvidia-settings
- Clone the repository:
git clone https://github.com/levent1ozgur/linux-performance-optimizer.git
cd linux-performance-optimizer- Make the script executable:
chmod +x performance-optimizer.sh- Run the script:
sudo ./performance-optimizer.shRun the script with sudo privileges:
sudo ./performance-optimizer.sh1. Ultimate Performance Mode
- Sets CPU governor to
performance - Maximizes CPU frequency and boost
- Sets GPU to maximum performance mode
- Optimizes VM dirty ratios and swappiness
- Ideal for: Gaming, video editing, compiling, benchmarking
2. Balanced Mode
- Sets CPU governor to
schedutilorondemand - Adaptive performance based on load
- GPU adaptive performance
- Default system settings
- Ideal for: Daily use, multitasking, general computing
3. Power Saving Mode
- Sets CPU governor to
powersave - Limits maximum CPU frequency
- GPU power-saving mode
- Ideal for: Battery life, light workloads, background tasks
4. Show Detailed Status
- Displays CPU information and current governor
- Shows GPU status, temperature, and utilization
- Memory usage statistics
- Current frequencies for all cores
- CPU frequency governor (performance/balanced/powersave)
- Scaling frequency limits
- Energy performance bias
- Per-core frequency management
- PowerMizer mode control
- Texture filtering quality
- OpenGL image settings
- VM dirty ratio (write caching)
- Swappiness (swap usage aggressiveness)
- File descriptor limits
- Network buffer sizes
- Always run with sudo: Root privileges are required to modify system settings
- Settings are temporary: Unless you choose to make them persistent, settings reset on reboot
- Persistent mode: Uses systemd's
cpupower.serviceto apply settings at boot - GPU optimization: Requires NVIDIA proprietary drivers and
nvidia-settings - Heat warning: Performance mode generates more heat - ensure adequate cooling
When choosing a performance mode, the script will ask:
Make these settings persistent across reboots? (y/n):
Selecting y will:
- Enable the
cpupowersystemd service - Configure
/etc/default/cpupowerwith your chosen governor - Apply settings automatically on every boot
To monitor system performance while running the optimizations:
# CPU frequencies
watch -n 1 'grep MHz /proc/cpuinfo'
# GPU monitoring
watch -n 1 nvidia-smi
# Temperature monitoring
sensorsScript says "cpupower not found"
sudo pacman -S cpupowerGPU optimizations not working
- Ensure NVIDIA proprietary drivers are installed
- Check if
nvidia-settingsis available - Verify GPU is properly detected:
nvidia-smi
Settings not persisting
- Check if
cpupower.serviceis enabled:systemctl status cpupower - Verify
/etc/default/cpupowerexists and has correct permissions
Performance mode causing system instability
- Switch to balanced mode
- Check system temperatures
- Ensure adequate power supply and cooling
This project is open source and available under the MIT License.
If you find this tool helpful, please consider giving it a star on GitHub!
Disclaimer: This script modifies system settings. While designed to be safe, use at your own risk. Always ensure you have adequate cooling and a stable power supply when using performance modes.