yoohoo
This commit is contained in:
134
examples/demo-config.sh
Normal file
134
examples/demo-config.sh
Normal file
@@ -0,0 +1,134 @@
|
||||
#!/bin/bash
|
||||
|
||||
# WiseTLP Demo Configuration Script
|
||||
# This script demonstrates WiseTLP configuration with Groq API
|
||||
|
||||
set -e
|
||||
|
||||
echo "WiseTLP Demo Configuration"
|
||||
echo "=========================="
|
||||
echo ""
|
||||
|
||||
# Check if running as root
|
||||
if [[ $EUID -eq 0 ]]; then
|
||||
echo "This demo should not be run as root initially."
|
||||
echo "WiseTLP will request elevation when needed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if autotlp binary exists
|
||||
if [[ ! -f "./autotlp" ]]; then
|
||||
echo "Building WiseTLP..."
|
||||
go build -o autotlp ./cmd/autotlp
|
||||
fi
|
||||
|
||||
echo "Demo Configuration Settings:"
|
||||
echo "- AI Provider: Groq"
|
||||
echo "- API Endpoint: https://api.groq.com/openai/v1/chat/completions"
|
||||
echo "- Model: openai/gpt-oss-20b"
|
||||
echo "- Power Profile: Balanced"
|
||||
echo "- Use Case: Development"
|
||||
echo ""
|
||||
|
||||
# Create a demo configuration file
|
||||
cat > demo_responses.txt << 'EOF'
|
||||
1
|
||||
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
|
||||
a
|
||||
b
|
||||
a
|
||||
a
|
||||
h
|
||||
y
|
||||
y
|
||||
EOF
|
||||
|
||||
echo "Starting WiseTLP demo with pre-configured responses..."
|
||||
echo "Note: This demo uses automated responses for demonstration purposes."
|
||||
echo ""
|
||||
|
||||
# Run WiseTLP with demo responses
|
||||
# Note: In a real scenario, this would be interactive
|
||||
echo "In a real scenario, WiseTLP would:"
|
||||
echo "1. Detect your system specifications"
|
||||
echo "2. Check TLP installation status"
|
||||
echo "3. Configure AI service (Groq in this case)"
|
||||
echo "4. Gather your power management preferences"
|
||||
echo "5. Generate optimized TLP configuration using AI"
|
||||
echo "6. Present the configuration for your approval"
|
||||
echo "7. Apply the configuration to your system"
|
||||
echo ""
|
||||
|
||||
echo "Example system detection output:"
|
||||
echo "--------------------------------"
|
||||
echo "Distribution: $(lsb_release -si 2>/dev/null || echo "Unknown")"
|
||||
echo "Architecture: $(uname -m)"
|
||||
echo "Kernel: $(uname -r)"
|
||||
echo "CPU: $(grep -m1 'model name' /proc/cpuinfo 2>/dev/null | cut -d: -f2 | xargs || echo "Unknown")"
|
||||
echo "Memory: $(free -h | grep '^Mem:' | awk '{print $2}' || echo "Unknown")"
|
||||
|
||||
if [[ -d "/sys/class/power_supply/BAT0" ]]; then
|
||||
echo "Battery: Present"
|
||||
else
|
||||
echo "Battery: Not detected (desktop system)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Example TLP configuration that would be generated:"
|
||||
echo "------------------------------------------------"
|
||||
cat << 'EOF'
|
||||
# WiseTLP Generated Configuration
|
||||
# Generated for Development workstation
|
||||
# Power Profile: Balanced, Use Case: Development
|
||||
|
||||
TLP_ENABLE=1
|
||||
TLP_WARN_LEVEL=3
|
||||
|
||||
# CPU scaling for development workloads
|
||||
CPU_SCALING_GOVERNOR_ON_AC=ondemand
|
||||
CPU_SCALING_GOVERNOR_ON_BAT=powersave
|
||||
|
||||
# Platform profiles
|
||||
PLATFORM_PROFILE_ON_AC=balanced
|
||||
PLATFORM_PROFILE_ON_BAT=low-power
|
||||
|
||||
# Disk management for development I/O
|
||||
DISK_APM_LEVEL_ON_AC=254
|
||||
DISK_APM_LEVEL_ON_BAT=192
|
||||
|
||||
# Network optimization
|
||||
WIFI_PWR_ON_AC=off
|
||||
WIFI_PWR_ON_BAT=on
|
||||
|
||||
# USB device management
|
||||
USB_AUTOSUSPEND=1
|
||||
USB_EXCLUDE_AUDIO=1
|
||||
|
||||
# Audio power management
|
||||
SOUND_POWER_SAVE_ON_AC=1
|
||||
SOUND_POWER_SAVE_ON_BAT=10
|
||||
EOF
|
||||
|
||||
echo ""
|
||||
echo "To run the actual WiseTLP application:"
|
||||
echo " ./autotlp"
|
||||
echo ""
|
||||
echo "For testing without system changes:"
|
||||
echo " ./autotlp --dry-run"
|
||||
echo ""
|
||||
echo "Demo completed! The actual WiseTLP provides:"
|
||||
echo "- Interactive system detection"
|
||||
echo "- AI-powered configuration generation"
|
||||
echo "- Secure API key management"
|
||||
echo "- Safe configuration validation"
|
||||
echo "- Automatic TLP installation and setup"
|
||||
|
||||
# Cleanup
|
||||
rm -f demo_responses.txt
|
||||
|
||||
echo ""
|
||||
echo "Visit the examples/ directory for more configuration samples:"
|
||||
echo "- examples/gaming-laptop.md"
|
||||
echo "- examples/development-workstation.md"
|
||||
echo ""
|
||||
echo "For full documentation, see README.md and docs/API.md"
|
382
examples/development-workstation.md
Normal file
382
examples/development-workstation.md
Normal file
@@ -0,0 +1,382 @@
|
||||
# Development Workstation Configuration Example
|
||||
|
||||
This example demonstrates WiseTLP configuration for a development workstation optimized for coding, compiling, and development workflows while maintaining energy efficiency.
|
||||
|
||||
## System Specifications
|
||||
|
||||
- **System**: Desktop workstation / High-end laptop
|
||||
- **CPU**: AMD Ryzen 9 5900X (12 cores, 24 threads)
|
||||
- **RAM**: 64GB DDR4-3200
|
||||
- **Storage**: 2TB NVMe SSD (primary) + 4TB HDD (storage)
|
||||
- **GPU**: NVIDIA RTX 3060 (for CUDA development)
|
||||
- **Power**: 650W PSU / 100Wh battery (if laptop)
|
||||
- **Display**: Dual 27" 4K monitors
|
||||
|
||||
## User Preferences
|
||||
|
||||
```
|
||||
Power Profile: Balanced
|
||||
Use Case: Development
|
||||
Battery Priority: Runtime (if applicable)
|
||||
Performance Mode: Adaptive
|
||||
Special Requirements:
|
||||
- Fast system wake/sleep
|
||||
- Minimize fan noise during coding
|
||||
- Optimize for external displays
|
||||
- Maximum performance during compilation
|
||||
```
|
||||
|
||||
## Generated TLP Configuration
|
||||
|
||||
### General Settings
|
||||
```bash
|
||||
TLP_ENABLE=1
|
||||
TLP_WARN_LEVEL=3
|
||||
TLP_DEBUG=0
|
||||
```
|
||||
|
||||
### CPU Management
|
||||
```bash
|
||||
# Adaptive CPU scaling for development workloads
|
||||
CPU_SCALING_GOVERNOR_ON_AC=ondemand
|
||||
CPU_SCALING_GOVERNOR_ON_BAT=powersave
|
||||
|
||||
# Allow full frequency range for compilation
|
||||
CPU_SCALING_MIN_FREQ_ON_AC=2200000
|
||||
CPU_SCALING_MAX_FREQ_ON_AC=4950000
|
||||
|
||||
# Conservative battery frequencies
|
||||
CPU_SCALING_MIN_FREQ_ON_BAT=2200000
|
||||
CPU_SCALING_MAX_FREQ_ON_BAT=3600000
|
||||
|
||||
# Balanced platform profiles
|
||||
PLATFORM_PROFILE_ON_AC=balanced
|
||||
PLATFORM_PROFILE_ON_BAT=low-power
|
||||
|
||||
# Responsive energy performance
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC=balance_performance
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT=balance_power
|
||||
|
||||
# Turbo boost for compilation workloads
|
||||
CPU_BOOST_ON_AC=1
|
||||
CPU_BOOST_ON_BAT=0
|
||||
|
||||
# Hardware P-states
|
||||
CPU_HWP_DYN_BOOST_ON_AC=1
|
||||
CPU_HWP_DYN_BOOST_ON_BAT=0
|
||||
```
|
||||
|
||||
**Rationale**: Development work requires responsive performance for IDE operations and maximum performance for compilation. Ondemand governor provides good balance between responsiveness and power efficiency.
|
||||
|
||||
### Memory and Swap Management
|
||||
```bash
|
||||
# Optimize for large development environments
|
||||
VM_DIRTY_WRITEBACK_CENTISECS_ON_AC=500
|
||||
VM_DIRTY_WRITEBACK_CENTISECS_ON_BAT=1500
|
||||
|
||||
# Laptop mode for battery
|
||||
VM_LAPTOP_MODE_ON_AC=0
|
||||
VM_LAPTOP_MODE_ON_BAT=5
|
||||
```
|
||||
|
||||
**Rationale**: Development environments often use significant memory. Balanced writeback settings ensure good I/O performance without excessive disk activity.
|
||||
|
||||
### Storage Management
|
||||
```bash
|
||||
# High performance for development tools and compilation
|
||||
DISK_APM_LEVEL_ON_AC=254
|
||||
DISK_APM_LEVEL_ON_BAT=192
|
||||
|
||||
# No spindown for SSDs, moderate for HDDs
|
||||
DISK_SPINDOWN_TIMEOUT_ON_AC=0
|
||||
DISK_SPINDOWN_TIMEOUT_ON_BAT=240
|
||||
|
||||
# Optimize SATA link power
|
||||
SATA_LINKPWR_ON_AC=max_performance
|
||||
SATA_LINKPWR_ON_BAT=medium_power
|
||||
|
||||
# NVMe optimization for development
|
||||
AHCI_RUNTIME_PM_ON_AC=on
|
||||
AHCI_RUNTIME_PM_ON_BAT=auto
|
||||
|
||||
# Disk device IDs for different handling
|
||||
DISK_DEVICES="nvme0n1 sda"
|
||||
DISK_APM_CLASS_DENYLIST="usb ieee1394"
|
||||
```
|
||||
|
||||
**Rationale**: Development requires fast I/O for IDE operations, file indexing, and compilation. SSD performance is prioritized while HDD is allowed moderate power saving.
|
||||
|
||||
### Network Configuration
|
||||
```bash
|
||||
# Reliable networking for remote development
|
||||
WIFI_PWR_ON_AC=off
|
||||
WIFI_PWR_ON_BAT=on
|
||||
|
||||
# Ethernet optimization
|
||||
WOL_DISABLE=N
|
||||
|
||||
# Network device power management
|
||||
RUNTIME_PM_DRIVER_DENYLIST="mei_me nouveau nvidia e1000e"
|
||||
```
|
||||
|
||||
**Rationale**: Development often requires reliable network connectivity for git operations, remote debugging, and API calls. Power saving on battery preserves runtime.
|
||||
|
||||
### GPU and Graphics
|
||||
```bash
|
||||
# NVIDIA GPU for CUDA development
|
||||
RUNTIME_PM_ON_AC=auto
|
||||
RUNTIME_PM_ON_BAT=auto
|
||||
|
||||
# Intel integrated graphics
|
||||
INTEL_GPU_MIN_FREQ_ON_AC=300
|
||||
INTEL_GPU_MAX_FREQ_ON_AC=1200
|
||||
INTEL_GPU_MIN_FREQ_ON_BAT=300
|
||||
INTEL_GPU_MAX_FREQ_ON_BAT=600
|
||||
|
||||
# External display optimization
|
||||
RUNTIME_PM_DRIVER_DENYLIST="nvidia nouveau"
|
||||
```
|
||||
|
||||
**Rationale**: CUDA development requires NVIDIA GPU availability. External displays need reliable graphics performance. Power management is balanced for development needs.
|
||||
|
||||
### USB and Peripheral Management
|
||||
```bash
|
||||
# Development peripherals optimization
|
||||
USB_AUTOSUSPEND=1
|
||||
USB_EXCLUDE_AUDIO=1
|
||||
USB_EXCLUDE_BTUSB=1
|
||||
USB_EXCLUDE_PHONE=1
|
||||
|
||||
# Exclude development devices
|
||||
USB_ALLOWLIST="0403:6001 10c4:ea60" # FTDI and CP210x USB-to-serial
|
||||
|
||||
# Runtime PM exclusions
|
||||
USB_EXCLUDE_WWAN=1
|
||||
USB_EXCLUDE_PRINTER=1
|
||||
|
||||
# Autosuspend delays for development tools
|
||||
USB_AUTOSUSPEND_DELAY=2
|
||||
```
|
||||
|
||||
**Rationale**: Development often involves USB devices like programmers, debuggers, and serial adapters. These need to remain active while other devices can power save.
|
||||
|
||||
### Audio and Multimedia
|
||||
```bash
|
||||
# Audio for development (video calls, notifications)
|
||||
SOUND_POWER_SAVE_ON_AC=1
|
||||
SOUND_POWER_SAVE_ON_BAT=10
|
||||
SOUND_POWER_SAVE_CONTROLLER=Y
|
||||
|
||||
# Timeout for development environment
|
||||
SOUND_POWER_SAVE_TIMEOUT=10
|
||||
```
|
||||
|
||||
**Rationale**: Audio power saving with reasonable timeout for development notifications and video calls without impacting quality.
|
||||
|
||||
### Thermal and Fan Management
|
||||
```bash
|
||||
# Quiet operation for coding sessions
|
||||
TEMP_LIMITS_ON_AC="75/85"
|
||||
TEMP_LIMITS_ON_BAT="70/80"
|
||||
|
||||
# Fan speed control for quiet development
|
||||
FAN_SPEED_ON_AC=auto
|
||||
FAN_SPEED_ON_BAT=auto
|
||||
```
|
||||
|
||||
**Rationale**: Lower thermal limits promote quieter fan operation during coding. Higher limits still allow performance during compilation.
|
||||
|
||||
### System Sleep and Power
|
||||
```bash
|
||||
# Fast wake for development workflow
|
||||
RESTORE_DEVICE_STATE_ON_STARTUP=1
|
||||
|
||||
# Devices to keep configured
|
||||
DEVICES_TO_DISABLE_ON_STARTUP=""
|
||||
|
||||
# Runtime PM for development
|
||||
RUNTIME_PM_ALL=1
|
||||
```
|
||||
|
||||
**Rationale**: Development workflow benefits from fast system wake/sleep cycles and maintaining device states for immediate productivity.
|
||||
|
||||
## Development-Specific Optimizations
|
||||
|
||||
### IDE and Editor Performance
|
||||
```bash
|
||||
# Filesystem optimizations for large codebases
|
||||
VM_DIRTY_RATIO=15
|
||||
VM_DIRTY_BACKGROUND_RATIO=5
|
||||
|
||||
# I/O scheduler optimization
|
||||
DISK_IOSCHED="mq-deadline"
|
||||
```
|
||||
|
||||
### Compilation Workloads
|
||||
```bash
|
||||
# Temporary CPU boost for compilation
|
||||
CPU_SCALING_GOVERNOR_ON_AC=performance # During make/ninja
|
||||
CPU_SCALING_GOVERNOR_ON_AC=ondemand # Return to balanced
|
||||
```
|
||||
|
||||
### Container and Virtualization
|
||||
```bash
|
||||
# Docker/VM optimization
|
||||
VM_SWAPPINESS=10
|
||||
VM_VFS_CACHE_PRESSURE=50
|
||||
```
|
||||
|
||||
## Performance Characteristics
|
||||
|
||||
### Development Tasks Performance
|
||||
- **IDE Startup**: Fast application launch with responsive UI
|
||||
- **Code Indexing**: Efficient background processing
|
||||
- **File Operations**: Quick file system operations for large projects
|
||||
- **Git Operations**: Responsive version control operations
|
||||
- **Compilation**: Maximum performance when needed
|
||||
|
||||
### Power Efficiency
|
||||
- **Idle Power**: 15-25W desktop, 8-12W laptop
|
||||
- **Coding Power**: 45-65W desktop, 15-25W laptop
|
||||
- **Compilation Power**: 150-200W desktop, 45-65W laptop
|
||||
- **Battery Runtime**: 8-12 hours coding, 3-5 hours compilation
|
||||
|
||||
## Workflow Optimization
|
||||
|
||||
### Morning Startup Routine
|
||||
```bash
|
||||
# System wake optimization
|
||||
RESTORE_THINKPAD_BATTERY_THRESHOLDS=1
|
||||
RESTORE_DEVICE_STATE_ON_STARTUP=1
|
||||
```
|
||||
|
||||
### Compilation Sessions
|
||||
```bash
|
||||
# Temporary performance mode
|
||||
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
|
||||
# Compile project
|
||||
make -j$(nproc)
|
||||
# Return to balanced
|
||||
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
|
||||
```
|
||||
|
||||
### End-of-day Shutdown
|
||||
```bash
|
||||
# Clean shutdown with state preservation
|
||||
DEVICES_TO_DISABLE_ON_SHUTDOWN=""
|
||||
USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=0
|
||||
```
|
||||
|
||||
## Tool-Specific Configurations
|
||||
|
||||
### Docker Development
|
||||
```bash
|
||||
# Container runtime optimization
|
||||
RUNTIME_PM_DRIVER_DENYLIST="docker0 br-*"
|
||||
USB_EXCLUDE_PRINTER=1 # Prevent conflicts
|
||||
```
|
||||
|
||||
### Remote Development
|
||||
```bash
|
||||
# SSH and network optimization
|
||||
WIFI_PWR_ON_AC=off
|
||||
WIFI_PWR_ON_BAT=on
|
||||
WOL_DISABLE=N
|
||||
```
|
||||
|
||||
### Database Development
|
||||
```bash
|
||||
# I/O optimization for databases
|
||||
DISK_APM_LEVEL_ON_AC=254
|
||||
SATA_LINKPWR_ON_AC=max_performance
|
||||
```
|
||||
|
||||
### Web Development
|
||||
```bash
|
||||
# Browser testing optimization
|
||||
RUNTIME_PM_DRIVER_DENYLIST="nvidia nouveau" # For GPU acceleration
|
||||
SOUND_POWER_SAVE_ON_AC=0 # For media testing
|
||||
```
|
||||
|
||||
## Monitoring and Optimization
|
||||
|
||||
### Development Metrics
|
||||
```bash
|
||||
# Monitor compilation performance
|
||||
time make -j$(nproc)
|
||||
|
||||
# I/O performance for large projects
|
||||
iotop -o
|
||||
|
||||
# Memory usage for IDEs
|
||||
htop
|
||||
|
||||
# Network performance for remote work
|
||||
iftop
|
||||
```
|
||||
|
||||
### Power Monitoring
|
||||
```bash
|
||||
# Real-time power consumption
|
||||
sudo powertop --time=30
|
||||
|
||||
# Battery optimization
|
||||
sudo tlp-stat -b
|
||||
|
||||
# Thermal monitoring during compilation
|
||||
watch -n 1 sensors
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Performance Issues
|
||||
- **Slow compilation**: Check CPU governor and thermal throttling
|
||||
- **IDE lag**: Monitor memory usage and I/O wait
|
||||
- **Network issues**: Verify WiFi power management settings
|
||||
|
||||
### Power Issues
|
||||
- **High idle power**: Check for runaway processes and USB devices
|
||||
- **Poor battery life**: Review active background services
|
||||
- **Thermal throttling**: Monitor temperatures during heavy workloads
|
||||
|
||||
### Development Environment Issues
|
||||
- **USB device issues**: Check autosuspend settings for development tools
|
||||
- **Display problems**: Verify graphics power management
|
||||
- **Audio problems**: Check power save timeouts
|
||||
|
||||
## Custom Scripts
|
||||
|
||||
### Development Mode Toggle
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# dev-mode.sh - Toggle between development and power-save modes
|
||||
|
||||
if [ "$1" == "performance" ]; then
|
||||
echo "Enabling development performance mode..."
|
||||
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
echo 0 | sudo tee /sys/class/drm/card0/device/power_dpm_force_performance_level
|
||||
elif [ "$1" == "balanced" ]; then
|
||||
echo "Enabling balanced development mode..."
|
||||
echo ondemand | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
echo auto | sudo tee /sys/class/drm/card0/device/power_dpm_force_performance_level
|
||||
fi
|
||||
```
|
||||
|
||||
### Compilation Optimizer
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# compile-optimized.sh - Optimize system for compilation
|
||||
|
||||
echo "Optimizing for compilation..."
|
||||
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
echo 254 | sudo tee /sys/class/scsi_host/host*/link_power_management_policy
|
||||
|
||||
# Run compilation
|
||||
"$@"
|
||||
|
||||
echo "Returning to balanced mode..."
|
||||
echo ondemand | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
echo med_power_with_dipm | sudo tee /sys/class/scsi_host/host*/link_power_management_policy
|
||||
```
|
||||
|
||||
This configuration provides optimal development performance while maintaining good power efficiency and system responsiveness for professional development workflows.
|
272
examples/gaming-laptop.md
Normal file
272
examples/gaming-laptop.md
Normal file
@@ -0,0 +1,272 @@
|
||||
# Gaming Laptop Configuration Example
|
||||
|
||||
This example demonstrates WiseTLP configuration for a gaming laptop optimized for performance while maintaining reasonable battery life during non-gaming use.
|
||||
|
||||
## System Specifications
|
||||
|
||||
- **Laptop**: Gaming laptop with dedicated GPU
|
||||
- **CPU**: Intel Core i7-12700H (14 cores)
|
||||
- **RAM**: 32GB DDR4
|
||||
- **Storage**: 1TB NVMe SSD
|
||||
- **GPU**: NVIDIA RTX 3070 Mobile
|
||||
- **Battery**: 90Wh Li-ion
|
||||
- **Display**: 15.6" 144Hz
|
||||
|
||||
## User Preferences
|
||||
|
||||
```
|
||||
Power Profile: Performance
|
||||
Use Case: Gaming
|
||||
Battery Priority: Balanced
|
||||
Performance Mode: Maximum
|
||||
Special Requirements:
|
||||
- Gaming performance priority
|
||||
- Prevent thermal throttling
|
||||
- Fast system wake/sleep
|
||||
```
|
||||
|
||||
## Generated TLP Configuration
|
||||
|
||||
### General Settings
|
||||
```bash
|
||||
TLP_ENABLE=1
|
||||
TLP_WARN_LEVEL=3
|
||||
TLP_DEBUG=0
|
||||
```
|
||||
|
||||
### CPU Management
|
||||
```bash
|
||||
# Performance-oriented CPU scaling
|
||||
CPU_SCALING_GOVERNOR_ON_AC=performance
|
||||
CPU_SCALING_GOVERNOR_ON_BAT=ondemand
|
||||
|
||||
# Aggressive frequency scaling on AC
|
||||
CPU_SCALING_MIN_FREQ_ON_AC=800000
|
||||
CPU_SCALING_MAX_FREQ_ON_AC=4700000
|
||||
|
||||
# Conservative on battery to preserve power
|
||||
CPU_SCALING_MIN_FREQ_ON_BAT=800000
|
||||
CPU_SCALING_MAX_FREQ_ON_BAT=3200000
|
||||
|
||||
# Platform profiles for gaming performance
|
||||
PLATFORM_PROFILE_ON_AC=performance
|
||||
PLATFORM_PROFILE_ON_BAT=balanced
|
||||
|
||||
# CPU energy performance preference
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC=performance
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT=balance_performance
|
||||
|
||||
# Turbo boost settings
|
||||
CPU_BOOST_ON_AC=1
|
||||
CPU_BOOST_ON_BAT=1
|
||||
|
||||
# HWP (Hardware P-states) settings
|
||||
CPU_HWP_DYN_BOOST_ON_AC=1
|
||||
CPU_HWP_DYN_BOOST_ON_BAT=0
|
||||
```
|
||||
|
||||
**Rationale**: Gaming requires maximum CPU performance on AC power. On battery, we use ondemand governor to balance performance with battery life while still allowing turbo boost for responsiveness.
|
||||
|
||||
### GPU Power Management
|
||||
```bash
|
||||
# NVIDIA GPU settings
|
||||
RUNTIME_PM_ON_AC=auto
|
||||
RUNTIME_PM_ON_BAT=auto
|
||||
|
||||
# Radeon DPM (if applicable)
|
||||
RADEON_DPM_STATE_ON_AC=performance
|
||||
RADEON_DPM_STATE_ON_BAT=balanced
|
||||
|
||||
# Intel GPU settings
|
||||
INTEL_GPU_MIN_FREQ_ON_AC=300
|
||||
INTEL_GPU_MAX_FREQ_ON_AC=1300
|
||||
INTEL_GPU_MIN_FREQ_ON_BAT=300
|
||||
INTEL_GPU_MAX_FREQ_ON_BAT=800
|
||||
```
|
||||
|
||||
**Rationale**: Dedicated GPU performance is prioritized on AC power for gaming. Battery mode reduces GPU frequency to conserve power.
|
||||
|
||||
### Disk Management
|
||||
```bash
|
||||
# Aggressive disk performance on AC
|
||||
DISK_APM_LEVEL_ON_AC=254
|
||||
DISK_APM_LEVEL_ON_BAT=128
|
||||
|
||||
# No spindown timeout for SSD
|
||||
DISK_SPINDOWN_TIMEOUT_ON_AC=0
|
||||
DISK_SPINDOWN_TIMEOUT_ON_BAT=0
|
||||
|
||||
# SATA link power management
|
||||
SATA_LINKPWR_ON_AC=max_performance
|
||||
SATA_LINKPWR_ON_BAT=med_power_with_dipm
|
||||
|
||||
# NVMe power management
|
||||
AHCI_RUNTIME_PM_ON_AC=on
|
||||
AHCI_RUNTIME_PM_ON_BAT=auto
|
||||
```
|
||||
|
||||
**Rationale**: Fast game loading requires maximum disk performance on AC. SSD doesn't need spindown timeout. Battery mode uses moderate power saving.
|
||||
|
||||
### Network Management
|
||||
```bash
|
||||
# WiFi power management
|
||||
WIFI_PWR_ON_AC=off
|
||||
WIFI_PWR_ON_BAT=on
|
||||
|
||||
# Ethernet wake-on-LAN
|
||||
WOL_DISABLE=Y
|
||||
|
||||
# Network device power management
|
||||
RUNTIME_PM_DRIVER_DENYLIST="mei_me nouveau nvidia"
|
||||
```
|
||||
|
||||
**Rationale**: Gaming requires reliable, low-latency network connectivity. WiFi power saving is disabled on AC but enabled on battery to conserve power.
|
||||
|
||||
### USB and Peripheral Management
|
||||
```bash
|
||||
# USB autosuspend for power saving
|
||||
USB_AUTOSUSPEND=1
|
||||
USB_EXCLUDE_AUDIO=1
|
||||
USB_EXCLUDE_BTUSB=1
|
||||
USB_EXCLUDE_PHONE=1
|
||||
|
||||
# Exclude gaming peripherals from autosuspend
|
||||
USB_ALLOWLIST="046d:c52b 1532:0037" # Gaming mouse and keyboard
|
||||
|
||||
# Runtime PM for USB devices
|
||||
USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1
|
||||
```
|
||||
|
||||
**Rationale**: Gaming peripherals need to remain active for immediate response. Audio and Bluetooth devices are excluded from autosuspend to prevent interruptions.
|
||||
|
||||
### Thermal Management
|
||||
```bash
|
||||
# Thermal zone trip points (prevent throttling)
|
||||
TEMP_LIMITS_ON_AC="85/95"
|
||||
TEMP_LIMITS_ON_BAT="80/90"
|
||||
|
||||
# Fan control (if supported)
|
||||
FAN_SPEED_ON_AC=auto
|
||||
FAN_SPEED_ON_BAT=auto
|
||||
```
|
||||
|
||||
**Rationale**: Higher thermal limits on AC power allow for sustained gaming performance. Battery limits are lower to prevent overheating during mobile use.
|
||||
|
||||
### Audio and Multimedia
|
||||
```bash
|
||||
# Audio power management
|
||||
SOUND_POWER_SAVE_ON_AC=0
|
||||
SOUND_POWER_SAVE_ON_BAT=1
|
||||
SOUND_POWER_SAVE_CONTROLLER=Y
|
||||
```
|
||||
|
||||
**Rationale**: Audio power saving disabled on AC for gaming audio quality. Enabled on battery for power conservation.
|
||||
|
||||
### System Sleep and Wake
|
||||
```bash
|
||||
# Fast resume for gaming
|
||||
RESTORE_DEVICE_STATE_ON_STARTUP=1
|
||||
DEVICES_TO_DISABLE_ON_STARTUP=""
|
||||
|
||||
# USB device handling during sleep
|
||||
USB_EXCLUDE_WWAN=1
|
||||
USB_EXCLUDE_PRINTER=1
|
||||
```
|
||||
|
||||
**Rationale**: Fast wake/sleep cycle for gaming sessions. Critical devices remain configured for immediate use.
|
||||
|
||||
## Performance Impact
|
||||
|
||||
### Gaming Performance (AC Power)
|
||||
- **CPU**: Maximum performance with all cores available
|
||||
- **GPU**: Full performance mode for dedicated graphics
|
||||
- **Storage**: Maximum I/O performance for fast game loading
|
||||
- **Network**: Low-latency connectivity for online gaming
|
||||
- **Thermal**: Higher limits to prevent throttling during intensive gaming
|
||||
|
||||
### Battery Life (Battery Power)
|
||||
- **Runtime**: 4-6 hours for general use, 1.5-2.5 hours for gaming
|
||||
- **Standby**: Optimized sleep/wake for extended standby time
|
||||
- **Balanced**: Performance available when needed, power saving when idle
|
||||
|
||||
## Warnings and Considerations
|
||||
|
||||
1. **Thermal Management**: Higher performance settings may increase heat generation. Ensure adequate cooling.
|
||||
|
||||
2. **Battery Health**: Gaming on battery will reduce battery lifespan. Consider AC power for extended gaming sessions.
|
||||
|
||||
3. **Fan Noise**: Performance mode may result in more aggressive fan curves for thermal management.
|
||||
|
||||
4. **Power Consumption**: AC power consumption will be higher during gaming sessions (150-200W typical).
|
||||
|
||||
5. **Component Longevity**: Sustained high performance may impact long-term component reliability.
|
||||
|
||||
## Customization Options
|
||||
|
||||
### For Competitive Gaming
|
||||
```bash
|
||||
# Even more aggressive performance
|
||||
CPU_SCALING_GOVERNOR_ON_BAT=performance
|
||||
PLATFORM_PROFILE_ON_BAT=performance
|
||||
WIFI_PWR_ON_BAT=off
|
||||
```
|
||||
|
||||
### For Extended Battery Gaming
|
||||
```bash
|
||||
# More conservative battery settings
|
||||
CPU_SCALING_MAX_FREQ_ON_BAT=2400000
|
||||
CPU_BOOST_ON_BAT=0
|
||||
PLATFORM_PROFILE_ON_BAT=low-power
|
||||
```
|
||||
|
||||
### For Content Creation
|
||||
```bash
|
||||
# Optimize for rendering workloads
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC=performance
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT=performance
|
||||
SOUND_POWER_SAVE_ON_AC=0
|
||||
```
|
||||
|
||||
## Monitoring and Validation
|
||||
|
||||
### Performance Monitoring
|
||||
```bash
|
||||
# CPU frequency monitoring
|
||||
watch -n 1 'cat /proc/cpuinfo | grep MHz'
|
||||
|
||||
# Thermal monitoring
|
||||
watch -n 1 'sensors'
|
||||
|
||||
# Power consumption
|
||||
sudo powertop --time=60
|
||||
```
|
||||
|
||||
### Gaming Benchmarks
|
||||
- **3DMark**: Graphics performance validation
|
||||
- **Unigine Heaven**: Thermal stability testing
|
||||
- **CPU-Z**: CPU performance verification
|
||||
- **CrystalDiskMark**: Storage performance testing
|
||||
|
||||
### Battery Testing
|
||||
- **PowerTOP**: Power consumption analysis
|
||||
- **Battery runtime**: Real-world usage testing
|
||||
- **Standby drain**: Sleep power consumption
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Performance Issues
|
||||
- Verify CPU governor is set correctly: `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`
|
||||
- Check thermal throttling: `dmesg | grep -i thermal`
|
||||
- Monitor GPU performance: `nvidia-smi` (for NVIDIA)
|
||||
|
||||
### Battery Issues
|
||||
- Check power consumption: `sudo powertop`
|
||||
- Verify power profiles: `system76-power profile`
|
||||
- Monitor charging behavior: `upower -i /org/freedesktop/UPower/devices/battery_BAT0`
|
||||
|
||||
### Thermal Issues
|
||||
- Monitor temperatures: `sensors`
|
||||
- Check fan operation: `pwmconfig` (if supported)
|
||||
- Verify thermal limits: Check BIOS/UEFI settings
|
||||
|
||||
This configuration provides optimal gaming performance while maintaining reasonable power management for non-gaming use cases.
|
Reference in New Issue
Block a user