u/SanmayJoshi

Jumped the ship to CachyOS from Fedora on my ASUS TUF F15. Here's a few things I did after the install...
▲ 37 r/cachyos

Jumped the ship to CachyOS from Fedora on my ASUS TUF F15. Here's a few things I did after the install...

Edit: Below text is part of my notes I keep to track changes I made. :)

1. Installing software that manages ASUS laptop

asusctl is the well-known tool to manage your ASUS laptop. It can do things that ARMOURY CRATE does in Windows. That includes managing power profiles, GPU profiles, keyboard backlight, battery maximum limit, etc.

a. You can install asusctl from cachy-os repos. (Before installing asus-ctl, see note on G-Helper below) Installing asusctl, rog-control-center didnt work OOTB. After installation, checking the status of relevant systemd services and going through journal logs I noticed error stating /etc/asusd missing. As a fix, I had to

sudo mkdir -p /etc/asusd

sudo systemctl reset-failed asusd

sudo systemctl start asusd

b. Add rog-control-center to autostart apps. I am using KDE. For KDE, open Application Menu (press Windows key), type autostart, hit enter. Add rog-control-center to the list. A quick note: before putting computer to sleep make sure that icon in taskbar is turned blue from red. Not sure whether this is likely to cause issues or not, but this is soemthing I follow.

G-Helper

G-helper is THE lightweight alternative to ARMOURY CRATE on Windows. It is sadly Windows only. Or rather it was. A kind dev took the task and ported the G-Helper to work on Linux. Here's the link to repo. I would probably have used this tool if I had known earlier.

2. Install Octopi

3. Get VSCodium

VSCodium is the completely FOSS build of VSCode. But it doesn't come with the access to all the great extensions for VSCode (only a few extensions from Open VSX Registry). To get access to the extensions from VSCode in VSCodium, run

mkdir -p ~/.config/VSCdoium && echo '{"nameShort": "Visual Studio Code", "nameLong": "Visual Studio Code", "extensionsGallery": {"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", "itemUrl": "https://marketplace.visualstudio.com/items"}}' > ~/.config/VSCdoium/product.json

I also add alias to code for codium. Simply add alias code 'codium' in /home/username/.config/fish/config.fish. You can also explore using abbr instead.

4. Sleep issues with NVIDIA ¬‿¬

Run:

sudo touch /etc/modprobe.d/nvidia-power.conf
sudo nano /etc/modprobe.d/nvidia-power.conf

A text window opens. Copy the below block and paste there (with Ctrl+Shift+V).

# put the below
# (NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp) helps in preserving video memory for sleep/suspend/resume,
# (modeset=1 fbdev=1) required to make Wayland work without black screen
# NVreg_EnableS0ixPowerManagement=1 : if vram usage is low, copies the data to system RAM and completely powers off the GPU's memory. If usage is high, it puts the memory into "self-refresh" mode.
# NVreg_DynamicPowerManagement=0x02 : If an app is open but hasn't touched the GPU for a short period, the driver will power the GPU down and only wake it up the millisecond the app needs it again. good to have for optimus laptop gpus
# options nvidia_drm modeset=1 fbdev=1 # do not add here if (and you should to prevent infrequent race conditions) you are adding to kernel parameters as stated below
options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp NVreg_EnableS0ixPowerManagement=1 NVreg_DynamicPowerManagement=0x02

Press Ctrl+x, then y, then enter.

Run:

# enable services
sudo systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service

Add some high priority options to kernel parameters. Add nvidia_drm.modeset=1 nvidia_drm.fbdev=1 at the end of line LINUX_OPTIONS="zswap.enabled=0 nowatchdog quiet splash" in file /etc/sdboot-manage.conf to make it LINUX_OPTIONS="zswap.enabled=0 nowatchdog quiet splash nvidia_drm.modeset=1 nvidia_drm.fbdev=1". Then run sudo sdboot-manage gen.

5. Wifi driver issues (MT7921)

Note: Nothing seemed to work, and the driver was causing freezes, preventing device sleep, etc. I have disabled it, and using my phone as wifi module with USB tethering. Yep...I know it sucks.

  1. Disable ASPM (Active State Power Management): This is the most common fix for MediaTek cards. Add mt7921e.disable_aspm=1 at the end of line LINUX_OPTIONS="zswap.enabled=0 nowatchdog quiet splash" in file /etc/sdboot-manage.conf. then run sudo sdboot-manage gen.

  2. To diable wifi module entirely, add module_blacklist=mt7921e instead. I have done this and use wifi from phone instead.

Try to fix MT7921 wifi (ASUS TUF F15 2021) by switching to iwd

https://www.reddit.com/r/cachyos/comments/1s7gl1x/wifi_mt7921_issues/

iwctl device list # to check if it's using iwd. Using iwd: You will see a table listing your wireless devices (e.g., wlan0) and their current status (e.g., "connected" or "powered on"). if not using, command will either not exist or will return an error like "Waiting for IWD to start..." or be empty under devices.
systemctl status iwd.service # to check if it's using iwd. If you are using it: The output will show Active: active (running). If it's not active: You will see inactive (dead) or an error saying the service could not be found
sudo nano /etc/NetworkManager/conf.d/iwd.conf

Add below:

[device]
wifi.backend=iwd

Press Ctrl+x, then y, then enter.

sudo systemctl mask wpa_supplicant
reboot

After reboot:

iwctl device list # to check if it's using iwd

...In my case, it didn't work. The wifi still hangs causing the system to hang.

Edit: A dkms module that appear to fix the issues can be found here along with the installation instructions. I have not tested it.

6. Get browsers' cache to RAM

Cache is one of those items that browsers need to write to... a lot. So instead of keeping it on disk (SSD) we move it to memory (RAM). A downside is that the browser's state gets cleared on every boot. So any notes you had in your favourite online notes app, that were hanging in the cache, will be no more after you reboot.

6.1. Putting the Firefox network cache into the RAM (credits to easylinuxtipsproject)

a. Type in the URL bar of Firefox:

about:config

Press Enter.

b. Now you're being presented with a warning. Ignore it and click on the button "Accept the Risk and Continue".

c. Copy/paste the following into the filter bar (search bar):

browser.cache.disk.enable

Toggle its value to false by double-clicking it: this will disable "cache to disk" entirely.

d. Now you're going to make sure that "cache to RAM" is enabled. It should be enabled by default, but verify it nevertheless. Like this: Copy/paste the following line into the filter bar (search bar):

browser.cache.memory.enable

That existing entry should already be set to true; if not, toggle it to true by double-clicking it.

e. Then you're going to determine how much memory can be used as RAM cache. Copy/paste this into the filter bar (search bar):

browser.cache.memory.capacity

That entry should exist already (if not, create it now).

The current integer value will probably be -1, which automates the maximum size of the RAM cache dependent on the available amount of RAM. So far so good, but this automation usually creates a cache that's far too small....

So set it to 524288 (KB, which equals a maximum of 512 MB) and click the Save button.

6.2. Transfer Chromium's cache hunger to RAM

tmpfs expands and contracts dynamically. You only set a maximum limit; if the directory is empty, it uses nearly zero RAM.

a. Create the mount point:

sudo mkdir -p /mnt/chrome-cache

b. Mount it dynamically: b.a. Use this command to set a 2GB maximum limit (it will only use what's needed):

sudo mount -t tmpfs -o size=2G,mode=1777 tmpfs /mnt/chrome-cache

c. Make it persistent: c.a. Add this line to /etc/fstab using a text editor:

sudo nano /etc/fstab

Add below line:

tmpfs /mnt/chrome-cache tmpfs defaults,size=2G,mode=1777 0 0

Press Ctrl+x, then y, then enter.

d. Close Chrome completely.

e. Remove existing cache. Check the folder name! It will very likely be chromium or something :

rm -rf ~/.cache/google-chrome

f. Create the symlink:

mkdir -p /mnt/chrome-cache/google-chrome
ln -s /mnt/chrome-cache/google-chrome ~/.cache/google-chrome

7. Disable UFW (Uncomplicated Firewall) logging

sudo ufw logging off

8. Update firewall rules to make sure KDE Connect works

sudo ufw allow 1714:1764/tcp
sudo ufw allow 1714:1764/udp
sudo ufw reload

9. If you have a keyboard with Numpad, turn Numlock ON on startup

Open Application Menu (press Windows key), type Keyboard. Turn NumLock on startup ON.

10. Limit journal logging

sudo nano /etc/systemd/journald.conf

Change #SystemMaxUse= to SystemMaxUse=100M
Change #SystemMaxFiles=100 to SystemMaxFiles=7
Press Ctrl+x, then y, then enter.

11. Configs

Let me know if you want my configs. They aren't fancy by any means, but are rather the standard ones.

  • mpv (uosc)
  • pipewire (bitrate)
  • vscodium (product.json)

12. Audio

Install jamesDSP via AUR (via shelly) or get easyeffects from the repos. Enable convolver with Dolby Atmos .irs. You can find the .irs file for Dolby Atmos here. JamesDSP has a very high quality output with convolver as compared to easyeffects, but it also has issues such crackling, pop, etc.

13. Undervolt Intel CPU (5th to 10th Gen)

Get Undervolt Go. It's a port of undervolt by georgewhewell in Go and has multitude of features built on top. I built it.

14. SSH setup

 ssh-keygen -t ed25519 -C "myemail@gmail.com+alias"
 eval (ssh-agent -c)
 ssh-add ~/.ssh/id_ed25519

Upload the contents of ~/.ssh/id_ed25519.pub file to GitLab, GitHub.

15. Enable tweaks from cachy hello

  1. psd
  2. systemd-oomd

16. Installed downgrade

Get downgrade package from cachyos repos. It helps you downgrade a package to a previous version. Surprisingly useful.

17. Cursor theme

Use Breeze Cursor Dark theme as it has bold borders.


Anything I should further do to make things better...?

Edit: Added numbers to headings.

u/SanmayJoshi — 20 hours ago