How does niri handle multi-gpu display output?
Thanks a lot for this amazing project, appreciate this a ton!
I happen to have a hybrid GPU setup on my laptop( i.e. Nvidia+AMD) and I have confirmed that my display output is wired to my Nvidia card. I cannot seem to determine, though, what is the name of my display output for my HDMI port(I think it is HDMI-A-1, but not much help regardless).
Hence I am having some trouble setting up multi-displays. KDE seems to pick this up nicely, but there seems to be no detection from niri. I will be attaching some relevant logs below.
Niri is launched using: niri-session
System Information
- niri version: niri 0.1.7 (v0.1.7-46-ge98d1ec)
- Distro: Arch 6.9.9-arch1-1
- dGPU: Nvidia GTX 1650 (mobile)
- iGPU: AMD Radeon Graphics
- CPU: AMD Ryzen 5 5600H
Output of wlr-randr (regardless of HDMI being plugged in)
eDP-1 "11_24_6 - 22425 - eDP-1"
Make: 11_24_6
Model: 22425
Serial: (null)
Physical size: 340x190 mm
Enabled: yes
Modes:
1920x1080 px, 60.056000 Hz (preferred, current)
1920x1080 px, 40.036999 Hz
1680x1050 px, 60.056000 Hz
1280x1024 px, 60.056000 Hz
1440x900 px, 60.056000 Hz
1280x800 px, 60.056000 Hz
1280x720 px, 60.056000 Hz
1024x768 px, 60.056000 Hz
800x600 px, 60.056000 Hz
640x480 px, 60.056000 Hz
Position: 0,0
Transform: normal
Scale: 1.000000
Adaptive Sync: disabled
Output of ls /sys/class/drm/
card0 card0-eDP-1 card1-HDMI-A-1 renderD129
card0-DP-1 card1 renderD128 version
Note that card1 refers to Nvidia
Please do let me know if further info is needed!
Hey, niri will try to turn on all monitors by default. If you're not seeing it then it couldn't even get to that point. I'm gonna guess it's related to nvidia; have you tried the nvidia suggestions from the getting started wiki page?
hello
I am not confident abt this being a driver issue, as i alr have enabled modesetting and as stated in my post, KDE seems to detect my external display just fine when i connect via my HDMI port on the same setup
at best i do notice a slight glow on my monitor, but no signal for my display
here is what i have in my config related to displays
output "eDP-1" {
mode "[email protected]"
// scale 1.00
transform "normal"
position x=0 y=0
}
output "HDMI-A-1" {
mode "[email protected]"
transform "normal"
// ...settings for HDMI-A-1...
}
note that i am not confident abt HDMI-A-1 output matching the refresh rate, so idk if that is the culprit here
After i remove the stuff for HDMI-A-1 from the config, i do get a 50hz signal on my monitor, but it is entirely blank
Can you upload the output of niri (i.e. journalctl -eb /usr/bin/niri) and also niri msg outputs?
journalctl -eb /usr/bin/niri
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.137520Z INFO niri: starting version 0.1.7 (v0.1.7-46-ge98d1ec)
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.167634Z DEBUG niri_config: loaded config from "/home/vigu/.config/niri/config.kdl"
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.310479Z INFO niri::backend::tty: using as the render node: "/dev/dri/renderD128"
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.548773Z DEBUG niri::backend::tty: device added: 57857 "/dev/dri/card1"
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.572620Z WARN niri::backend::tty: error adding device: Failed to initialize EGL. Err: EGL is not initialized, or could not be initialized, for the specified EGL display connection.
Jul 19 11:27:17 vigu niri[1258]: Caused by:
Jul 19 11:27:17 vigu niri[1258]: EGL is not initialized, or could not be initialized, for the specified EGL display connection.
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.572666Z DEBUG niri::backend::tty: device added: 57856 "/dev/dri/card0"
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.894485Z DEBUG niri::backend::tty: this is the primary node
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.894514Z DEBUG niri::backend::tty: this is the primary render node
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.959057Z DEBUG niri::backend::tty: device changed: 57856
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.985429Z DEBUG niri::backend::tty: connecting connector: eDP-1
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.985566Z WARN niri::backend::tty: configured mode [email protected] could not be found, falling back to preferred
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.985597Z DEBUG niri::backend::tty: picking mode: Mode { name: "1920x1080", clock: 141000, size: (1920, 1080), hsync: (2028, 2076, 2100), vsync: (1090, 1100, 1118), hskew: 0, vscan: 0, vrefresh: 60, mode_type: ModeTypeFlags(PREFERRED | DRIVER) }
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.985705Z DEBUG niri::backend::tty: set max bpc to 8
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.998946Z DEBUG niri::niri: putting output eDP-1 at x=0 y=0
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.999078Z INFO niri: listening on Wayland socket: wayland-1
Jul 19 11:27:17 vigu niri[1258]: 2024-07-19T05:57:17.999089Z INFO niri: IPC listening on: /run/user/1000/niri.wayland-1.1258.sock
Jul 19 11:27:23 vigu niri[1258]: 2024-07-19T05:57:23.448155Z DEBUG niri::backend::tty: device changed: 57857
Jul 19 11:27:23 vigu niri[1258]: 2024-07-19T05:57:23.448270Z WARN niri::backend::tty: no such device
Jul 19 11:27:23 vigu niri[1258]: 2024-07-19T05:57:23.538376Z DEBUG niri::backend::tty: device changed: 57857
Jul 19 11:27:23 vigu niri[1258]: 2024-07-19T05:57:23.538458Z WARN niri::backend::tty: no such device
Jul 19 11:27:24 vigu niri[1258]: 2024-07-19T05:57:24.074187Z DEBUG niri::backend::tty: device changed: 57857
Jul 19 11:27:24 vigu niri[1258]: 2024-07-19T05:57:24.074268Z WARN niri::backend::tty: no such device
Jul 19 11:28:21 vigu niri[1258]: 2024-07-19T05:58:21.138698Z DEBUG niri::backend::tty: device changed: 57857
Jul 19 11:28:21 vigu niri[1258]: 2024-07-19T05:58:21.138770Z WARN niri::backend::tty: no such device
Jul 19 11:28:21 vigu niri[1258]: 2024-07-19T05:58:21.141492Z DEBUG niri::backend::tty: device changed: 57857
Jul 19 11:28:21 vigu niri[1258]: 2024-07-19T05:58:21.141542Z WARN niri::backend::tty: no such device
Jul 19 11:28:38 vigu niri[1258]: 2024-07-19T05:58:38.649117Z DEBUG niri::backend::tty: device changed: 57857
Jul 19 11:28:38 vigu niri[1258]: 2024-07-19T05:58:38.649194Z WARN niri::backend::tty: no such device
Jul 19 11:28:38 vigu niri[1258]: 2024-07-19T05:58:38.741719Z DEBUG niri::backend::tty: device changed: 57857
Jul 19 11:28:38 vigu niri[1258]: 2024-07-19T05:58:38.741811Z WARN niri::backend::tty: no such device
Jul 19 11:28:39 vigu niri[1258]: 2024-07-19T05:58:39.186132Z DEBUG niri::backend::tty: device changed: 57857
Jul 19 11:28:39 vigu niri[1258]: 2024-07-19T05:58:39.186241Z WARN niri::backend::tty: no such device
niri msg outputs
Output "eDP-1" (11_24_6 - 22425 - eDP-1)
Current mode: 1920x1080 @ 60.056 Hz (preferred)
Variable refresh rate: not supported
Physical size: 340x190 mm
Logical position: 0, 0
Logical size: 1920x1080
Scale: 1
Transform: normal
Available modes:
[email protected] (current, preferred)
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
I tried a few times by plugging the cable in and out. Hence u see the no such device in journalctl multiple times.
niri msg outputs output was noted while the cable was plugged in
EGL is not initialized, or could not be initialized, for the specified EGL display connection.
Huh, that's an error I haven't seen before. But yeah, niri/smithay fails to communicate with nvidia.
EGL is not initialized, or could not be initialized, for the specified EGL display connection.
Huh, that's an error I haven't seen before. But yeah, niri/smithay fails to communicate with nvidia.
Can try using GBM backend instead, afaik Hyprland wiki reccomends this as well for nvidia peeps
GBM is the only thing that Smithay supports
GBM is the only thing that Smithay supports
can try forcing nvidia to use GBM backend then, not sure what to add in config to achieve that, though
As in, that's the only way Smithay can communicate with a GPU. You can't configure it, it already does it. So for example if your Nvidia driver was old enough to not support GBM, it just wouldn't work. I'm not sure if this error you're getting indicates that or some other issue
What nvidia driver version and what does sudo cat /sys/module/nvidia_drm/parameters/modeset returns?
They is no "force nvidia to use GBM option" as far I know, on my system it works out of the box, I only need to add " wait-for-frame-completion-before-queueing" to fix some flickering.
sudo cat /sys/module/nvidia_drm/parameters/modeset
Hey,
nvidia-smi returns driver version to be: 555.58.02
sudo cat /sys/module/nvidia_drm/parameters/modeset returns: Y
As in, that's the only way Smithay can communicate with a GPU. You can't configure it, it already does it. So for example if your Nvidia driver was old enough to not support GBM, it just wouldn't work. I'm not sure if this error you're getting indicates that or some other issue
I am sure my version of nvidia driver supports GBM, I recall Hyprland supporting Nvidia GPUs by doing smth like this
https://wiki.hyprland.org/Nvidia/#environment-variables
is there an equivalent for this in smithay that i can try or do i just sound stupid :sweat_smile:
sudo cat /sys/module/nvidia_drm/parameters/modeset
Hey,
nvidia-smireturns driver version to be: 555.58.02sudo cat /sys/module/nvidia_drm/parameters/modesetreturns: Y
Looks fine, what does nvidia-smi return while running niri?
sudo cat /sys/module/nvidia_drm/parameters/modeset
Hey,
nvidia-smireturns driver version to be: 555.58.02sudo cat /sys/module/nvidia_drm/parameters/modesetreturns: YLooks fine, what does nvidia-smi return while running niri?
Fri Jul 19 12:11:45 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 555.58.02 Driver Version: 555.58.02 CUDA Version: 12.5 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce GTX 1650 On | 00000000:01:00.0 Off | N/A |
| N/A 48C P8 1W / 30W | 9MiB / 4096MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+
nothing particularly interesting, do keep in mind that i am on hybrid graphics. i can switch to dedicated or integrated graphics if that is needed for debugging
My laptop is hybrid graphics too and it works fine. I do have a 1660Ti. Could you try adding options nvidia NVreg_EnableGpuFirmware=1 to some modprobe file and try again?
I am not sure if your GPU does support the GBM firmware but that could be the issue, I didn't try on mine without it.
My laptop is hybrid graphics too and it works fine. I do have a 1660Ti. Could you try adding
options nvidia NVreg_EnableGpuFirmware=1to some modprobe file and try again? I am not sure if your GPU does support the GBM firmware but that could be the issue, I didn't try on mine without it.
Yes, I have added the option in modprobe for nvidia.conf I am pretty sure the drivers for Turing (i.e for RTX 20xx and GTX 16xx) are same, so our setup should be identical
can you upload your config file so that i can contrast the changes between ur setup and mine?
They is really nothing special in my config file, the screens worked out of the box without doing any config, only had some glitches with where fixed by wait-for-frame-completion-before-queueing option. In general if you don't see niri in nvidia-smi process output then your issue lays at the startup of niri and it not picking up the dGPU, probaly for the EGL error but I am not sure what is causing it, what distro are you? Using niri from git? I suggest picking up a build from git directly, that is what I am running
They is really nothing special in my config file, the screens worked out of the box without doing any config, only had some glitches with where fixed by wait-for-frame-completion-before-queueing option. In general if you don't see niri in nvidia-smi process output then your issue lays at the startup of niri and it not picking up the dGPU, probaly for the EGL error but I am not sure what is causing it, what distro are you? Using niri from git? I suggest picking up a build from git directly, that is what I am running
sorry for the late reply i am using arch linux and using niri-git from AUR
after tweaking with envycontrol and having had enabled dedicated gpu mode, the same error keeps popping up
found a little something abt this on smithay docs, i dont understand a lot of it so i am a bit helpless here https://smithay.github.io/smithay/smithay/backend/egl/ @dragonnn can u confirm that u are using EGL and not GBM? just want to sanity check
I've used to encounttered the similar problem. But it was relative to optimus-manager. I hope it couldbe helpful (if you use it):
- Change "startup_mode=intergrated" in /etc/optimus-manager/optimus-manager.conf from intergrated to nvidia.
- reboot computer.
If you use other similar tool(such as bumblebee), check the default configration, and change the similar option maybe helpful.
I've used to encounttered the similar problem. But it was relative to optimus-manager. I hope it couldbe helpful (if you use it):
1. Change "startup_mode=intergrated" in /etc/optimus-manager/optimus-manager.conf from intergrated to nvidia. 2. reboot computer.If you use other similar tool(such as bumblebee), check the default configration, and change the similar option maybe helpful.
Hello, I use envycontrol for this instead and achieves the same thing, for the tests and logs attached above i have used the dedicated GPU and specified where i havent used it
@dragonnn can u confirm that u are using EGL and not GBM? just want to sanity check
How can I check for that? I am not sure where to look for that https://pastebin.com/YExtB9ne here is my niri config but I am pretty sure that will not help at all.
https://github.com/YaLTeR/niri/issues/567
the only way I have got it to work is by using kanshi and even then it's extremely buggy so there needs to be a fix with niri as niri msg output <DISPLAY> on doesn't work and rather errors out as shown in the issue
Hi, hope this will help someone. I had the same issue: hybrid laptop, HDMI wired to Nvidia card and a working KDE instance.
System Information
- niri version: niri 25.05.1 (8ba57fc)
- Distro: Arch 6.15.9-arch1-1
- dGPU: Nvidia RTX 4060 (mobile)
- dGPU drivers: nouveau
- iGPU: AMD Radeon Graphics Rembrandt [Radeon 680M]
- CPU: AMD Ryzen 7 7735HS with Radeon Graphics
journalctl -eb /usr/bin/niri
Aug 05 13:44:21 M3 niri[2568]: 2025-08-05T11:44:21.904971Z INFO niri: starting version 25.05.1 (8ba57fc)
Aug 05 13:44:21 M3 niri[2568]: 2025-08-05T11:44:21.927602Z DEBUG niri_config: loaded config from "/home/skilvingr/.config/niri/config.kdl"
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.038933Z INFO niri::backend::tty: using as the render node: "/dev/dri/renderD129"
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.058537Z DEBUG niri::backend::tty: device added: 57858 "/dev/dri/card2"
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.264336Z DEBUG niri::backend::tty: this is the primary node
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.264355Z DEBUG niri::backend::tty: this is the primary render node
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.281160Z DEBUG niri::backend::tty: device changed: 57858
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.282399Z DEBUG niri::backend::tty: new connector: eDP-2 "Chimei Innolux Corporation N156HMA-GA1 Unknown"
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.282419Z DEBUG niri::backend::tty: connecting connector: eDP-2
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.282436Z DEBUG niri::backend::tty: picking mode: Mode { name: "1920x1080", clock: 342053, size: (1920, 1080), hsync: (1968, 2000, 2080), vsync: (1090, 1095, 1142), hskew: 0, vscan: 0, vrefresh: 144, mode_type: ModeTypeFlags(PREFERRED | DRIVER) }
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.282482Z DEBUG niri::backend::tty: set max bpc to 8
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.286079Z DEBUG niri::niri: putting output eDP-2 at x=0 y=0
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.286234Z DEBUG niri::backend::tty: device added: 57857 "/dev/dri/card1"
Aug 05 13:44:22 M3 niri[2568]: MESA: error: ZINK: vkCreateInstance failed (VK_ERROR_INCOMPATIBLE_DRIVER)
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.302216Z WARN niri::backend::tty: error adding device: None of the following EGL extensions is supported by the underlying EGL implementation, at least one is required: ["EGL_EXT_device_drm"]
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.302631Z INFO niri: listening on Wayland socket: wayland-1
Aug 05 13:44:22 M3 niri[2568]: 2025-08-05T11:44:22.302637Z INFO niri: IPC listening on: /run/user/1000/niri.wayland-1.2568.sock
Aug 05 13:46:09 M3 niri[2568]: 2025-08-05T11:46:09.947901Z DEBUG niri_config: loaded config from "/home/skilvingr/.config/niri/config.kdl"
Aug 05 13:52:33 M3 niri[2568]: 2025-08-05T11:52:33.777678Z DEBUG niri_config: loaded config from "/home/skilvingr/.config/niri/config.kdl"
Aug 05 13:52:41 M3 niri[2568]: 2025-08-05T11:52:41.416226Z DEBUG niri::backend::tty: device changed: 57857
Aug 05 13:52:41 M3 niri[2568]: 2025-08-05T11:52:41.416264Z WARN niri::backend::tty: no such device
Aug 05 13:52:44 M3 niri[2568]: 2025-08-05T11:52:44.339789Z DEBUG niri::backend::tty: device changed: 57857
Aug 05 13:52:44 M3 niri[2568]: 2025-08-05T11:52:44.339822Z WARN niri::backend::tty: no such device
Aug 05 13:52:55 M3 niri[2568]: 2025-08-05T11:52:55.318420Z DEBUG niri_config: loaded config from "/home/skilvingr/.config/niri/config.kdl"
It turned out I just had to install vulkan-nouveau. After that everything works great.