Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

35 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Linux Power Management Suite

Version 3.1 - Professional Monitoring & Fan Control

Professional power management with universal CPU/GPU compatibility, advanced sensor monitoring, and intelligent fan control. Works on Intel, AMD, NVIDIA GPUs, and atypical systems including all-in-one PCs.

License: MIT GitHub Ready Tested Universal

๐ŸŒŸ What's New in V3.1

  • ๐ŸŽฎ GPU Monitoring - Real-time temp, fan, power (NVIDIA/AMD/Intel)
  • ๐Ÿ” Universal Sensors - ALL sensors including atypical motherboards
  • ๐Ÿ’จ Fan Control - PWM control for CPU & GPU with auto-adjustment
  • ๐Ÿ“Š Monitoring Service - Professional daemon with alerts & JSON logging
  • ๐Ÿญ All-in-One Support - Works on difficult configs (Acer, Dell AIO)

๐Ÿ“– Advanced Sensor Monitoring Guide โ†’

๐ŸŒ What's New in V3.0

  • โœ… Universal CPU Support - Intel (Core 2, i3/i5/i7, Skylake+), AMD (K8, K10, FX, Ryzen)
  • โœ… Auto GPU Detection - AMD, NVIDIA, Intel - automatically finds your GPU
  • โœ… Adaptive Thermal Management - CPU-specific temperature thresholds
  • โœ… No Hardcoded Paths - Install anywhere, works from any directory
  • โœ… Portable - Clone and run on any Linux system
  • โœ… Backward Compatible - Original Q9550 optimizations preserved

๐Ÿ“– Universal Hardware Documentation โ†’

๐ŸŽฏ Features

Core Power Management

  • ๐Ÿ”ฅ Performance Mode - Full CPU (2.83GHz) + GPU power for gaming/work
  • โš–๏ธ Balanced Mode - Smart power management (2.16GHz) for daily use
  • ๐Ÿ”‹ Power Save Mode - Low power (1.66GHz) for battery/stability
  • ๐Ÿšจ Emergency Mode - Emergency frequency (1.33GHz) & system recovery

Advanced Features

  • โšก CPU Frequency Control - MSR-based frequency scaling for Core 2 Quad Q9550
  • ๐ŸŒก๏ธ Thermal Management - Progressive thermal response (65ยฐC โ†’ 70ยฐC โ†’ 80ยฐC โ†’ emergency)
  • ๐Ÿค– AI Process Management - Thermal-protected AI workload management
  • ๐ŸŽฏ Core Affinity - Process-specific CPU core assignment
  • ๐Ÿ›ก๏ธ Safety First - Process monitoring, timeouts, error handling
  • ๐Ÿ“Š System Monitoring - Real-time CPU, GPU, memory, temperature tracking

๐Ÿš€ Quick Start

# Clone repository
git clone https://github.com/yourusername/linux-power-management.git
cd linux-power-management

# Install (requires sudo)
sudo ./scripts/install.sh

# Test installation
./scripts/performance_manager.sh test

# Set performance mode
./scripts/performance_manager.sh performance

# Test CPU frequency control
python3 src/frequency/cpu_frequency_manager.py status

๐Ÿ“‹ Usage

Performance Manager

# Performance profiles
./scripts/performance_manager.sh performance  # Max power
./scripts/performance_manager.sh balanced     # Balanced  
./scripts/performance_manager.sh powersave    # Power save
./scripts/performance_manager.sh emergency    # Emergency

# System info
./scripts/performance_manager.sh status       # Current status
./scripts/performance_manager.sh log          # View logs
./scripts/performance_manager.sh test         # Dry run test

CPU Frequency Control

# Check current frequency and thermal profiles
python3 src/frequency/cpu_frequency_manager.py status

# Apply thermal profiles
python3 src/frequency/cpu_frequency_manager.py thermal performance  # 2.83GHz
python3 src/frequency/cpu_frequency_manager.py thermal balanced     # 2.16GHz  
python3 src/frequency/cpu_frequency_manager.py thermal power_save   # 1.66GHz
python3 src/frequency/cpu_frequency_manager.py thermal emergency    # 1.33GHz

# Set specific frequency
python3 src/frequency/cpu_frequency_manager.py set 1666

AI Process Manager

# AI process control
./scripts/ai_process_manager.sh show         # Show AI processes
./scripts/ai_process_manager.sh optimize     # Optimize performance
./scripts/ai_process_manager.sh emergency    # Emergency stop

# AI workload testing
python3 examples/ai_workloads/final_mycoder_test.py        # Thermal-protected AI test
python3 examples/ai_workloads/ultra_safe_mycoder.py        # Ultra-safe AI demo

๐Ÿ”— Integrations

PowerManagement integrates with other system tools for a unified monitoring experience:

MyMenu Integration (dmenu)

# Add PowerManagement to MyMenu dmenu launcher
bash integrations/mymenu_patch.sh /path/to/MyMenu

# Provides:
# - ๐ŸŒก๏ธ Power & Thermal category
# - Quick access to power profiles
# - GPU and sensor monitoring
# - Fan control submenu

claude-tools-monitor Integration

# Monitor system metrics during Claude AI sessions
cp integrations/power_integration.py /path/to/claude-tools-monitor/integrations/

# Features:
# - Real-time CPU/GPU temperature logging
# - Thermal throttling protection
# - Power consumption tracking

Unified Dashboard

# Launch unified monitoring dashboard
bash integrations/unified_monitor.sh

# Shows:
# - PowerManagement metrics (CPU/GPU temps, fans, power)
# - Claude monitor status
# - Real-time thermal alerts
# - Interactive menu system

๐Ÿ“– Complete Integration Guide โ†’

๐Ÿ›ก๏ธ Safety Features

  • Process Limit Monitoring - Prevents fork bombs (max 10 instances)
  • Timeout Protection - All operations timeout after 5-8 seconds
  • Error Handling - Graceful failure with logging
  • Dry Run Mode - Test changes before applying
  • Emergency Recovery - Blackscreen prevention tools
  • Permission Checks - Proper sudo handling

๐Ÿ“Š System Requirements

  • OS: Linux (Ubuntu/Debian/Fedora/Arch)
  • Kernel: 5.0+ (power management support)
  • Dependencies: powerprofilesctl, systemd
  • Permissions: sudo access for power management
  • Hardware: AMD/Intel CPU, optional GPU support

๐Ÿ“ Project Structure

linux-power-management/
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ performance_manager.sh    # Main power control
โ”‚   โ”œโ”€โ”€ ai_process_manager.sh     # AI process management
โ”‚   โ”œโ”€โ”€ emergency_cleanup.sh      # Emergency recovery
โ”‚   โ””โ”€โ”€ system_monitor.sh         # System monitoring
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ power_profiles.conf       # Configuration
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_suite.sh            # Test automation
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ INSTALL.md               # Installation guide
โ”‚   โ”œโ”€โ”€ USAGE.md                 # Usage examples
โ”‚   โ””โ”€โ”€ TROUBLESHOOTING.md       # Problem solving
โ””โ”€โ”€ .github/
    โ””โ”€โ”€ workflows/
        โ””โ”€โ”€ test.yml             # CI/CD pipeline

๐Ÿ”ง Configuration

Edit config/power_profiles.conf:

# Maximum allowed processes
MAX_PROCESSES=10

# Default timeouts (seconds)
POWER_TIMEOUT=8
GPU_TIMEOUT=3
EMERGENCY_TIMEOUT=5

# Log file location
LOG_FILE="/tmp/performance_manager.log"

๐Ÿงช Testing

# Run test suite
./tests/test_suite.sh

# Individual tests
./scripts/performance_manager.sh test
./scripts/ai_process_manager.sh show

๐Ÿšจ Emergency Recovery

If system becomes unresponsive:

# Magic SysRq sequence (hardware level)
Alt + SysRq + R,E,I,S,U,B

# SSH recovery
ssh user@system './scripts/emergency_cleanup.sh'

# Emergency power save
./scripts/performance_manager.sh emergency

๐Ÿ“ˆ Performance Results

Before Power Management:

  • Load: 4.43, Memory: 5.0Gi, CPU: Variable
  • Graphics freezes, blackscreen issues

After Power Management:

  • Load: 0.46 (90% improvement)
  • Memory: 2.6Gi (48% reduction)
  • Stable graphics, no blackscreens
  • Full 2.83GHz CPU available on demand

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

โš ๏ธ Disclaimer

Use at your own risk. Always test in safe environments first. This software modifies system power settings and can affect system stability.

๐Ÿ™ Acknowledgments

  • Built with Claude AI assistance
  • Tested on Intel Core2 Quad Q9550 + AMD Radeon RV710
  • Thanks to the Linux community for power management tools

Made with โค๏ธ for the Linux community

About

Linux Power Management Suite with MSR-based CPU frequency control and thermal management for Core 2 Quad Q9550

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages