Now with 50% less dependencies!
- Linux system (any distribution - tested on Alpine, Debian and Arch)
- Root privileges (sudo access)
- pciutils installed (
lspci,setpcicommands)# Install on Ubuntu/Debian: sudo apt install pciutils # Install on RHEL/CentOS/Fedora: sudo dnf install pciutils
# 1. Make script executable
chmod +x autoaspm.sh
# 2. Optional: Preview what will be changed (safe, no modifications)
sudo ./autoaspm.sh --dry-run
# 3. Apply ASPM settings
sudo ./autoaspm.shQ: Why not just use AutoASPM from Wolfgang?
A: There is nothing wrong with the python autoaspm script but I try to avoid unneccesary packages. I am fine with essentials but having to install python when this is achievable via shell scripting is something I wanted to avoid.
A: Yes, ASPM changes are runtime-only and reset on reboot.
PCIe register modifications don't persist across reboots. You have several options — the two simplest are:
Option 1: Create a systemd service (recommended)
To apply ASPM automatically at boot, create a systemd unit using the provided sample autoaspm.service.sample.
Example steps to install the unit:
# Copy the autoaspm script to a safe location
sudo cp autoaspm.sh /usr/local/bin/autoaspm.sh
sudo chmod +x /usr/local/bin/autoaspm.sh
# Copy sample systemd unit to directory
sudo cp autoaspm.service.sample /etc/systemd/system/auto-aspm.service
# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable auto-aspm.service
sudo systemctl start auto-aspm.serviceOption 2: Add to startup scripts
# Add to /etc/rc.local (if available)
/path/to/your/autoaspm.sh
# Or add to cron
echo "@reboot root /path/to/your/autoaspm.sh" | sudo tee -a /etc/crontabA: Typically 5-15% system power reduction, varies by hardware.
Factors affecting savings:
- PCIe device types: Graphics cards, WiFi, storage controllers have different impact
- System workload: More apparent during idle or light usage
- Hardware generation: Newer devices generally have better ASPM implementation
- Device usage patterns: Devices that frequently idle see more benefit
This project is released under the BSD 3-Clause License ("New BSD"). See the full text in the LICENSE file in this repository.
- Original bash script: Luis R. Rodriguez
- Python rewrite: z8
- Automatic device detection: notthebee
- Back in Bash: Jacob Olness