You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
/sys/class/drm/*/enabled reports “disabled” for enabled monitors #889
Please confirm this issue does not happen with the proprietary driver (of the same version). This issue tracker is only for bugs specific to the open kernel driver.
I confirm that this does not happen with the proprietary driver package.
Operating System and Version
NixOS
Kernel Release
6.15.2
Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.
Seems just check the existence of field connector->encoder . I skimmed nvidia-drm sources, seems there is no assignment for connector->encoder, and it only uses connector->nv_detected_encoder .
Some softwares which depend on /sys/class/drm/*/enabled to detect monitor's status cannot work incorrectly when use nvidia card, for example, logind in laptop with nvidia card.
As a FYI, it's a bug if a DRM driver explicitly sets connector->encoder.
/**
* drm_connector_attach_encoder - attach a connector to an encoder
* @connector: connector to attach
* @encoder: encoder to attach @connector to
*
* This function links up a connector to an encoder. Note that the routing
* restrictions between encoders and crtcs are exposed to userspace through the
* possible_clones and possible_crtcs bitmasks.
*
* Returns:
* Zero on success, negative errno on failure.
*/
int drm_connector_attach_encoder(struct drm_connector *connector,
struct drm_encoder *encoder)
{
/*
* In the past, drivers have attempted to model the static association
* of connector to encoder in simple connector/encoder devices using a
* direct assignment of connector->encoder = encoder. This connection
* is a logical one and the responsibility of the core, so drivers are
* expected not to mess with this.
*
* Note that the error return should've been enough here, but a large
* majority of drivers ignores the return value, so add in a big WARN
* to get people's attention.
*/
if (WARN_ON(connector->encoder))
return -EINVAL;
connector->possible_encoders |= drm_encoder_mask(encoder);
return 0;
}
EXPORT_SYMBOL(drm_connector_attach_encoder);
This release did not fix this issue for me. cat /sys/class/drm/*/enabled still reports all disabled. I am using a 3060 and have tested both the 580.82.07 and 580.82.09 drivers, neither fix it for me. I am also on NixOS if that matters.
This release did not fix this issue for me. cat /sys/class/drm/*/enabled still reports all disabled. I am using a 3060 and have tested both the 580.82.07 and 580.82.09 drivers, neither fix it for me. I am also on NixOS if that matters.
I'm using 5070Ti Laptop with 580.82.09 driver. The problem had been fixed.
This release did not fix this issue for me. cat /sys/class/drm/*/enabled still reports all disabled. I am using a 3060 and have tested both the 580.82.07 and 580.82.09 drivers, neither fix it for me. I am also on NixOS if that matters.
I'm using 5070Ti Laptop with 580.82.09 driver. The problem had been fixed.
That's interesting, I am on a desktop and my monitor is plugged into an HDMI port on my graphics card. I feel like this shouldn't matter because the nouveau drivers show it as enabled. I am also on the latest kernel 6.16.7.
Yeah, I suspect card1 vs card0 was just an artifact of simpledrm and not an issue when you shared the output. Running some experiments to try to reproduce this issue.
I managed to create a reproduction of the issue. The problem is that our X driver bypasses nvidia-drm, so the newly added call to nvidia-drm does not get hit. Instead with our X driver, we directly make use of the nvidia-modeset driver ioctls. With Wayland, the compositor makes use of nvidia-drm, so the state is updated correctly. This requires some thought process because we do not want to make the needed DRM call from nvidia-modeset directly.
The advantage of the "new" status sysfs node is it enables a driver to update the state of the display connection without needing to go through the DRM atomic modesetting API. Ideally, logind would make use of this API instead for the purpose of detecting docking.
/sys/class/drm/*/status would be the atomic modeset equivalent to the legacy modeset sysfs node /sys/class/drm/*/enabled. The nice thing with status is that it can be updated from our base non-DRM modesetting driver, nvidia-modeset.
Oh okay, I may be completely mistaken then. I was trying to get /sys/class/drm/*/enabled to work because I needed a way to check if my monitor was on or off programmatically. I was under the impression that enabled and status would be different if for example the monitor was off, but the gpu was still connected. If the enabled value is equivalent to the status value then it is not really important for me.
Hm that doesn't 100% work for me. I need it to work since systemctl uses it for "docked mode" detection, allowing me to like close a laptop without it sleeping. Is there another workaround?
I think the correct thing for logind to do is account for both sysfs nodes. It is expected for atomic modesetting drivers to not implement the legacy helper that populates the information for the legacy sysfs node. That sysfs node is supported by drivers just to not break uapi from the time those drivers supported the legacy modeset path. The difference for X is with the sunsetting of X development, DRM driver developers implemented a X modesetting driver that can use DRM kernel drivers to drive the X display. However, this removes the opportunity for enhancing performance/improving behavior for GLX support. We want to have an enhanced GLX experience, so we still ship a custom X userspace driver and do not plumb through DRM with this driver.
If you wanted, you could use the X modesetting userspace driver which would make use of nvidia-drm in place of the NVIDIA X userspace driver, but you would be choosing to throw away GLX performance.
Activity
Binary-Eater commentedon Jul 27, 2025
Thanks @RMTT. I was doing my own experiments recently and found the same behavior as well. Looking into resolving this.
Binary-Eater commentedon Jul 27, 2025
As a FYI, it's a bug if a DRM driver explicitly sets
connector->encoder.RMTT commentedon Jul 27, 2025
Thanks! This bug is very crucial for improving linux desktop experience with NVIDIA in laptops.
Binary-Eater commentedon Aug 2, 2025
Wanted to update we have a fix for this issue internally.
RMTT commentedon Aug 2, 2025
Thanks for your work! Will this fix be included in next release?
abchauhan-nv commentedon Aug 13, 2025
Hi all, the issue was tracked on NVBug #5420364. This is now resolved and the fix will be available in a future driver release. Thanks
ShadiestGoat commentedon Aug 26, 2025
Hi - is this fix supposed to be in current release? I seem to still be able to reproduce this on latest version
Binary-Eater commentedon Aug 27, 2025
The fix I wrote has not landed in the current releases. I think @abchauhan-nv will update the thread when it's out.
Binary-Eater commentedon Sep 3, 2025
We just had a new release
https://www.nvidia.com/en-us/drivers/details/253003/
alexphanna commentedon Sep 22, 2025
This release did not fix this issue for me.
cat /sys/class/drm/*/enabledstill reports all disabled. I am using a 3060 and have tested both the 580.82.07 and 580.82.09 drivers, neither fix it for me. I am also on NixOS if that matters.RMTT commentedon Sep 23, 2025
I'm using 5070Ti Laptop with 580.82.09 driver. The problem had been fixed.
alexphanna commentedon Sep 23, 2025
That's interesting, I am on a desktop and my monitor is plugged into an HDMI port on my graphics card. I feel like this shouldn't matter because the nouveau drivers show it as enabled. I am also on the latest kernel 6.16.7.
abchauhan-nv commentedon Sep 23, 2025
@alexphanna , Can you please capture a NVIDIA bug report from your system and attach it here? Thanks
6 remaining items
Binary-Eater commentedon Sep 23, 2025
Yeah, I suspect card1 vs card0 was just an artifact of
simpledrmand not an issue when you shared the output. Running some experiments to try to reproduce this issue.ShadiestGoat commentedon Sep 23, 2025
What types of things could they be? I'd love to provide more details. I'm on arch W/ xorg
Binary-Eater commentedon Sep 23, 2025
One example would be the X clients used. GNOME vs i3 etc. Each client handles RandR hotplug events differently.
Binary-Eater commentedon Sep 23, 2025
I managed to create a reproduction of the issue. The problem is that our X driver bypasses nvidia-drm, so the newly added call to nvidia-drm does not get hit. Instead with our X driver, we directly make use of the nvidia-modeset driver ioctls. With Wayland, the compositor makes use of nvidia-drm, so the state is updated correctly. This requires some thought process because we do not want to make the needed DRM call from nvidia-modeset directly.
alexphanna commentedon Sep 23, 2025
Ah I see, that would make sense because I am also on X11 and use dwm.
Binary-Eater commentedon Sep 23, 2025
The advantage of the "new" status sysfs node is it enables a driver to update the state of the display connection without needing to go through the DRM atomic modesetting API. Ideally, logind would make use of this API instead for the purpose of detecting docking.
alexphanna commentedon Sep 23, 2025
That makes sense. Is there another way to access equivalent information to
/sys/class/drm/*/enabledthen?Binary-Eater commentedon Sep 23, 2025
/sys/class/drm/*/statuswould be the atomic modeset equivalent to the legacy modeset sysfs node/sys/class/drm/*/enabled. The nice thing withstatusis that it can be updated from our base non-DRM modesetting driver,nvidia-modeset.alexphanna commentedon Sep 23, 2025
Oh okay, I may be completely mistaken then. I was trying to get
/sys/class/drm/*/enabledto work because I needed a way to check if my monitor was on or off programmatically. I was under the impression thatenabledandstatuswould be different if for example the monitor was off, but the gpu was still connected. If theenabledvalue is equivalent to thestatusvalue then it is not really important for me.Binary-Eater commentedon Sep 24, 2025
@alexphanna for what you want to achieve, you will need to use both the
statusanddpmssysfs nodes.ShadiestGoat commentedon Sep 24, 2025
Hm that doesn't 100% work for me. I need it to work since systemctl uses it for "docked mode" detection, allowing me to like close a laptop without it sleeping. Is there another workaround?
Binary-Eater commentedon Sep 24, 2025
I think the correct thing for logind to do is account for both sysfs nodes. It is expected for atomic modesetting drivers to not implement the legacy helper that populates the information for the legacy sysfs node. That sysfs node is supported by drivers just to not break uapi from the time those drivers supported the legacy modeset path. The difference for X is with the sunsetting of X development, DRM driver developers implemented a X modesetting driver that can use DRM kernel drivers to drive the X display. However, this removes the opportunity for enhancing performance/improving behavior for GLX support. We want to have an enhanced GLX experience, so we still ship a custom X userspace driver and do not plumb through DRM with this driver.
Binary-Eater commentedon Sep 24, 2025
If you wanted, you could use the X modesetting userspace driver which would make use of
nvidia-drmin place of the NVIDIA X userspace driver, but you would be choosing to throw away GLX performance.ShadiestGoat commentedon Sep 24, 2025
I see, sad. I guess this is a sign to move to Wayland anyways