HDMI output fails on NixOS

I generated an nvidia bug report:

Wanted to post some additional context, but since I am a new user I guess I can’t for now. I already have modeset enabled.

I am mainly using Wayland, and the compositor I use used to work fine with a second monitor attached, but now nothing shows up. In certain situations I can get the display to work, like if I launch retroarch from a tty using vulkan. GDM also shows the second monitor, but as soon as my session starts, the monitor shuts off.

I also tested in a Xorg server using Xmonad and it also failed.

Probably the most concerning looking line in the bug report is this:

[28378.741927] [drm:nv_drm_gem_export_nvkms_memory_ioctl [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to lookup NVKMS gem object for export: 0x00000001

Please install nvidia-smi and switch to Xorg, then create a new nvidia-bug-report.log so I can see where your external connectors are routed.

1 Like

This one is a bit bigger, won’t fit in the pastebin, so here is the compressed file:

The hdmi is connected to the nvidia gpu, the monitor is detected by the driver but not by xrandr. Does it come alive if you run
xrandr --setprovideroutputsource modesetting NVIDIA-G0 && xrandr --auto

No, I just get:

❯ xrandr --setprovideroutputsource modesetting NVIDIA-G0 && xrandr --auto
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  35 (RRSetProviderOutputSource)
  Value in failed request:  0x270
  Serial number of failed request:  16
  Current serial number in output stream:  17

Also, not sure if it is directly related, but I recently realized that HDMI audio does not work at all either.

Another thing, in the past when I had the HDMI cable plugged in while on the linux virtual terminal, it would be mirrored on both the laptop screen, and the external monitor, but now it is just the laptop.

Please post the output of
xrandr --listproviders

no problem:

❯ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x44 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x270 cap: 0x2, Sink Output crtcs: 4 outputs: 3 associated providers: 0 name:NVIDIA-G0

Opps, my bad, the command is of course the other way round
xrandr --setprovideroutputsource NVIDIA-G0 modesetting && xrandr --auto

Okay great, that at least works in the X11 case finally. But I don’t normally use X, and this used to work on my wlroots based wayland compositor. If it never worked at all I would just say, okay I guess it’s not supported, but since it used to work and now stopped working I’m a little confused.

Is there a way to accomplish something similar to what this xrandr command is doing for a wayland session perhaps?

No idea if it’s related at this point but this is in the startup logs of two different wlroots compositors I tried so far:

00:00:00.380 [DEBUG] [types/output/render.c:73] Choosing primary buffer format 0x34325258 for output 'HDMI-A-2'
00:00:00.380 [DEBUG] [render/swapchain.c:105] Allocating new swapchain buffer
00:00:00.381 [DEBUG] [render/allocator/gbm.c:140] Allocated 1920x1080 GBM buffer (format 0x34325258, modifier 0x0)
00:00:00.381 [DEBUG] [render/gles2/renderer.c:142] Created GL FBO for buffer 1920x1080
00:00:00.382 [ERROR] [EGL] command: eglCreateImageKHR, error: EGL_BAD_ALLOC (0x3003), message: "EGL_BAD_ALLOC error: In eglCreateImageKHR: could not bind to DMA buffer
"
00:00:00.382 [ERROR] [render/egl.c:725] eglCreateImageKHR failed
00:00:00.382 [ERROR] [render/gles2/texture.c:271] Failed to create EGL image from DMA-BUF

edit
Thanks to your answer I was at least able to confirm that it should be working so I did some digging and I found that WLR_DRM_DEVICES allows me to set the /dev/dri/card* to whichever I want and it’s working for my wayland sessions as well. Still can’t get both monitors to show at the same time, but I’m not too worried about that right now.

A little weird that I didn’t have to do this before but at least I found a solution. Thanks for the help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.