Environment variables for proper Wayland functionality

This is my /etc/environment for X.Org

# This file is parsed by pam_env module
DIFFPROG=/usr/bin/meld
EDITOR=/usr/bin/vim
SUDO_EDITOR=/usr/bin/vim
# Browser Parameters
##
GST_PLUGIN_FEATURE_RANK=nvmpegvideodec:MAX,nvmpeg2videodec:MAX,nvmpeg4videodec:MAX,nvh264sldec:MAX,nvh264dec:MAX,nvjpegdec:MAX,nvh265sldec:MAX,nvh265dec:MAX,nvvp9dec:MAX
GST_VAAPI_ALL_DRIVERS=1 
LIBVA_DRIVER_NAME=nvidia
MOZ_DISABLE_RDD_SANDBOX=1
##MOZ_ENABLE_WAYLAND=1
MOZ_X11_EGL=1
NVD_BACKEND=direct
OBS_USE_EGL=1
VAAPI_MPEG4_ENABLED=true
VDPAU_DRIVER=nvidia
# Gaming Parameters
##
__GL_SHADER_CACHE=1
__GL_SHADER_DISK_CACHE=1 
__GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1
__GL_ExperimentalPerfStrategy=1
DXVK_ENABLE_NVAPI=1
ENABLE_VKBASALT=0
##PIPEWIRE_LATENCY=1024/44100
PULSE_LATENCY_MSEC=60
# Proton Settings
##
PROTON_ENABLE_NGX_UPDATER=1
PROTON_ENABLE_NVAPI=1
PROTON_FORCE_LARGE_ADDRESS_AWARE=1
PROTON_HIDE_NVIDIA_GPU=0
STEAM_FORCE_DESKTOPUI_SCALING=1.25
VKD3D_CONFIG=dxr
# Display Environment
##
##CLUTTER_BACKEND=wayland
CLUTTER_DEFAULT_FPS=60
##GBM_BACKEND=nvidia-drm
GDK_BACKEND=x11
GTK_IM_MODULE=ibus
##KITTY_ENABLE_WAYLAND=1
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_IM_MODULE=ibus
QT_QPA_PLATFORMTHEME=qt5ct
SDL_VIDEODRIVER=x11
##WLR_NO_HARDWARE_CURSORS=1 
XCURSOR_THEME=Adwaita
XCURSOR_SIZE=32
XDG_SESSION_TYPE=x11
XMODIFIERS=@im=ibus

For Wayland, would this below be correct after editing?

I am trying to be meticulous and have a rock-steady setup manually geared for performance.

# This file is parsed by pam_env module
DIFFPROG=/usr/bin/meld
EDITOR=/usr/bin/vim
SUDO_EDITOR=/usr/bin/vim
# Browser Parameters
##
GST_PLUGIN_FEATURE_RANK=nvmpegvideodec:MAX,nvmpeg2videodec:MAX,nvmpeg4videodec:MAX,nvh264sldec:MAX,nvh264dec:MAX,nvjpegdec:MAX,nvh265sldec:MAX,nvh265dec:MAX,nvvp9dec:MAX
GST_VAAPI_ALL_DRIVERS=1 
LIBVA_DRIVER_NAME=nvidia
MOZ_DISABLE_RDD_SANDBOX=1
MOZ_ENABLE_WAYLAND=1
##MOZ_X11_EGL=1
NVD_BACKEND=direct
##OBS_USE_EGL=1
VAAPI_MPEG4_ENABLED=true
VDPAU_DRIVER=nvidia
# Gaming Parameters
##
__GL_SHADER_CACHE=1
__GL_SHADER_DISK_CACHE=1 
__GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1
__GL_ExperimentalPerfStrategy=1
DXVK_ENABLE_NVAPI=1
ENABLE_VKBASALT=0
##PIPEWIRE_LATENCY=1024/44100
PULSE_LATENCY_MSEC=60
# Proton Settings
##
PROTON_ENABLE_NGX_UPDATER=1
PROTON_ENABLE_NVAPI=1
PROTON_FORCE_LARGE_ADDRESS_AWARE=1
PROTON_HIDE_NVIDIA_GPU=0
STEAM_FORCE_DESKTOPUI_SCALING=1.25
VKD3D_CONFIG=dxr
# Display Environment
##
CLUTTER_BACKEND=wayland
CLUTTER_DEFAULT_FPS=60
GBM_BACKEND=nvidia-drm
GDK_BACKEND=wayland
GTK_IM_MODULE=ibus
KITTY_ENABLE_WAYLAND=1
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_IM_MODULE=ibus
QT_QPA_PLATFORMTHEME=qt5ct
SDL_VIDEODRIVER=wayland
##WLR_NO_HARDWARE_CURSORS=1 
XCURSOR_THEME=Adwaita
XCURSOR_SIZE=32
XDG_SESSION_TYPE=wayland
XMODIFIERS=@im=ibus

Primary sources were:

Other sources that I can remember:

Im not sure you should be putting all of this in /etc/environment when they are application-specific variables but

This should be removed
It was a workaround for a bug squashed … a year ago?

On to the stuff … it seems its mainly this

Which seems about right if you are trying to set hw-accel in firefox while switching from X11 to wayland.

Are there some in particular that might cause breakage or problems keeping as global rather than setting per application?

And, are the wayland specific parameters in the second group I posted generally good to keep global ?

Eh. Conceivably yes … probably and in your case … no.
Its more just that its a place ‘for system wide environment variable settings’
I suppose it wont cause an issue as long as they are ‘correct’.

Oh the rest are fine // make sense as globals (things like GDK_**, QT_**).

I dont have an nvidia to be able to say much about the specifics of a lot of them.

1 Like

In your opinion, is Wayland ready?

Also, MOZ_DISABLE_RDD_SANDBOX=1 was for vaapi configuration specifically. If this is no longer required, I need to open a ticket on the guy’s site
GitHub - elFarto/nvidia-vaapi-driver

See for example this bug which was closed:

Depends on your hardware and use-case. For some … mainly those with newer hardware, non-nvidia non-gamers … sure.

If everything works … it will likely even feel smoother than xorg.

For myself … I still use X11 … and I might tend to think thats still the better option for the majority of users.

1 Like

FYI, those have been default for awhile now with recent versions of Proton.

1 Like

I take that back, not a solution.
MOZ_DISABLE_RDD_SANDBOX=1 is still required for VAAPI.

|    0   N/A  N/A      2068    C+G   /usr/lib/firefox/firefox                    256MiB |

It isnt here or according to the bug reports…
Maybe something else is the problem?