Display settings resets on reboot

Hello! I recently swapped to Garuda Sway on my laptop, and upon finding the experience extremely pleasant I figured I'd swap on my pc as well, unfortunately I've encountered some hiccups here.

not my main issue right now since I'm fine running nouveau drivers (unless it's a major performance hit?) but installing using the proprietary drivers would result in getting stuck at "loading initial ramdisk"

What I'm here for right now though is, when opening wdisplays to change layout and hz of my displays they will always reset upon a reboot. I would prefer this to not happen as it gets quite tedious to do each and every single time I start my pc :confused:

System:
  Kernel: 6.4.12-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    clocksource: tsc available: hpet,acpi_pm
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=8cffa0d9-d753-4220-b180-e9e155736055 rw rootflags=subvol=@
    quiet quiet rd.udev.log_priority=3 vt.global_cursor_default=0 loglevel=3
    ibt=off
  Desktop: sway v: 1.8.1 info: waybar vt: 1 dm: greetd Distro: Garuda Linux
    base: Arch Linux
Machine:
  Type: Desktop System: Micro-Star product: MS-7B86 v: 3.0
    serial: <superuser required>
  Mobo: Micro-Star model: B450 GAMING PLUS MAX (MS-7B86) v: 3.0
    serial: <superuser required> UEFI: American Megatrends v: H.60
    date: 04/18/2020
Battery:
  ID-1: hidpp_battery_0 charge: 72% condition: N/A volts: 3.9 min: N/A
    model: Logitech G Pro Wireless Gaming Mouse type: N/A serial: <filter>
    status: discharging
CPU:
  Info: model: AMD Ryzen 7 3800X bits: 64 type: MT MCP arch: Zen 2 gen: 3
    level: v3 note: check built: 2020-22 process: TSMC n7 (7nm)
    family: 0x17 (23) model-id: 0x71 (113) stepping: 0 microcode: 0x8701021
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB
    L3: 32 MiB desc: 2x16 MiB
  Speed (MHz): avg: 3901 high: 3931 min/max: 2200/4654 boost: enabled
    scaling: driver: acpi-cpufreq governor: performance cores: 1: 3900 2: 3900
    3: 3900 4: 3900 5: 3900 6: 3900 7: 3900 8: 3900 9: 3900 10: 3931 11: 3900
    12: 3900 13: 3900 14: 3900 15: 3900 16: 3900 bogomips: 124801
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
Graphics:
  Device-1: NVIDIA TU104 [GeForce RTX 2060] vendor: ASUSTeK driver: nouveau
    v: kernel non-free: 535.xx+ status: current (as of 2023-08) arch: Turing
    code: TUxxx process: TSMC 12nm FF built: 2018-22 pcie: gen: 1
    speed: 2.5 GT/s lanes: 16 link-max: gen: 3 speed: 8 GT/s ports:
    active: DP-1,DVI-D-1,HDMI-A-2 empty: HDMI-A-1 bus-ID: 26:00.0
    chip-ID: 10de:1e89 class-ID: 0300 temp: 57.0 C
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.2.0
    compositor: sway v: 1.8.1 driver: gpu: nouveau d-rect: 6400x3240
    display-ID: 1
  Monitor-1: DP-1 pos: bottom-l model: Mi 30 HFCW serial: <filter>
    built: 2022 res: 2560x1080 hz: 200 dpi: 94 gamma: 1.2 scale: 1
    size: 690x291mm (27.17x11.46") diag: 749mm (29.5") modes: max: 2560x1080
    min: 720x400
  Monitor-2: DVI-D-1 pos: middle-r model: BenQ XL2411Z serial: <filter>
    built: 2014 res: 1920x1080 hz: 60 dpi: 92 gamma: 1.2 scale: 1
    size: 531x298mm (20.91x11.73") diag: 609mm (24") ratio: 16:9 modes:
    max: 1920x1080 min: 720x400
  Monitor-3: HDMI-A-2 pos: top-center model: Asus VE247 serial: <filter>
    built: 2013 res: 1920x1080 hz: 60 dpi: 92 gamma: 1.2 scale: 1
    size: 531x299mm (20.91x11.77") diag: 609mm (24") ratio: 16:9 modes:
    max: 1920x1080 min: 720x400
  API: EGL/GBM Message: No known Wayland EGL/GBM data sources.
Audio:
  Device-1: NVIDIA TU104 HD Audio vendor: ASUSTeK driver: snd_hda_intel
    v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3
    speed: 8 GT/s bus-ID: 26:00.1 chip-ID: 10de:10f8 class-ID: 0403
  Device-2: AMD Starship/Matisse HD Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 28:00.4 chip-ID: 1022:1487 class-ID: 0403
  Device-3: Realtek Audio USB driver: snd-usb-audio type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-9:6 chip-ID: 0bda:4938
    class-ID: 0102 serial: <filter>
  API: ALSA v: k6.4.12-zen1-1-zen status: kernel-api tools: N/A
  Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
  Server-2: PipeWire v: 0.3.78 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Micro-Star MSI driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: f000 bus-ID: 22:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp34s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Broadcom BCM4360 802.11ac Wireless Network Adapter
    vendor: ASUSTeK driver: wl v: kernel modules: bcma pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 bus-ID: 25:00.0 chip-ID: 14e4:43a0 class-ID: 0280
  IF: wlp37s0 state: dormant mac: <filter>
Drives:
  Local Storage: total: 2.52 TiB used: 14.74 GiB (0.6%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Kingston model: SKC2500M8500G
    size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: S7780101 temp: 44.9 C
    scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 750 EVO 250GB
    size: 232.89 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: 1B6Q scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 vendor: Seagate model: ST2000DM008-2UB102
    size: 1.82 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    tech: HDD rpm: 7200 serial: <filter> fw-rev: 0001 scheme: GPT
  ID-4: /dev/sdc maj-min: 8:32 vendor: Kingston model: DataTraveler 3.0
    size: 14.41 GiB block-size: physical: 512 B logical: 512 B type: USB
    rev: 3.1 spd: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 tech: N/A serial: <filter>
    scheme: MBR
Partition:
  ID-1: / raw-size: 465.46 GiB size: 465.46 GiB (100.00%)
    used: 14.73 GiB (3.2%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 576 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 465.46 GiB size: 465.46 GiB (100.00%)
    used: 14.73 GiB (3.2%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 465.46 GiB size: 465.46 GiB (100.00%)
    used: 14.73 GiB (3.2%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 465.46 GiB size: 465.46 GiB (100.00%)
    used: 14.73 GiB (3.2%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: zram size: 15.56 GiB used: 0 KiB (0.0%) priority: 100
    comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 16 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 61.1 C mobo: N/A gpu: nouveau temp: 57.0 C
  Fan Speeds (rpm): N/A gpu: nouveau fan: 0
Info:
  Processes: 482 Uptime: 8m wakeups: 2 Memory: total: 16 GiB
  available: 15.56 GiB used: 1.76 GiB (11.3%) Init: systemd v: 254
  default: graphical tool: systemctl Compilers: gcc: 13.2.1 Packages:
  pm: pacman pkgs: 1381 libs: 380 tools: pamac,paru Shell: fish v: 3.6.1
  running-in: alacritty inxi: 3.3.29
Garuda (2.6.16-1):
  System install date:     2023-08-31
  Last full system update: 2023-08-31
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager dracut
  Windows dual boot:       No/Undetected
  Failed units:

A special flag needs to be set to run Sway on Nvidia hardware. See the note in the ArchWiki here:

Note: All proprietary graphics drivers are not supported, including NVIDIA. After NVIDIA driver version 495, sway works if you enable kernel mode setting and run sway with --unsupported-gpu.

You can add this flag to the “command =” line in /etc/greetd/config.toml.

command = "sway --unsupported-gpu --config /etc/greetd/swayconfig > /dev/null 2>&1"

I believe this is the expected behavior for wdisplays, see here:

I’m using Sway, why aren’t my display settings saved when I log out?

Sway, like i3, doesn’t save any settings unless you put them in the config file. See man sway-output. If you want to have multiple configurations depending on the monitors connected, you’ll need to use an external program like kanshi. Integration with that and other external daemons is planned.

I thought the Sway image was using the far superior nwg-displays though? With nwg-displays it saves a config file for you, and you can just call it in your Sway config. See here:

sway

The configuration saved to a file may be easily used in the sway config:

...
include ~/.config/sway/outputs
...

The program also saves the ~/.config/sway/workspaces file, which defines the workspace → output associations.

workspace 1 output DP-1
workspace 2 output DP-1
workspace 3 output DP-1
workspace 4 output eDP-1
workspace 5 output eDP-1
workspace 6 output eDP-1
workspace 7 output HDMI-A-1
workspace 8 output HDMI-A-1

You may include it in the sway config file, instead of editing associations manually:

...
include ~/.config/sway/workspaces
...

Use --generic_names if your output names happen to be different on every restart, e.g. when you use Thunderbolt outputs.

Use --num_ws if you use workspaces in a number other than 8.


EDIT

This thread has a few additional suggestions for running Sway on Nvidia hardware if you’d like to take a look: Some workarounds to use Sway with Nvidia - r/swaywm

Some workarounds to use Sway with Nvidia Guide

  • Set WLR_RENDERER=vulkan (If not, the screen flickers)
  • Set WLR_NO_HARDWARE_CURSORS=1 (If not, you can’t see your cursors)
  • Set XWAYLAND_NO_GLAMOR=1 (If not, windows under XWayland flicker)
  • Disable “Hardware Acceleration” setting in Discord (If not, the Discord window will be blank)
2 Likes

Thank you for the quick reply! I've been fiddling around and finally got it to work, however I'm now stuck in a login loop! entering my password upon boot will send me straight back to the login gui. However, if I instead use ctrl+alt+f2 and manually do sway --unsupported-gpu It'll work just fine. As you instructed earlier I've already added the flag in /etc/greetd/config.toml

I'm wondering if the Sway command should be quoted. :thinking:

command = "'sway --unsupported-gpu' --config /etc/greetd/swayconfig > /dev/null 2>&1"

Any clues in the journal?

journalctl -u display-manager

Apparently the journal is empty :confused:

╭─ayr@ayr in ~ as :mage: took 2ms
╰─λ journalctl -u display-manager
– No entries –

Could be? how it was before I added --unsupported-gpu was command = "sway --config /etc/greetd/swayconfig > /dev/null 2>&1" without the ’ so it seems unlikely from my uneducated pov

On another note, am I still supposed to be using wdisplays when adjusting position and such of monitors? I thought that would be in Nvidia X server settings but upon inspection, there’s nothing of the sort in there

Huh, that’s weird. What about if you specifically run against greetd?

journalctl -u greetd.service

There should be two single quotes. I am suggesting wrapping sway --unsupported-gpu in single quotes, within the double-quoted line.

Change this:

sway

to this:

'sway --unsupported-gpu'

command = "'sway --unsupported-gpu' --config /etc/greetd/swayconfig > /dev/null 2>&1"
1 Like

Running against greetd gave this;

EDIT: the entry for sep 01 00:39:30 might be unrelated as I think that’s the one where I got stuck at ramdisk. The newer entry for sep 01 00:42:32 is the current session.

-- Boot ee16f69d3ad5479a88a407ca1ef6b52b --
sep 01 00:42:32 ayr-ms7b86 systemd[1]: Started Greeter daemon.
sep 01 00:42:32 ayr-ms7b86 greetd[879]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: Specific(1), s>
sep 01 00:42:32 ayr-ms7b86 greetd[880]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch: >
sep 01 00:42:32 ayr-ms7b86 greetd[880]: pam_unix(greetd:session): session opened for user greeter(uid=966) by greeter(uid>
sep 01 00:42:45 ayr-ms7b86 greetd[1017]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch:>
sep 01 00:42:46 ayr-ms7b86 greetd[1017]: pam_unix(greetd:session): session opened for user ayr(uid=1000) by ayr(uid=0)
sep 01 00:42:46 ayr-ms7b86 greetd[1017]: pam_unix(greetd:session): session closed for user ayr
sep 01 00:42:47 ayr-ms7b86 greetd[1330]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch:>
sep 01 00:42:47 ayr-ms7b86 greetd[1330]: pam_unix(greetd:session): session opened for user greeter(uid=966) by greeter(ui>
sep 01 00:42:52 ayr-ms7b86 greetd[1378]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch:>
sep 01 00:42:53 ayr-ms7b86 greetd[1378]: pam_unix(greetd:session): session opened for user ayr(uid=1000) by ayr(uid=0)
sep 01 00:42:53 ayr-ms7b86 greetd[1378]: pam_unix(greetd:session): session closed for user ayr
sep 01 00:42:54 ayr-ms7b86 greetd[1399]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch:>
sep 01 00:42:54 ayr-ms7b86 greetd[1399]: pam_unix(greetd:session): session opened for user greeter(uid=966) by greeter(ui>
lines 267-309/309 (END)
-- Boot 8558071afbf14a1e92127ac65f7f2526 --
sep 01 00:39:30 ayr-ms7b86 systemd[1]: Started Greeter daemon.
sep 01 00:39:30 ayr-ms7b86 greetd[877]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: Specific(1), s>
sep 01 00:39:30 ayr-ms7b86 greetd[878]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch: >
sep 01 00:39:30 ayr-ms7b86 greetd[878]: pam_unix(greetd:session): session opened for user greeter(uid=966) by greeter(uid>
sep 01 00:39:31 ayr-ms7b86 greetd[878]: pam_unix(greetd:session): session closed for user greeter
sep 01 00:39:31 ayr-ms7b86 greetd[877]: error: check_children: greeter exited without creating a session
sep 01 00:39:31 ayr-ms7b86 systemd[1]: greetd.service: Deactivated successfully.
sep 01 00:39:32 ayr-ms7b86 systemd[1]: greetd.service: Scheduled restart job, restart counter is at 1.
sep 01 00:39:32 ayr-ms7b86 systemd[1]: Started Greeter daemon.
sep 01 00:39:32 ayr-ms7b86 greetd[934]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: Specific(1), s>
sep 01 00:39:32 ayr-ms7b86 greetd[935]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch: >
sep 01 00:39:32 ayr-ms7b86 greetd[935]: pam_unix(greetd:session): session opened for user greeter(uid=966) by greeter(uid>
sep 01 00:39:32 ayr-ms7b86 greetd[935]: pam_unix(greetd:session): session closed for user greeter
sep 01 00:39:32 ayr-ms7b86 greetd[934]: error: check_children: greeter exited without creating a session
sep 01 00:39:32 ayr-ms7b86 systemd[1]: greetd.service: Deactivated successfully.
sep 01 00:39:33 ayr-ms7b86 systemd[1]: greetd.service: Scheduled restart job, restart counter is at 2.
sep 01 00:39:33 ayr-ms7b86 systemd[1]: Started Greeter daemon.
sep 01 00:39:33 ayr-ms7b86 greetd[946]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: Specific(1), s>
sep 01 00:39:33 ayr-ms7b86 greetd[947]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch: >
sep 01 00:39:33 ayr-ms7b86 greetd[947]: pam_unix(greetd:session): session opened for user greeter(uid=966) by greeter(uid>
sep 01 00:39:33 ayr-ms7b86 greetd[947]: pam_unix(greetd:session): session closed for user greeter
sep 01 00:39:33 ayr-ms7b86 greetd[946]: error: check_children: greeter exited without creating a session
sep 01 00:39:33 ayr-ms7b86 systemd[1]: greetd.service: Deactivated successfully.
sep 01 00:39:34 ayr-ms7b86 systemd[1]: greetd.service: Scheduled restart job, restart counter is at 3.
sep 01 00:39:34 ayr-ms7b86 systemd[1]: Started Greeter daemon.
sep 01 00:39:34 ayr-ms7b86 greetd[958]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: Specific(1), s>
sep 01 00:39:34 ayr-ms7b86 greetd[959]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch: >
sep 01 00:39:34 ayr-ms7b86 greetd[959]: pam_unix(greetd:session): session opened for user greeter(uid=966) by greeter(uid>
sep 01 00:39:34 ayr-ms7b86 greetd[959]: pam_unix(greetd:session): session closed for user greeter
sep 01 00:39:34 ayr-ms7b86 greetd[958]: error: check_children: greeter exited without creating a session
sep 01 00:39:34 ayr-ms7b86 systemd[1]: greetd.service: Deactivated successfully.
sep 01 00:39:35 ayr-ms7b86 systemd[1]: greetd.service: Scheduled restart job, restart counter is at 4.
sep 01 00:39:35 ayr-ms7b86 systemd[1]: Started Greeter daemon.
sep 01 00:39:35 ayr-ms7b86 greetd[979]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: Specific(1), s>
sep 01 00:39:35 ayr-ms7b86 greetd[980]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch: >
sep 01 00:39:35 ayr-ms7b86 greetd[980]: pam_unix(greetd:session): session opened for user greeter(uid=966) by greeter(uid>
sep 01 00:39:35 ayr-ms7b86 greetd[980]: pam_unix(greetd:session): session closed for user greeter
sep 01 00:39:35 ayr-ms7b86 greetd[979]: error: check_children: greeter exited without creating a session
sep 01 00:39:35 ayr-ms7b86 systemd[1]: greetd.service: Deactivated successfully.
sep 01 00:39:37 ayr-ms7b86 systemd[1]: greetd.service: Scheduled restart job, restart counter is at 5.
sep 01 00:39:37 ayr-ms7b86 systemd[1]: greetd.service: Start request repeated too quickly.
sep 01 00:39:37 ayr-ms7b86 systemd[1]: greetd.service: Failed with result 'start-limit-hit'.
sep 01 00:39:37 ayr-ms7b86 systemd[1]: Failed to start Greeter daemon.

wrapping it in single quotes got me stuck at loading initial ramdisk without even getting to the login gui

Please use the “preformatted text” button (looks like this: </>) for terminal output, instead of the blockquote button (looks like this: "). I edited your last couple ones. It makes the terminal output a lot easier to read because it keeps the line breaks how they would be in a console.


Let’s try this:

sudo micro /usr/local/bin/sway_gpu

Paste into the file:

#!/bin/bash

exec sway --unsupported-gpu

Save and exit.

Make the file executable:

sudo chmod +x /usr/local/bin/sway_gpu

Edit /etc/greetd/config.toml to call sway_gpu instead of sway.

command = "sway_gpu --config /etc/greetd/swayconfig > /dev/null 2>&1"

Reboot and test. :crossed_fingers:

3 Likes

Oh, my apologies! I’ll use it moving forward!

Luckily that worked just fine! Thank you for being so patient with me!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.