Nvidia cards - Ubuntu-Sway/Ubuntu-Sway-Remix GitHub Wiki

WARNING! Nvidia support in Sway is unofficial and not supported by Sway and wlroots developers! Use on your own risk, all issues related to the Nvidia in Ubuntu Sway Remix will be ignored!

Note: Starting with Ubuntu Sway Remix 23.04, the Nvidia driver configuration is automatically detected. All you have to do is install Nvidia driver itself and enable Nvidia DRM Modesetting as mentioned below.

The best result you get is using Nvidia driver 510 and above. To get latest stable Nvidia drivers use this PPA

  1. Install Nvidia driver from Additional drivers or terminal

  2. Enable Nvidia DRM Modestiing:

    • Edit /etc/default/grub, add nvidia-drm.modeset=1 parameter to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash". Should look like this:

      GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1"

    • Save config and update GRUB: sudo update-grub

  3. Add some environment variables:

    • Edit /etc/profile.d/sway.sh and add the following variables to the end of the file:

      export GBM_BACKEND=nvidia-drm

      export __GLX_VENDOR_LIBRARY_NAME=nvidia

    • If after reboot you will have an invisible cursor, also add export WLR_NO_HARDWARE_CURSORS=1 variable

  4. Pass --unsupported-gpu flag to Sway:

    • Edit /etc/greetd/config.toml and change command = "sway" to command = "sway --unsupported-gpu" like this

      [terminal] vt = "next"

      [default_session]

      command = "tuigreet --remember --time --issue --asterisks --cmd sway"

      user = "greeter"

      [initial_session]

      command = "sway --unsupported-gpu"

      user = "username"

  5. After reboot you should be able to using Sway with proprietary Nvidia driver!

2022-06-14T13 14 11,477276887+04 00