Skip to content

/sys/class/drm/*/enabled reports “disabled” for enabled monitors #889

Closed

Description

@RMTT

NVIDIA Open GPU Kernel Modules Version

570.169

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.

  • I am running on a stable kernel release.

Hardware: GPU

NVIDIA GeForce RTX 5070 Ti Laptop GPU

Describe the bug

That's old problem which had been reported in https://forums.developer.nvidia.com/t/sys-class-drm-enabled-reports-disabled-for-enabled-monitors/51187 , but it doesn't been solved until now.

I found that kernel updates /sys/class/drm/*/enabled by(https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_sysfs.c#L251):

	struct drm_connector *connector = to_drm_connector(device);
	bool enabled;

	enabled = READ_ONCE(connector->encoder);

	return sysfs_emit(buf, enabled ? "enabled\n" : "disabled\n");

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.

To Reproduce

cat /sys/class/drm/*/enabled

Bug Incidence

Once

nvidia-bug-report.log.gz

nvidia-bug-report.log.gz

More Info

No response

Activity

  1. added
    bug
    on Jun 24, 2025
  2. Binary-Eater commented on Jul 27, 2025

    @Binary-Eater
    Member

    Thanks @RMTT. I was doing my own experiments recently and found the same behavior as well. Looking into resolving this.

  3. Binary-Eater commented on Jul 27, 2025

    @Binary-Eater
    Member

    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);
    
  4. RMTT commented on Jul 27, 2025

    @RMTT
    Author

    Looking into resolving this

    Thanks! This bug is very crucial for improving linux desktop experience with NVIDIA in laptops.

  5. Binary-Eater commented on Aug 2, 2025

    @Binary-Eater
    Member

    Wanted to update we have a fix for this issue internally.

  6. RMTT commented on Aug 2, 2025

    @RMTT
    Author

    Wanted to update we have a fix for this issue internally.

    Thanks for your work! Will this fix be included in next release?

  7. abchauhan-nv commented on Aug 13, 2025

    @abchauhan-nv

    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

  8. ShadiestGoat commented on Aug 26, 2025

    @ShadiestGoat

    Hi - is this fix supposed to be in current release? I seem to still be able to reproduce this on latest version

  9. Binary-Eater commented on Aug 27, 2025

    @Binary-Eater
    Member

    The fix I wrote has not landed in the current releases. I think @abchauhan-nv will update the thread when it's out.

  10. Binary-Eater commented on Sep 3, 2025

    @Binary-Eater
    Member
  11. alexphanna commented on Sep 22, 2025

    @alexphanna

    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.

  12. RMTT commented on Sep 23, 2025

    @RMTT
    Author

    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.

  13. alexphanna commented on Sep 23, 2025

    @alexphanna

    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.

    Image
  14. abchauhan-nv commented on Sep 23, 2025

    @abchauhan-nv

    @alexphanna , Can you please capture a NVIDIA bug report from your system and attach it here? Thanks

  15. 6 remaining items

  16. Binary-Eater commented on Sep 23, 2025

    @Binary-Eater
    Member

    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.

  17. ShadiestGoat commented on Sep 23, 2025

    @ShadiestGoat

    discrepancy in your particular setup that is not traditionally seen

    What types of things could they be? I'd love to provide more details. I'm on arch W/ xorg

  18. Binary-Eater commented on Sep 23, 2025

    @Binary-Eater
    Member

    One example would be the X clients used. GNOME vs i3 etc. Each client handles RandR hotplug events differently.

  19. Binary-Eater commented on Sep 23, 2025

    @Binary-Eater
    Member

    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.

    [binary-eater@BINARY-EATER-TEST ~]$ realpath /sys/class/drm/*/{enabled,status} | xargs -I{} sh -c 'echo {}; cat {}'
    /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0/card0-DP-1/enabled
    disabled
    /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0/card0-DP-2/enabled
    disabled
    /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0/card0-DP-3/enabled
    disabled
    /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0/card0-HDMI-A-1/enabled
    disabled
    /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0/card0-DP-1/status
    disconnected
    /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0/card0-DP-2/status
    disconnected
    /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0/card0-DP-3/status
    disconnected
    /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0/card0-HDMI-A-1/status
    connected
    
  20. alexphanna commented on Sep 23, 2025

    @alexphanna

    Ah I see, that would make sense because I am also on X11 and use dwm.

  21. Binary-Eater commented on Sep 23, 2025

    @Binary-Eater
    Member

    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.

  22. alexphanna commented on Sep 23, 2025

    @alexphanna

    That makes sense. Is there another way to access equivalent information to /sys/class/drm/*/enabled then?

  23. Binary-Eater commented on Sep 23, 2025

    @Binary-Eater
    Member

    /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.

  24. alexphanna commented on Sep 23, 2025

    @alexphanna

    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.

  25. Binary-Eater commented on Sep 24, 2025

    @Binary-Eater
    Member

    @alexphanna for what you want to achieve, you will need to use both the status and dpms sysfs nodes.

  26. ShadiestGoat commented on Sep 24, 2025

    @ShadiestGoat

    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?

  27. Binary-Eater commented on Sep 24, 2025

    @Binary-Eater
    Member

    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.

  28. Binary-Eater commented on Sep 24, 2025

    @Binary-Eater
    Member

    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.

  29. ShadiestGoat commented on Sep 24, 2025

    @ShadiestGoat

    I see, sad. I guess this is a sign to move to Wayland anyways

  30. self-assigned this
    on Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions