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.
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:
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.
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.
╭─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".
╭─brook@g5 in ~ took 3s ╰─λ swapon NAME TYPE SIZE USED PRIO /dev/zram0 partition 23.2G 50.5M 100The 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
UUID=db67ee67-01d7-494e-bc12-e5c122ffe6de swap swap defaults,pri=5 0 0
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"
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=1The 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 ╰─λ
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)
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 the the 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.
sudo cp /usr/share/optimus-manager.conf /etc/optimus-manager/optimus-manager.confThe above command copies the distributed configuration file so that the local copy can be edited to override the distribution's defaults.
[optimus]
section of the newly created /etc/optimus-manager/optimus-manager.conf:
Change
switching=noneto
switching=nouveauThis will enable the Nouveau driver to control power management of the Nvidia GPU.
[optimus]
section:
Change
pci_power_control=noto
pci_power_control=yes
[optimus]
section:
Change
startup_mode=hybridto
startup_mode=integratedThis 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.
[optimus]
section:
Change
startup_auto_extpower_mode=nvidiato
startup_auto_extpower_mode=nvidiaThis last change is not strictly necessary since the parameter is only valid when startup_mode us set to "auto".
[intel]
section:
Change
driver=modesettingto
driver=intelThis 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"
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 nouveauto
#blacklist nouveau
In the file /etc/modprobe.d/optimus-manager.conf change
blacklist nouveauto
#blacklist nouveau
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.
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.
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.
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.
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
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.
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.
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).