---
title: 'NVIDIA-DKMS sway Config'
url: 'https://willifix.net/blog/nvidia-dkms-sway-config'
markdown: 'https://willifix.net/blog/nvidia-dkms-sway-config.md'
date: '2024-04-01'
description: 'One of my daily companions is sway. sway is a tiling window manager that best meets my daily needs https://github.com/swaywm.A really good introduction to the world of Tiling Window Managers is this video: Unfortunately, I have an Nvidia graphics card installed in my current notebo…'
---

# NVIDIA-DKMS sway Config

## [NVIDIA-DKMS sway Config](https://willifix.net/blog/nvidia-dkms-sway-config)

    1st Apr 2024  

One of my daily companions is sway. sway is a tiling window manager that best meets my daily needs <https://github.com/swaywm>.A really good introduction to the world of Tiling Window Managers is this video:

Unfortunately, I have an Nvidia graphics card installed in my current notebook. Until some time ago, Nvidia only had a proprietary driver for Linux. Now there is better support thanks to <https://github.com/NVIDIA/open-gpu-kernel-modules>

To get the nvidia working with sway i have to setup some Environment-Variables. I use Archlinux and there is a nice way under arch to do that.

#### Vars

As root on a archlinux open `/etc/environment` and add the needed vars:

```bash
 #
 # This file is parsed by pam_env module
 #
 # Syntax: simple "KEY=VAL" pairs on separate lines
 #
 # working well
 _JAVA_AWT_WM_NONREPAINTING=1
 XDG_SESSION_TYPE=wayland
 XDG_CURRENT_DESKTOP=sway
 XDG_SESSION_DESKTOP=sway
 WLR_NO_HARDWARE_CURSORS=1
 QT_QPA_PLATFORMTHEME=wayland;xcb
 QT_WAYLAND_DISABLE_WINDOWDECORATION=1
 # Mozilla Stuff
 MOZ_ENABLE_WAYLAND=1
 MOZ_USE_XINPUT2=1
 # MOZ_DISABLE_RDD_SANDBOX=1
 # vaapi tweaks
 # NVD_BACKEND=direct
 # sway stuff 
 # ENABLE_VKBASALT=1
 # If the following is enabled then Firefox vaapi is broken (video playback crashes and PDF Preview broken) see /usr/bin/firefox
 GBM_BACKEND=nvidia-drm
 # WLR_RENDERER=vulkan
  # __GLX_VENDOR_LIBRARY_NAME=nvidia
  # __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json
  # LIBVA_DRIVER_NAME=iHD

 #testen mit usb4
 #WLR_DRM_NO_ATOMIC=1
```

Some vars are disabled because they are not needed on my system or they have some issues with my card.

#### Firefox crashes sometimes

If you have issues with Firefox then try this hack

```bash
awk 'NR==2 {print "GBM_BACKEND=iHD"}7' /usr/bin/firefox
```

 [ Previous Post](https://willifix.net/blog/filebeat-bind-plugin) [Next Post ](https://willifix.net/blog/waybar-vpn-toggler)

---

## Navigation

- Parent: [Blog](https://willifix.net/blog.md)
- Previous: [waybar vpn toggler](https://willifix.net/blog/waybar-vpn-toggler.md)
- Next: [filebeat bind plugin](https://willifix.net/blog/filebeat-bind-plugin.md)
