---
title: General System Tweaks
description: Things you can do to tweak after installing
tableOfContents:
  minHeadingLevel: 1
  maxHeadingLevel: 4
---

import { Tabs, TabItem, Steps, LinkButton, Icon } from '@astrojs/starlight/components';
import ImageComponent from '~/components/image-component.astro';

## AMD Performance Tweaks

### AMD P-State Driver
---------------------------

`amd-pstate` is the AMD CPU performance scaling driver that introduces a new CPU frequency control mechanism on modern AMD APU and CPU series in the Linux kernel. The new mechanism is based on Collaborative Processor Performance Control (CPPC) which provides finer grain frequency management than legacy ACPI hardware P-States.

Current AMD CPU/APU platforms are using the ACPI P-states driver to manage CPU frequency and clocks with switching only in 3 P-states. CPPC replaces the ACPI P-states controls and allows a flexible, low-latency interface for the Linux kernel to directly communicate the performance hints to hardware.

Below are 3 operation modes of the `amd_pstate` driver and kernel cmdline entries to use them on boot:

- AMD P-State (Non-Autonomous Mode): `amd_pstate=passive`
- AMD P-State Guided (Guided Autonomous Mode): `amd_pstate=guided`
- AMD P-State EPP (Autonomous Mode): `amd_pstate=active`

:::note
The AMD P-State EPP Driver is used by default when no explicit configuration is made.
:::

You can also switch between operation modes at runtime to test the options:

- **Autonomous mode**: platform considers only the values set for Minimum performance, Maximum performance, and Energy Performance Preference.
   ```sh
   echo active | sudo tee /sys/devices/system/cpu/amd_pstate/status
   ```

- **Guided-autonomous mode**: platform sets operating performance level according to the current workload and within limits set by the OS through minimum and maximum performance registers.
   ```sh
   echo guided | sudo tee /sys/devices/system/cpu/amd_pstate/status
   ```

- **Non-autonomous mode**: platform gets desired performance level from OS directly through Desired Performance Register.
   ```sh
   echo passive | sudo tee /sys/devices/system/cpu/amd_pstate/status
   ```

For more in-depth information:

<LinkButton icon="external" href="https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html">AMD P-State Documentation</LinkButton>
<LinkButton icon="external" href="https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html#amd-pstate-driver-operation-modes">AMD P-State Driver Operation Modes</LinkButton>
<LinkButton icon="external" href="https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html#user-space-interface-in-sysfs-per-policy-control">AMD P-State User Space Interface</LinkButton>

### Configuring AMD P-State EPP

To use the P-State EPP, there are two CPU frequency scaling governors available: `powersave` and `performance`. It is recommended to use the powersave governor and set a preference.

*   Set powersave governor: `sudo cpupower frequency-set -g powersave`
*   Set performance governor: `sudo cpupower frequency-set -g performance`

To set a preference, run the following command with the desired preference:

```sh
echo power | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference
```

Available preferences: `performance`, `power`, `balance_power`, `balance_performance`

<LinkButton icon="external" href="https://lore.kernel.org/lkml/20221219064042.661122-1-perry.yuan@amd.com/">Official Benchmark for each preference</LinkButton>

### AMD 3D V-Cache Optimizer

AMD posted a patch to optimize the Cache Scheduling on Dual CCD 3D CPUs, like 7950X3D and 7900X3D.
You need to set in the BIOS under the CPPC Option to the "Driver" Option. This will allow to override with the sysfs the used mode.

There are two modes:

1. Frequency
2. Cache

If `cache` is set, the driver will try to put the tasks first on the CCD with the higher Cache, this is mainly profitable on games.
The `frequency` option will try to put the tasks on the second CCD, which has a higher frequency than the 3D Cache CCD.

Frequency (Default):
```sh
echo frequency | sudo tee /sys/bus/platform/drivers/amd_x3d_vcache/AMDI0101:00/amd_x3d_mode
```

Cache:
```sh
echo cache | sudo tee /sys/bus/platform/drivers/amd_x3d_vcache/AMDI0101:00/amd_x3d_mode
```

After you changed the modes, the amd preferred core stats should provide a different ranking. You can read it out with:
```sh
grep -v /sys/devices/system/cpu/cpu*/cpufreq/amd_pstate_prefcore_ranking
```

### AMD P-State Core Performance Boost

AMD Core Performance Boost aka AMD Turbo Core is a dynamic frequency scaling technology by AMD that allows the
processor to dynamically adjust and control the processor operating frequency in certain version of its processors
which allows for increased performance when needed while maintaining lower power and thermal parameters during normal operation.

To manage AMD CPB on CachyOS, you can use the following commands:

```sh
❯ echo 0 | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/boost # Disable boost for all cores
❯ lscpu -ae # This shows that AMD CPB is disabled globally
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE    MAXMHZ   MINMHZ       MHZ
  0    0      0    0 0:0:0:0          yes 3301.0000 400.0000 1212.8250
  1    0      0    0 0:0:0:0          yes 3301.0000 400.0000 1394.2180
  2    0      0    1 1:1:1:0          yes 3301.0000 400.0000 1204.4600

❯ echo 1 | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/boost # Enables boost on cpu0
❯ lscpu -ae
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE    MAXMHZ   MINMHZ       MHZ
  0    0      0    0 0:0:0:0          yes 4564.0000 400.0000 1393.2380
  1    0      0    0 0:0:0:0          yes 3301.0000 400.0000  400.0000
  2    0      0    1 1:1:1:0          yes 3301.0000 400.0000 2157.8469
```

CachyOS also provides a version of `power-profiles-daemon` that backports a commit which enables
support for AMD CPB. AMD CPB will be disabled if the `powersave` profile is being used, and will be enabled on `balanced` or `performance`.

For more information see:
- https://lore.kernel.org/linux-pm/1a78eeaa-fadd-4734-aaeb-2fe11e96e198@amd.com/T/#m4a0c8917ea8fb033504055bd61512c80c85410c8
- https://lore.kernel.org/linux-pm/20240624213400.67773-1-mario.limonciello@amd.com/

## Performance Improvements

### [ADIOS I/O Scheduler](https://github.com/firelzrd/adios)

Created by [firelzrd](https://github.com/firelzrd)

:::note
CachyOS includes the stable branch of ADIOS in the kernel.

Current version in **linux-cachyos**: `3.2.0`

Current version in **linux-cachyos-rc**: `3.2.0`
:::

Brief introduction from README:

- *ADIOS (Adaptive Deadline I/O Scheduler) is a block layer I/O scheduler for the Linux kernel, designed for modern multi-queue block devices (blk-mq). It aims to provide low latency for I/O operations by combining deadline scheduling principles with a learning-based adaptive latency control mechanism.*
  - *Inspired by and builds upon concepts from the mq-deadline and Kyber I/O schedulers. Its core feature is the ability to predict I/O completion latency based on past performance and request characteristics (operation type, size) and use this prediction to dynamically adjust request deadlines and batching behavior.*

TLDR: ADIOS works by learning the latency profile of your storage device and using that knowledge to dynamically set deadlines for I/O requests. It prioritizes requests into four tiers, from critical system operations (Tier 0) to background tasks (Tier 3), to ensure a smooth user experience. While it focuses on responsiveness, its behavior can be fine-tuned via sysfs settings to balance latency and throughput.

For a live demo, you can watch this [video](https://www.youtube.com/watch?v=L9WDcEeHgy4)

#### How to enable ADIOS

<Tabs>
    <TabItem label='Temporarily (takes effect at runtime)'>
        This method sets the scheduler for the current session. The change will be lost on reboot.
        ```sh
        sync && echo adios | sudo tee /sys/block/<yourdrive>/queue/scheduler
            # Replace <yourdrive> with the actual drive identifier (e.g. sda, sdb, nvme0n1)
        ```
    </TabItem>
    <TabItem label='Persistent after reboot'>
        <Steps>
            1. Open or create a new udev rules file in your preferred text editor (e.g., nano, micro, vim)
                ```sh title='Example'
                sudo nano /etc/udev/rules.d/60-ioschedulers.rules
                ```
            2. Add the following rules to the file. These rules automatically apply a specific I/O scheduler based on the drive type (HDD, SSD, or NVMe).
                ```text
                # HDD
                ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="1", \
                    ATTR{queue/scheduler}="bfq"

                # SSD
                ACTION=="add|change", KERNEL=="sd[a-z]*|mmcblk[0-9]*", ATTR{queue/rotational}=="0", \
                    ATTR{queue/scheduler}="adios"

                # NVMe SSD
                ACTION=="add|change", KERNEL=="nvme[0-9]*", ATTR{queue/rotational}=="0", \
                    ATTR{queue/scheduler}="adios"
                ```
              3.  Save the file and close the editor.
              4.  Reload the `udev` rules to apply the changes immediately without a reboot.
                  ```sh
                  sudo udevadm control --reload-rules
                  sudo udevadm trigger
                  ```
        </Steps>
    </TabItem>
</Tabs>

FAQ:

- If it improves responsiveness, why isn't it enabled by default?
  - ADIOS is still under active development and continuous testing. While it offers significant benefits for desktop responsiveness, it is not yet considered stable enough to be the default for all workloads and hardware types. In some edge cases, bugs could lead to issues like system lockups. For this reason, it is an optional feature for users who wish to test and benefit from its latest improvements.

### NVIDIA Smooth Motion (RTX 40xx & 50xx Series)

:::note[Game Compatibility.]
Games that run on DX11, DX12 and Vulkan.

Both DXVK and VKD3D work fine.

**Only 64bit applications are supported. Smooth Motion will not work with 32bit applications (e.g. old DX11 games).**

:::

Direct quote from NVIDIA's documentation:

*NVIDIA Smooth Motion is a new driver-based AI model that delivers smoother gameplay by inferring an additional frame between two rendered frames. For games without DLSS Frame Generation, NVIDIA Smooth Motion is a new option for enhancing your experience on GeForce RTX 40 Series and newer GPUs.*

- How to enable NVIDIA Smooth Motion for a game:
  - Add the following environment variable:
    ```text
    NVPRESENT_ENABLE_SMOOTH_MOTION=1
    ```

FAQ:

- Why use Smooth Motion over DLSS Frame Generation?
  - When a game lacks support for DLSS Frame Generation, Smooth motion serves as an alternative thanks to its driver-based AI model.
- Is there any drawback to using Smooth Motion?
  - Yes, enabling Smooth Motion may introduce a slight input lag due to the additional frame inference process.
  - Prone to cause issues with third party overlays. In order to avoid this. Include the following environment variable:
    ```text
    NVPRESENT_QUEUE_FAMILY=1
    ```
    :::note[A performance impact may be observed when using this variable.]
    :::
- Why MangoHud is not reporting the increased framerate?
  - Currently, MangoHud does not account for the additional frames generated by Smooth Motion, leading to a misleading reported framerate.
    - Using a monitor's built in FPS counter will provide the correct framerate.
- How's the image quality compared to DLSS Frame Generation?
  - Image quality is not as good and may introduce artifacts, especially during fast motion scenes.
- Is it compatible with external frame capping tools? Example: MangoHud.
  - No. In-game cap should work fine.
- Can Smooth Motion be combined with DLSS Frame Generation?
  - No. Only one frame generation method can be active at a time.

## Power Saving Tweaks

### Enable RCU Lazy

RCU Lazy helps reducing the power usage at idle or lightly loaded systems. This can be useful for laptops and handheld devices.
The improvement is between 5-10% in terms of power savings. However, it's important to note that this power saving feature may come at the cost of slightly reduced performance depending on the scenario.
The linux-cachyos-deckify kernel will have this option enabled by default, since power saving is key and necessary for these devices.

To enable RCU Lazy, add the following parameter to your kernel [cmdline](/configuration/boot_manager_configuration/) parameters list:
```text
rcutree.enable_rcu_lazy=1
```

## NVIDIA Troubleshooting

### Disabling SDDM Wayland Backend

:::note
Starting from cachyos-kde-settings 4.3, SDDM uses KWin as it's Wayland compositor by default.
:::

While this a nice step forward, it might introduce some annoyances such as breaking support for overclocking using nvidia-settings or cause incompatibility with older GPUs which struggle under Wayland.

In order to revert this change. Remove the cachyos-kde-settings package:
```sh
sudo pacman -R cachyos-kde-settings
```

### NVIDIA GSP Firmware

The NVIDIA GSP Firmware can **"in some cases"** lead to decreased performance. While the 555.58.02 NVIDIA Driver has largely addressed this issue, it may persist on certain systems.
If you are facing hiccups in KDE or bad performance in some cases, you can disable the GSP Firmware with the following config file:
`/etc/modprobe.d/nvidia-gsp.conf`

```text
options nvidia NVreg_EnableGpuFirmware=0
```

After creating the file, execute the following command:
```sh
sudo mkinitcpio -P
```

:::note
NVIDIA's [open kernel modules](https://github.com/NVIDIA/open-gpu-kernel-modules) are based on GSP firmware. Due to this, GSP cannot be disabled and this modprobe option will be ignored when using them. Use `linux-cachyos-nvidia` or `nvidia-dkms`.
:::

It's generally recommended to test the GSP firmware after each new NVIDIA driver installation, as it often introduces beneficial features. Moreover, NVIDIA primarily started conducting QA testing using the GSP firmware.

## Audio and Software Enhancements

### Enhancing Laptop Speaker Sound

Laptop speakers often produce thin and underwhelming sound due to their compact size and limited hardware capabilities. [EasyEffects](https://wiki.archlinux.org/title/PipeWire#EasyEffects) can significantly enhance the sound quality of your laptop's built-in speakers by applying various audio effects and custom configurations.

To get started you need to install EasyEffects and the required dependencies:

```bash
# Install EasyEffects
sudo pacman -S easyeffects
# Install additional plugins for more effects
sudo pacman -S lsp-plugins-lv2
sudo pacman -S zam-plugins
sudo pacman -S calf
sudo pacman -S mda.lv2
```

#### Configuration

Follow these steps to configure EasyEffects:

1. Launch EasyEffects from your application menu or by typing `easyeffects` in the terminal.
2. Navigate to the **Output** tab to manage effects applied to your speaker audio.
3. Switch to the **Effects** tab to add, modify, or adjust audio effects.

<ImageComponent imgsrc={import('~/assets/images/easyeffects.png')} />

##### Using Community Presets

For a quick and effective setup, start with **community-created presets** tailored for various audio scenarios:

1. Download presets from the [EasyEffects Community Presets](https://github.com/wwmm/easyeffects/wiki/Community-presets) repository.
2. In EasyEffects, click the **Presets** button and choose **"Import preset from local storage"**.
3. Locate and select the downloaded preset file.
4. Once imported, the preset will appear in your list—click **"Load"** to apply it to your audio output.

<ImageComponent imgsrc={import('~/assets/images/easyeffects-presets.png')} />

##### Creating a Custom Profile

For a more personalized audio experience, create a custom profile tailored to your laptop's speakers:

1. Click the **"+"** button in the Presets menu to create a new preset (e.g., name it **"Laptop Speakers"**).
2. Select **"Load"** to activate the new preset.
3. Add and configure effects in the **Output** > **Effects** tab, experimenting with options like equalizers, bass enhancers, or stereo wideners.

##### Using the Convolver Effect (Dolby Atmos Laptops)

The **Convolver effect** can dramatically improve sound by applying impulse responses that simulate high-quality audio environments. However, it requires precise setup:

1. Add the **Convolver** effect to your effects chain in the **Effects** tab.
2. Load an impulse response file (in `.wav` format) specific to your laptop model, if available. You can search for these files online at resources like:
   - https://wiki.archlinux.org/title/Lenovo_ThinkPad_T14_(AMD)_Gen_4#Speakers
   - https://github.com/m4tx/thinkpad-p14s-g4-linux/#sound
   - https://github.com/shuhaowu/linux-thinkpad-speaker-improvements/
3. **Prevent clipping**: The Convolver effect may increase volume significantly. Add a **Limiter** effect after the Convolver in your effects chain to control peaks and avoid distortion.

<ImageComponent imgsrc={import('~/assets/images/easyeffects-convolver.png')} />

#### Tips for Optimal Results

- **Experiment** with different presets to identify the best match for your specific laptop model and personal sound preferences.
- **Make incremental adjustments** to individual effects to prevent distortion or unnatural sound output.
- **Compare with toggle**: Frequently toggle EasyEffects **on/off** to evaluate the improvements against the default audio.
- Search for **device-specific presets or Convolver impulse responses** for popular laptop models like **Framework Laptop 13** or **ThinkPad T14** to achieve tailored results.
- **Automate startup**: Configure EasyEffects to launch automatically at startup through the app's preferences to ensure your custom profile is always applied.
- **Autoload presets for multiple devices**: Use the **PipeWire** > **Presets Autoloading** tab to associate specific presets with different output devices (e.g., Speakers vs. Headphones) for seamless switching. <ImageComponent imgsrc={import('~/assets/images/easyeffects-autoloading.png')} />

#### Alternative to EasyEffects

As an alternative you can try using [JDSP4Linux](https://github.com/Audio4Linux/JDSP4Linux), which is an audio effect processor for PipeWire and PulseAudio clients.

### OBS Studio

We provide a custom obs-studio-browser package in our repository that is recommended over the standard `obs-studio` package. It contains patches to fix some of the common issues like cuda-errors and virtual camera problems.

```sh title='Open a terminal and run the following command'
sudo pacman -S obs-studio-browser
# If you previously had the obs-studio installed then pacman is going to ask you if
# you want to replace it, if so enter "Y".
```

## Swap Configuration

### Switching from ZRam to Zswap

By default, CachyOS uses ZRam for swap management. However, if you prefer to use Zswap instead, you can easily switch by following these steps:

:::note
This guide assumes you have the default CachyOS setup with ZRam enabled and no swap partition or file was created during installation.
:::

<Steps>
    1. Disable ZRam by adding a kernel parameter. [Edit your bootloader configuration](/configuration/boot_manager_configuration) and add the following line:
        ```text
        systemd.zram=0
        ```
    2. Enable Zswap by adding the following kernel parameter:
        ```text
        zswap.enabled=1 zswap.shrinker_enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=30
        ```
    3. Create an empty override file to disable [CachyOS's udev rule](https://github.com/CachyOS/CachyOS-Settings/blob/master/usr/lib/udev/rules.d/30-zram.rules) which disables Zswap:
        ```bash
        sudo touch /etc/udev/rules.d/30-zram.rules
        ```
    4. Create a swap file for Zswap.
        <details>
            <summary>If you're using Btrfs:</summary>
                <Steps>
                    1. Create a Btrfs subvolume for the swap file:
                        ```bash
                        sudo btrfs subvolume create /swap
                        ```
                    2. Create a swap file with your desired size (e.g., 8GB) by changing the `--size` parameter:
                        ```bash "--size"
                        sudo btrfs filesystem mkswapfile --size 4g --uuid clear /swap/swapfile
                        ```
                    3. Activate the swap file:
                        ```bash
                        sudo swapon /swap/swapfile
                        ```
                    4. Add the swap file to `/etc/fstab` to make it persistent across reboots:
                        ```bash
                        echo "/swap/swapfile none swap defaults 0 0" | sudo tee -a /etc/fstab
                        ```
                </Steps>
        </details>
        <details>
            <summary>If you're not using Btrfs:</summary>
            <Steps>
                1. Create a swap file with your desired size (e.g., 8GB) by changing the `count=` parameter:
                    ```bash "count=8"
                    sudo dd if=/dev/zero of=/swapfile bs=1G count=8
                    ```
                2. Set the correct permissions for the swap file:
                    ```bash
                    sudo chmod 0600 /swapfile
                    ```
                3. Format the swap file:
                    ```bash
                    sudo mkswap /swapfile
                    ```
                4. Add the swap file to `/etc/fstab` to make it persistent across reboots:
                    ```bash
                    echo "/swapfile none swap defaults 0 0" | sudo tee -a /etc/fstab
                    ```
                5. Activate the swap file:
                    ```
                    sudo swapon /swapfile
                    ```
            </Steps>
        </details>
    5. Add the lz4 compression module to the `mkinitcpio.conf` configuration file:
        1. Open the file with a text editor:
            ```bash
            sudo nano /etc/mkinitcpio.conf
            ```
        2. Find the `MODULES` array and add `lz4` to it. It should look something like this:
            ```text
            MODULES=(... lz4)
            ```
        3. Save the file by pressing `Ctrl + O` and `Enter` to confirm, then exit the editor with `Ctrl + X`.
    6. Rebuild your initramfs to apply the changes. The command varies depending on your bootloader:
        <details>
            <summary>systemd-boot</summary>
            ```bash
            sudo sdboot-manage gen
            ```
        </details>
        <details>
            <summary>GRUB</summary>
            ```bash
            sudo grub-mkconfig -o /boot/grub/grub.cfg
            ```
        </details>
        <details>
            <summary>Limine</summary>
            ```bash
            sudo limine-mkinitcpio
            ```
        </details>
    7. Reboot your system to apply all changes.
</Steps>
