YaLTeR / niri

A scrollable-tiling Wayland compositor.
https://matrix.to/#/#niri:matrix.org
GNU General Public License v3.0
4.13k stars 123 forks source link

Failure to Switch to External Monitor (DP-4) on Niri 0.1.7 #567

Closed coleleavitt closed 3 months ago

coleleavitt commented 3 months ago

Failure to Switch to External Monitor (DP-4) & Shader Compilation Errors on Niri 0.1.7 Startup

Description

When starting Niri version 0.1.7 (v0.1.7-59-g324029c) on a system with hybrid graphics (Intel + NVIDIA), shader compilation errors occur for custom close and open shaders. This prevents proper rendering and impacts functionality (not being able to display on DP-4).

Environment

Steps to Reproduce

  1. Start Niri
  2. Attempt to set display output for DP-4 using niri msg outputs

Observed Behavior

Shader compilation errors occur for custom close and open shaders:

[GL] 0:32(25): error: niri_tex_curr' undeclared [GL] 0:32(15): error: no matching function for call to texture2D(error, vec2)'; candidates are: [GL] 0:32(15): error: vec4 texture2D(sampler2D, vec2) [GL] 0:32(15): error: vec4 texture2D(sampler2D, vec2, float)

Similar errors occur for niri_tex_next.

Expected Behavior

Shaders should compile successfully without errors, allowing proper rendering and display configuration.

Relevant Log Output

Niri Log: https://paste.rs/1vDoC.txt

Additional Context

Possible Causes

  1. Incompatibility with hybrid graphics setup
  2. Recent changes in shader compilation process or dependencies
  3. Incorrect GPU selection or initialization on startup

Proposed Solutions

  1. Review and update shader code to ensure all variables are properly declared
  2. Implement a fallback mechanism for systems with hybrid graphics
  3. Add debug logging for GPU selection and initialization process
  4. Consider adding a configuration option to force using a specific GPU

Questions for Investigation

  1. Are there any known issues with shader compilation on hybrid graphics systems?
  2. Has the shader code been modified recently to account for different GPU setups?
  3. Is there a way to force Niri to use a specific GPU (e.g., the NVIDIA GPU) for rendering?
  4. Are there any specific NVIDIA driver settings that need to be adjusted for proper Wayland/Niri compatibility?

Related Threads

https://github.com/YaLTeR/niri/issues/567

YaLTeR commented 3 months ago

for custom close and open shaders

Could you upload the config?

coleleavitt commented 3 months ago

for custom close and open shaders

Could you upload the config?

https://paste.rs/tgvVk.txt

YaLTeR commented 3 months ago

You have errors in your custom shaders:

coleleavitt commented 3 months ago

Issue was fixed, primary issue with screen tearing and artifacting:

debug {
  wait-for-frame-completion-before-queueing
}

thanks to @YaLTeR