GDM cannot launch sway when using an NVIDIA GPU

Description
GDM cannot launch sway when using an NVIDIA GPU.
sway requires a command line argument --unsupported-gpu to launch.
Fedora Workstation has a writable /usr/ partition, and thus the relevant .desktop file (/usr/share/wayland-sessions/sway.desktop can be edited to append the argument.

To Reproduce

  1. Install Fedora Silverblue
  2. Overlay the sway package
  3. Try to launch sway using the .desktop file present in /usr/share/wayland-sessions using GDM by clicking the gear icon and selecting “Sway”

Expected behavior
GDM launches the sway session using user specified command line arguments.

OS version:

State: idle
BootedDeployment:
● fedora:fedora/37/x86_64/updates/silverblue
                  Version: 37.20221119.0 (2022-11-19T02:24:07Z)
               BaseCommit: 5cb8231a9e9cf033c4c78f4e42d6e27cb8d391901a1a277c3797e81257c61669
             GPGSignature: Valid signature by ACB5EE4E831C74BB7C168D27F55AD3FB5323552A
      RemovedBasePackages: firefox firefox-langpacks 106.0.4-1.fc37
          LayeredPackages: akmod-nvidia asusctl distrobox gnome-tweaks
                           NetworkManager-strongswan-gnome rpmfusion-free-release
                           rpmfusion-nonfree-release sway waybar xorg-x11-drv-nvidia-cuda
                           xorg-x11-drv-nvidia-power

Laptop Hardware:

Hardware Model: ASUSTeK COMPUTER INC. ROG Zephyrus G14 GA401QH_GA401QH
Memory: 16.0 GiB
Processor: AMD Ryzen™ 7 5800HS with Radeon™ Graphics × 16
Graphics: NVIDIA GeForce GTX 1650 / AMD Radeon™ Graphics
OS Name: Fedora Linux 37.20221119.0 (Silverblue)

Does anyone have any suggestions as to how to run sway with GDM?

Sway runs on Wayland. If you have a video card such as some older NVIDIA cards, you cannot run Sway. Try i3 instead, which Sway actually intends to functionally replicate on Wayland.

Can you copy the desktop file over to /var/usr/local/share/wayland/sessions? (You may have to make additional directories under /var/usr/local/ to do that)

You could also look at doing something with sudo ostree admin unlock --hotfix but you’d have to re-do that every update.

1 Like

Awesome! I copied the file over to /usr/local/share/wayland-sessions/sway.desktop, made the necessary changes and launches just fine! Thanks for the help!