Skip to content

ArisYuuki/Arch-CachyOS-Laptop-Performance-Power-Tuning-Guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 

Repository files navigation

Arch-CachyOS-Laptop-Performance-Power-Tuning-Guide

This is a Comprehensive Guide to Tuning your Arch Linux/CachyOS gaming laptop for optimal performance and usability. This was made with the Alienware M17R4 in mind, featuring an i7-10870h, 32GB DDR4, RTX 3080 16GB.

โšก Arch / CachyOS Laptop Performance & Power Tuning Guide

Arch Linux CachyOS Intel NVIDIA License

Advanced power & thermal optimization guide for Intel + NVIDIA laptops.

Designed for:

  • Arch Linux
  • CachyOS
  • Hybrid GPU gaming laptops

๐Ÿ“‘ Table of Contents


๐Ÿง  Overview

This guide configures:

โœ” Dynamic Intel PL1 / PL2 limits
โœ” Persistent CPU undervolting
โœ” NVIDIA runtime power management
โœ” Safe GPU idle monitoring

Goal:

  • Lower idle power draw
  • Better thermals
  • Reduced fan noise
  • Longer battery life
  • Controlled performance scaling

โš ๏ธ Advanced users only. Improper values can cause instability.


๐Ÿš€ Features

Feature Benefit
Dynamic PL limits Smart performance scaling
CPU Undervolt Lower temps & power draw
NVIDIA Runtime PM GPU sleeps when idle
Idle Monitor Verify GPU suspend state

๐Ÿ”‹ Intel Power Limits by Profile

Automatically changes PL1/PL2 when switching power profiles.

Create Script

sudo nano /usr/local/bin/set-pl-by-profile.sh

Paste script (see full script below) Be sure to EDIT Power Limits according to YOUR HARDWARE

#!/bin/bash

RAPL="/sys/class/powercap/intel-rapl:0"

PROFILE=$(powerprofilesctl get)

set_limits() {
  echo "$1" > $RAPL/constraint_0_power_limit_uw
  echo "$2" > $RAPL/constraint_1_power_limit_uw
  echo "$3" > $RAPL/constraint_0_time_window_us
  echo "$4" > $RAPL/constraint_1_time_window_us
}

case "$PROFILE" in
  performance)
    # PL1 70W, PL2 110W, Tau 56s / 8s
    set_limits 70000000 110000000 56000000 8000000
    ;;
  balanced)
    # PL1 35W, PL2 60W, Tau 20s / 3s
    set_limits 35000000 60000000 20000000 3000000
    ;;
  power-saver)
    # PL1 28W, PL2 30W, Tau 16s / 2s
    set_limits 28000000 30000000 16000000 2000000
    ;;
esac

Make executable:

sudo chmod +x /usr/local/bin/set-pl-by-profile.sh

Create service:

sudo nano /etc/systemd/system/pl-profile.service

Enable:

sudo systemctl daemon-reload
sudo systemctl enable --now pl-profile.service
sudo systemctl enable --now pl-profile.path

โ„๏ธ CPU Undervolting

Install dependencies:

sudo pacman -S git python python-setuptools

Install undervolt:

git clone https://github.com/georgewhewell/undervolt.git
cd undervolt
sudo python setup.py install

Test:

sudo undervolt --read

Create persistent service:

sudo nano /etc/systemd/system/undervolt.service

Paste script (see full script below) Be sure to EDIT Power Limits according to YOUR HARDWARE

Start with -50 for core/cache/gpu and move up in increments of 5-10mv and test stability by stressing the system

[Unit]
Description=Apply Intel CPU undervolt & power limits
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/usr/bin/undervolt --core -50 --cache -50 --gpu -50
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Enable:

sudo systemctl daemon-reload
sudo systemctl enable --now undervolt.service

Reboot and verify.


๐ŸŽฎ NVIDIA Runtime Power Management - Fix GPU Suspend

Create udev Rule File

sudo nano /etc/udev/rules.d/99-nvidia-runtimepm.rules

Add This To The File

# Enable runtime PM for RTX 3080 Mobile
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{device}=="0x24dc", ATTR{power/control}="auto"

Find Your Correct NVIDIA PCI Device ID

Run:

lspci -nn | grep -i nvidia

Example Output

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB] [10de:24dc] (rev a1)

01:00.1 Audio device [0403]: NVIDIA Corporation GA104 High Definition Audio Controller [10de:228b] (rev a1)

Understanding The IDs

  • 10de โ†’ NVIDIAโ€™s vendor ID
  • 24dc โ†’ Your GPUโ€™s device ID

So your rule should contain:

ATTR{vendor}=="0x10de"
ATTR{device}=="0x24dc"

Replace 24dc with your actual GPU device ID if different.


What This Does

When this exact NVIDIA GPU appears on the PCI bus, it enables:

ATTR{power/control}="auto"

This tells the system to use runtime power management for the device.


Reload udev Rules

sudo udevadm control --reload
sudo udevadm trigger

Reboot recommended after applying changes.

๐Ÿ–ฅ GPU Idle Monitor

This script monitors NVIDIA runtime power management without waking the GPU. This is useful (yet completely optional) as using programs like BTOP will call on the GPU and wake it up while it is running. you can also check without this by simply typing "sensors" in your terminal while nothing is running (close steam or any other GPU processes first) and the GPU temperature should in theory read 0 or single digits when suspended.

It safely reads:

  • runtime_status
  • runtime_active_time
  • runtime_suspended_time

Create Idle Monitor Script

nano ~/gpu_idle_monitor.sh

Add This Script

#!/bin/bash

GPU="/sys/bus/pci/devices/0000:01:00.0/power"

echo "Monitoring NVIDIA RTX 3080 Mobile runtime PM (safe, does NOT wake GPU)"
echo "Press Ctrl+C to stop"
echo

while true; do
    STATUS=$(cat $GPU/runtime_status)
    ACTIVE_US=$(cat $GPU/runtime_active_time)
    SUSPENDED_US=$(cat $GPU/runtime_suspended_time)

    ACTIVE_SEC=$(echo "scale=2; $ACTIVE_US / 1000000" | bc)
    SUSPENDED_SEC=$(echo "scale=2; $SUSPENDED_US / 1000000" | bc)

    printf "Status: %-10s | Active: %6.2fs | Suspended: %6.2fs\r" \
        "$STATUS" "$ACTIVE_SEC" "$SUSPENDED_SEC"

    sleep 1
done

Make Script Executable

chmod +x ~/gpu_idle_monitor.sh

Run Monitor

~/gpu_idle_monitor.sh

Press Ctrl+C to stop monitoring.


โš ๏ธ Important

If your GPU PCI address is different, check with:

lspci | grep -i nvidia

Replace:

0000:01:00.0

with your actual PCI device path if needed.

Reboot recommended.


๐Ÿ›  Troubleshooting

System Freezes After Undervolt

  • Reduce undervolt value (e.g. -40 instead of -50)

GPU Never Suspends

  • Ensure no background apps use NVIDIA
  • Check with:
    nvidia-smi

PL Limits Not Applying

  • Verify:
    powerprofilesctl get

๐Ÿ“œ License

MIT License โ€” Free to modify and distribute.


โš ๏ธ Disclaimer

This project modifies low-level power management settings.
You assume all risk for instability or hardware issues.

About

This is a Comprehensive Guide to Tuning your Arch Linux/CachyOS gaming laptop for optimal performance and usability. This was made with the Alienware M17R4 in mind, featuring an i7-10870h, 32GB DDR4, RTX 3080 16GB.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors