Garuda Linux Review [KDE Dragonized (D460nized),210621] Supplement: Fixes and Enhancements

Oct. 26, 2021, 6 p.m.

Garuda Linux provides an easy to install, fully configured out-of-the box Arch installation with Btrfs system snapshot and rollback capability. A central focus of the distribution is also to make a beautiful OS that is also optimized for performance. Unfortunately, the choices made by the distribution will not be appropriate for some users. This article describes, as a supplement to Garudal Linux Review [KDE Dragonized (D460nized),210621] some of the possible fixes and enhancements to the default Garuda installation to make it more suitable for certain use cases.

Introduction

During my use of Garuda Linux KDE Dragonized (Dr460nized) Edition, I experienced numerous problems -- described in the review -- resulting from the choices made by the distribution including:

  • the usability of the default dark theme in bright environments
  • the lack of hibernation capability due to only a Zrami based swap space being configured without the possibility of specifying an additional swap space in the form of a swap partition during installation
  • the terrible battery life due to the performance enhancements enabled by default, without user choice or regard to the platform type, in the installed system
  • the configuration of Optimus Manager shipped by the distribution which modified the default upstream configuration to favor performance over battery life

Theme Related Fixes

Like some users on the Garuda forum who requested a light version of the default dark theme, but were rebuffed by the developers, I found the default dark theme provided by the distribution to be unusable in bright environments, where in some cases the text in applications was illegible. For the times it is necessary to use a light theme I installed the highly rated Aritim Light theme suite which includes a Plasma global theme, Plasma color scheme, Plasma shell theme, Aurorae (window decoration ) and a Konsole theme. It also includes a matching GTK theme, allowing a consistent look between Qt/KDE and GTK applications.

I also installed another highly rated theme, Qogir theme suite. As with Aritim Light, it has all of the Plasma desktop theming components, as well as a matching GTK theme. Unlike, Aritim, however, a Kvantum theme is available for Qogir. The images in the following set of slides shows these themes in use.

Aritim Light and Quogir Light Themes
Aritim Light and Quogir Light are highly rated light themes that provide a complete set of theming components including GTK counterparts for a consistent appearance no matter the widget toolkit used by applications.
Click on any of the thumbnails to view a slideshow of the images.

System Related Fixes

Enable Hibernation

Hibernation (suspend to disk) and hybrid sleep (suspend to RAM, then hibernate when battery is depleted) is not possible on Garuda Linux in its default state because the installation only configures a Zram for swap which can not be used for hibernation. Attempting to hibernate whether through the desktop environment's default action when battery level is critical or directly by using the systemctl hibernate command will fail

 ╭─brook@g5 in ~ took 1h14m55s
 ╰─λ sudo systemctl hibernate
[sudo] password for brook:            
Failed to hibernate system via logind: Not enough swap space for hibernation

To enable hibernation we need to add another swap space capable of being used for hibernation in the form of a swap partition and update /etc/fstab and /etc/default/grub. The following image shows the state of the system before making the necessary changes.

Add Swap Partition for Hibernation

  1. If a swap partition does not already exist from previous installations, make a partition to be used as swap. If one already exists determine its UUID and kernel assigned device name with blkid | grep swap.
     ╭─brook@g5 in ~ took 4ms
     ╰─λ sudo blkid | grep swap
    [sudo] password for brook:            
    /dev/sda8: UUID="db67ee67-01d7-494e-bc12-e5c122ffe6de" TYPE="swap" PARTUUID="3242a15f-b220-468f-94ad-6bec37d920b2"
    /dev/zram0: LABEL="zram0" UUID="1afb8efd-d68f-43f6-b63c-5d87eeb3b992" TYPE="swap"
    The output of blkid | grep swap shows that in addition to the Zram device, there is another partition formatted for swap use, in this case /dev/sda8 with a UUID of UUID="db67ee67-01d7-494e-bc12-e5c122ffe6de".
  2. View the properties of the existing Zram swap space with swapon.
     ╭─brook@g5 in ~ took 3s
     ╰─λ swapon
    NAME       TYPE       SIZE  USED PRIO
    /dev/zram0 partition 23.2G 50.5M  100
    The swapon output shows that there is only one swap device, /dev/zram0 which is the compressed block device in RAM whose use is one of the performance optimizations made by Garuda. It has a priority of 100. The priority value determines the order in which swap devices are used for paging and swapping when multiple swap devices are available on the system. Priority values can range between -1 and 32767, where a larger value represents a higher priority. So, when we enable our swap partition, we will assign it a lower swap value
  3. Edit /etc/fstab to add the swap partition by adding the line:
    UUID=db67ee67-01d7-494e-bc12-e5c122ffe6de  swap                    swap   defaults,pri=5    0  0
  4. Specify the swap partition in disk by uuid notation as the resume device in /etc/default/grub by adding resume=/dev/disk/by-uuid/db67ee67-01d7-494e-bc12-e5c122ffe6de so that the line
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0 systemd.unified_cgroup_hierarchy=1 loglevel=3 sysrq_always_enabled=1"
    becomes
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=/dev/disk/by-uuid/db67ee67-01d7-494e-bc12-e5c122ffe6de rd.udev.log_priority=3 vt.global_cursor_default=0 systemd.unified_cgroup_hierarchy=1 loglevel=3 sysrq_always_enabled=1"
  5. Update the GRUB configuration with
    grub-mkconfig -o /boot/grub/grub.cfg
    . Before the update, the configuration file, /boot/grub/grub.cfg will not have the resume kernel command line argument specified in the previous step:
    linux   /@/boot/vmlinuz-linux root=UUID=d002fda3-1a8a-4dca-89b7-7ebf7705e264 rw rootflags=subvol=@  quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0 systemd.unified_cgroup_hierarchy=1 loglevel=3 sysrq_always_enabled=1
    The command with the output:
     ╭─brook@g5 in ~ took 3m49s
     ╰─λ sudo grub-mkconfig -o /boot/grub/grub.cfg
    [sudo] password for brook:            
    Generating grub configuration file ...
    Found theme: /usr/share/grub/themes/garuda-dr460nized/theme.txt
    Found linux image: /boot/vmlinuz-linux-zen
    Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-zen.img
    Found fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-zen-fallback.img
    Found linux image: /boot/vmlinuz-linux-lts
    Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-lts.img
    Found fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-lts-fallback.img
    Found linux image: /boot/vmlinuz-linux
    Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img
    Found fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-fallback.img
    Warning: os-prober will be executed to detect other bootable partitions.
    Its output will be used to detect bootable binaries on them and create new boot entries.
    Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
    Found Garuda Linux on /dev/nvme0n1p11
    Found Arch Linux on /dev/nvme0n1p7
    Found Arch Linux on /dev/nvme0n1p7
    Found openSUSE Tumbleweed on /dev/nvme0n1p9
    Adding boot menu entry for UEFI Firmware Settings ...
    Detecting snapshots ...
    Info: Separate boot partition not detected 
    Found snapshot: 2021-10-21 17:00:01 | timeshift-btrfs/snapshots/2021-10-21_17-00-01/@
    Found snapshot: 2021-10-20 17:00:01 | timeshift-btrfs/snapshots/2021-10-20_17-00-01/@
    Found snapshot: 2021-10-19 17:00:02 | timeshift-btrfs/snapshots/2021-10-19_17-00-02/@
    Found snapshot: 2021-10-18 14:00:01 | timeshift-btrfs/snapshots/2021-10-18_14-00-01/@
    Found snapshot: 2021-09-08 20:04:02 | timeshift-btrfs/snapshots/2021-09-08_20-04-02/@
    Found snapshot: 2021-08-17 19:32:34 | timeshift-btrfs/snapshots/2021-08-17_19-32-34/@
    Found snapshot: 2021-08-17 18:55:31 | timeshift-btrfs/snapshots/2021-08-17_18-55-31/@
    Found snapshot: 2021-08-13 19:11:58 | timeshift-btrfs/snapshots/2021-08-13_19-11-58/@
    Found snapshot: 2021-08-12 14:32:25 | timeshift-btrfs/snapshots/2021-08-12_14-32-25/@
    Found 9 snapshot(s)
    Found memtest86+ image: /boot/memtest86+/memtest.bin
    /usr/bin/grub-probe: warning: unknown device type nvme0n1.
    done
    
     ╭─brook@g5 in ~ took 31s
     ╰─λ
  6. Ensure that the initramfs includes the necessary modules for resuming from hibernation. This requires editing /etc/mkinitcpio.conf to include the resume hook and regenerating the initramfs. Edit the configuration file to change
    HOOKS="base udev autodetect modconf block keyboard keymap consolefont plymouth filesystems"
    so that it becomes
    HOOKS="base udev autodetect modconf block keyboard keymap consolefont plymouth filesystems resume"
    The regenerate the initramfs for all presets present on the system with mkinitcpio -P as in:
     ╭─brook@g5 in ~ took 3m39s
     ╰─λ sudo mkinitcpio -P
    ==> Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: 'default'
      -> -k /boot/vmlinuz-linux-lts -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-lts.img
    ==> Starting build: 5.10.62-1-lts
      -> Running build hook: [base]
      -> Running build hook: [udev]
      -> Running build hook: [autodetect]
      -> Running build hook: [modconf]
      -> Running build hook: [block]
    ==> WARNING: Possibly missing firmware for module: xhci_pci
      -> Running build hook: [keyboard]
      -> Running build hook: [keymap]
      -> Running build hook: [consolefont]
      -> Running build hook: [plymouth]
      -> Running build hook: [filesystems]
      -> Running build hook: [resume]
    ==> Generating module dependencies
    ==> Creating zstd-compressed initcpio image: /boot/initramfs-linux-lts.img
    ==> Image generation successful
    ==> Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: 'fallback'
      -> -k /boot/vmlinuz-linux-lts -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-lts-fallback.img -S autodetect
    ==> Starting build: 5.10.62-1-lts
      -> Running build hook: [base]
      -> Running build hook: [udev]
      -> Running build hook: [modconf]
      -> Running build hook: [block]
    ==> WARNING: Possibly missing firmware for module: aic94xx
    ==> WARNING: Possibly missing firmware for module: wd719x
    ==> WARNING: Possibly missing firmware for module: xhci_pci
      -> Running build hook: [keyboard]
      -> Running build hook: [keymap]
      -> Running build hook: [consolefont]
      -> Running build hook: [plymouth]
      -> Running build hook: [filesystems]
      -> Running build hook: [resume]
    ==> Generating module dependencies
    ==> Creating zstd-compressed initcpio image: /boot/initramfs-linux-lts-fallback.img
    ==> Image generation successful
    ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
      -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
    ==> Starting build: 5.13.13-arch1-1
      -> Running build hook: [base]
      -> Running build hook: [udev]
      -> Running build hook: [autodetect]
      -> Running build hook: [modconf]
      -> Running build hook: [block]
    ==> WARNING: Possibly missing firmware for module: xhci_pci
      -> Running build hook: [keyboard]
      -> Running build hook: [keymap]
      -> Running build hook: [consolefont]
      -> Running build hook: [plymouth]
      -> Running build hook: [filesystems]
      -> Running build hook: [resume]
    ==> Generating module dependencies
    ==> Creating zstd-compressed initcpio image: /boot/initramfs-linux.img
    ==> Image generation successful
    ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
      -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
    ==> Starting build: 5.13.13-arch1-1
      -> Running build hook: [base]
      -> Running build hook: [udev]
      -> Running build hook: [modconf]
      -> Running build hook: [block]
    ==> WARNING: Possibly missing firmware for module: aic94xx
    ==> WARNING: Possibly missing firmware for module: wd719x
    ==> WARNING: Possibly missing firmware for module: xhci_pci
      -> Running build hook: [keyboard]
      -> Running build hook: [keymap]
      -> Running build hook: [consolefont]
      -> Running build hook: [plymouth]
      -> Running build hook: [filesystems]
      -> Running build hook: [resume]
    ==> Generating module dependencies
    ==> Creating zstd-compressed initcpio image: /boot/initramfs-linux-fallback.img
    ==> Image generation successful
    ==> Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: 'default'
      -> -k /boot/vmlinuz-linux-zen -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-zen.img
    ==> Starting build: 5.13.13-zen1-1-zen
      -> Running build hook: [base]
      -> Running build hook: [udev]
      -> Running build hook: [autodetect]
      -> Running build hook: [modconf]
      -> Running build hook: [block]
    ==> WARNING: Possibly missing firmware for module: xhci_pci
      -> Running build hook: [keyboard]
      -> Running build hook: [keymap]
      -> Running build hook: [consolefont]
      -> Running build hook: [plymouth]
      -> Running build hook: [filesystems]
      -> Running build hook: [resume]
    ==> Generating module dependencies
    ==> Creating zstd-compressed initcpio image: /boot/initramfs-linux-zen.img
    ==> Image generation successful
    ==> Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: 'fallback'
      -> -k /boot/vmlinuz-linux-zen -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-zen-fallback.img -S autodetect
    ==> Starting build: 5.13.13-zen1-1-zen
      -> Running build hook: [base]
      -> Running build hook: [udev]
      -> Running build hook: [modconf]
      -> Running build hook: [block]
    ==> WARNING: Possibly missing firmware for module: aic94xx
    ==> WARNING: Possibly missing firmware for module: wd719x
    ==> WARNING: Possibly missing firmware for module: xhci_pci
      -> Running build hook: [keyboard]
      -> Running build hook: [keymap]
      -> Running build hook: [consolefont]
      -> Running build hook: [plymouth]
      -> Running build hook: [filesystems]
      -> Running build hook: [resume]
    ==> Generating module dependencies
    ==> Creating zstd-compressed initcpio image: /boot/initramfs-linux-zen-fallback.img
    ==> Image generation successful
    

After making these changes, upon reboot the additional swap space will be available for hibernation and the kernel will be loaded with the resume parameter. The state of the system after the changes is shown in the following image.

Executing systemctl hibernate will then be successful.

kernel: PM: Image not found (code -22)

Video Related Changes

Between the time I installed Garuda using the 210406 ISO and the 210621 ISO, the distribution began including Optimus Manager in the installed system by default. As installed in Garuda, the default configuration parameter values as defined in /usr/share/optimus-manager.conf differ from the upstream default values. Specifically the startup_mode parameter value is changed from "integrated" to "hybrid". When this parameter is set to "hybrid" it allows the Nvidia driver to control power management of the Nvidia GPU when the dynamic_power_management parameter value is set to either "fine" or "coarse"[1]. This experimental power management feature of the Nvidia driver for Linux is only compatible with a combination of a Turing generation or later Nvidia GPUs and Intel Coffee Lake and newer processors. So, for users with older GPUs, such as the 1050 Ti Mobile GPU, which I have, this parameter value is not only irrelevant, but without modifying the default value of the switching parameter, the Nvidia GPU will always be powered on, which may not be desirable for users who primarily value battery life.

Even without Garuda's changes to the default configuration, the configuration of Optimus Manager must be modified to suit the user's needs. As the power management guide of Optimus Manager states:

The whole point of the Optimus technology in laptops is that your Nvidia GPU can be turned off when you are not using it, resulting in significant power savings. Optimus Manager supports several ways to control the power state of the Nvidia GPU, however since v1.2 they are all disabled by default. The reason for this choice is that pretty much every laptop model model requires a specific method, and using the wrong one can lead to complete system lockups, weird driver issues, or unexpected reboots.

So, for my system and systems with older Nvidia GPUs, it is necessary to modify the Optimus Manager configuration to use one of the available external power management methods -- as described on thethe power management guide of Optimus Manager besides those built into the Nvidia driver. Also, on my Dell G5, only the Nvidia card is wired to the HDMI port, an unfortunate choice on the part of Dell for Linux users because it is impossible to plug in an external monitor to the computer while the Intel card is the current GPU in use and continue working without interruption. The GPU in use must be switched requiring a session restart. Because I almost never need the benefits of the GPU and prefer not to have to log out, when I plug in my Dell to an external monitor, and to use it as an external power management method for the Nvidia GPU, I also usually install the open source Nouveau driver when installing Optimus Manager as suggested by the Optimus Manager wiki. For the times I move from an environment where external power and a monitor is not available to one where both are available, I can just plug in the monitor and continue to work without switching and re-logging in. In Garuda's case all video drivers are installed even for hardware not on the system, so it is not necessary to manually install the xf86-video-nouvear package.

Edit Optimus Manager Configuration

  1. Copy the default distributed configuration file to the local system configuration directory.
    sudo cp /usr/share/optimus-manager.conf /etc/optimus-manager/optimus-manager.conf
    The above command copies the distributed configuration file so that the local copy can be edited to override the distribution's defaults.
  2. Under the [optimus] section of the newly created /etc/optimus-manager/optimus-manager.conf: Change
    switching=none
    to
    switching=nouveau
    This will enable the Nouveau driver to control power management of the Nvidia GPU.
  3. Under the [optimus] section: Change
    pci_power_control=no
    to
    pci_power_control=yes
  4. Under the [optimus] section: Change
    startup_mode=hybrid
    to
    startup_mode=integrated
    This will ensure that the Intel card will be the one in use by default, since battery life is usually more important in my case than GPU performance.
  5. Under the [optimus] section: Change
    startup_auto_extpower_mode=nvidia
    to
    startup_auto_extpower_mode=nvidia
    This last change is not strictly necessary since the parameter is only valid when startup_mode us set to "auto".
  6. Under the [intel] section: Change
    driver=modesetting
    to
    driver=intel
    This last change is not necessary, but may work better.

The distribution sets an option for the Nvidia driver which is incompatible with Nvidia GPUs older than the Turing generation. In /etc/modprobe.d/mhwd-gpu.conf, the line

options nvidia "NVreg_DynamicPowerManagement=0x02"

sets the driver option "NVreg_DynamicPowerManagement" is set to a value that is equivalent to setting the dynamic_power_management option in the Optimus Manager configuration to "fine", a value inconsistent with the setting the default configuration, even as shipped by Garuda . I changed this line to set a value consustent with the Optimus Manager configuration.

options nvidia "NVreg_DynamicPowerManagement=0x00"

Prevent Blacklisting of Nouveau

As mentioned before, installing the xf86-video-nouveau package is not necessary, but making some changes to configuration files is necessary. Copy the module option configuration files owned by the optimus-manager and nvidia-dkms packages to the local system override directories.

sudo cp /usr/lib/modprobe.d/nvidia-dkms.conf /etc/modprobe.d/nvidia-dkms.conf
sudo cp /usr/lib/modprobe.d/optimus-manager.conf /etc/modprobe.d/optimus-manager.conf

In the file /etc/modprobe.d/nvidia-dkms.conf change

blacklist nouveau
to
#blacklist nouveau

In the file /etc/modprobe.d/optimus-manager.conf change

blacklist nouveau
to
#blacklist nouveau

Battery Life Related Fixes

In the review of Garuda, to which this article is a supplement, I found that one of the problems I experienced in my use of the distribution was the terrible battery life -- less than half of that on my Arch installation which was the subject of Arch Linux Review [20190701 Bootstrap Image]. I made the following changes to the default installed system to increase the battery life.

Uninstall the performance-tweaks Package

In Section Review -> Performance Enhancements -> Energy Related Performance Settings of the review, the effect of the performance-tweaks package and how the files it adds to the system work to increase performance while at the same time reducing battery life. One of the aspects of the distribution I didn't like, as mentioned in the review, is that this package and some others are installed without regard to to the platform, i.e, whether the computer on which the distribution is installed is a laptop, where battery life should be a consideration.

Install the Default Arch Kernel

I installed the default Arch Linux kernel package linux, as well as linux-headers, necessary for the DKMS kernel modules, such as nvidia-dkms, which is installed by default, and virtualbox-host-dkms.

Install TLP

I installed TLP, the mature and widely used utility for maximizing battery life. I actually installed the tlp package directly using pacman, but the Garuda Assistant Settings module has a checkbox to install it (shown below). The assistant also has a checkbox to enable the service, which I did use later because I had forgotten to enable the service when I installed it.

The Settings Tab of Garuda Assistant
The Powersave tweaks section of the tab allows easy installation of components to enhance battery life.

Install powersave-tweaks Package

Garuda provides the powersave-tweaks package -- installable from the Powersave Tweaks section of the Garuda Assistant Settings tab (shown in the previous image) -- which sets values of some of the same configuration items as the performance-tweaks package (using the tempfiles system described in the review), but at the opposite end of the performance/power-saving spectrum. The image below shows that it sets the CPU scaling governor to "powersave" and the energy/performance preference to "balance_power". The package also attempts to set the ASPM policy to "powersave", however, although ASPM is supported on the G5, verified with:

 ╭─brook@g5 in repo: content on  exp [!?] took 45ms
 ╰─λ journalctl -b | grep ASPM
Oct 25 10:43:00 g5-garuda kernel: acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3]

the policy remains as "default":

 ╭─brook@g5 in ~ took 4ms
[🔴] × cat /sys/module/pcie_aspm/parameters/policy
[default] performance powersave powersupersave

Files Added to the System by powersave-tweaks

Usability Related Fixes

Spell Checking

The necessary packages to enable spell checking in applications, such as Kate and Kwrite KDE's text editors, and other applications need to be installed. Installing aspell and its associated language plug-in aspell-en, for English, and hunspell and its associated language plug-in hunspell-en_US fixed the problem with spell checking.

`

Conclusion

As mentioned in the review, Garuda Linux is not the typical Arch Linux based distribution, including number of opinionated optimizations and customizations, as well as distribution developed GUI tools for system administration. These optimizations and customizations may not be suitable for all users, and can be easily modified, as shown in this article for certain components.

Notes:

  1. [1]

    Although, as I currently write this, it seems that on at least one of my installations, the Optimus Manager dynamic_power_management parameter was set to "fine". I assume this setting was modified post-installation by some pacman hook which is no longer part of the system. A Garuda system installed from the latest ISO seems to include a new package named garuda-nvidia-config (renamed from garuda-graphics-config) which includes pacman hook to set the dynamic_power_management parameter value to "fine (shown in the image below).

blog comments powered by Disqus