nvidia-drm leaks drm_display_modes on every connector probe when drm.edid_firmware overrides a disconnected connector (kmalloc-128 grows ×4 per monitor wake)

未关闭
#1,571 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
c, linux

调研方向

Start with __nv_drm_connector_detect_internal and trace its call to drm_edid_override_connector_update, then inspect how disconnected connectors manage probed_modes. The report includes a reproducer using drm.edid_firmware on an unplugged connector and a kmalloc-128 growth pattern to compare across wakes. Done means repeated connector probes no longer accumulate leaked modes while the override behavior matches the expected result described in the issue.

由索引模型根据 Issue 内容生成。

描述

bug
NVIDIA Open GPU Kernel Modules Version

595.112.07

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

Debian GNU/Linux 13 (trixie)

Kernel Release

Linux monolith 6.12.115+deb13.1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.115-2 (2026-11-01) x86_64 GNU/Linux

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

GPU 0: NVIDIA GeForce RTX 5070 Ti (UUID: GPU-f985f4e1-b17a-69c2-5d0b-a2bc789558dc)

Describe the bug

With drm.edid_firmware=DP-2:edid/samsung-edid.bin on the kernel command line, and nothing plugged into DP-2 (the monitor is on HDMI-A-2 of the same card), every monitor wake from DPMS off leaks kmalloc-128 slab objects that are never freed. Each wake leaks four times as many as the previous one, so the machine (32 GB) eventually freezes after a day of normal screen blanking.

Wake kmalloc-128 objects added
1 +86,000 (≈11 MB)
2 +344,000 (≈44 MB)
3 +1,376,000 (≈176 MB)
4 +5,504,000 (≈700 MB)

While the screen stays on, or stays off, the count is flat. nvidia-drm.modeset=Y, fbdev=Y, GNOME Shell 48.7 on Wayland.

perf record -e kmem:kmalloc --filter 'bytes_alloc == 128' -a -g across one wake: 88% of the 128-byte allocations are this chain, in gnome-shell's KMS thread:

__kmalloc_cache_noprof
drm_mode_duplicate
_drm_edid_connector_add_modes.part.0
drm_edid_connector_add_modes
drm_edid_override_connector_update
__nv_drm_connector_detect_internal
drm_helper_probe_detect
drm_helper_probe_single_connector_modes
drm_mode_getconnector
drm_ioctl_kernel
drm_ioctl
__x64_sys_ioctl

It looks as if __nv_drm_connector_detect_internal calls drm_edid_override_connector_update() for a connector that has an override but is disconnected. That adds the override's modes to connector->probed_modes, which is then never merged or pruned, because the connector is reported disconnected. We haven't confirmed why it grows ×4 rather than by a fixed amount.

To Reproduce
  • Boot with drm.edid_firmware=<a disconnected connector on the NVIDIA GPU>:edid/<any EDID>.bin (here DP-2:edid/samsung-edid.bin, a 256-byte EDID in /lib/firmware/edid/), with the monitor on a different connector.
  • Log in to GNOME (Wayland).
  • Watch sudo grep kmalloc-128 /proc/slabinfo.
  • Turn the monitor off and on a few times, by letting it blank, or with:
    gdbus call --session --dest org.gnome.Mutter.DisplayConfig --object-path /org/gnome/Mutter/DisplayConfig --method org.freedesktop.DBus.Properties.Set org.gnome.Mutter.DisplayConfig PowerSaveMode "<int32 3>", then the same with "<int32 0>".
  • Each wake adds four times as many objects as the last.
Bug Incidence

Always

nvidia-bug-report.log.gz

nvidia-bug-report.log.gz

More Info

Not tested with the proprietary driver: the RTX 5070 Ti (Blackwell) is supported only by the open kernel modules. The leaking path is in nvidia-drm.

Expected: an override EDID on a disconnected connector either has no effect, or its modes are freed with each probe, as for a connected connector.

Workaround: remove the drm.edid_firmware override for the disconnected connector. (It was added while trying to get a monitor detected on DP-2 at boot. That never worked, so the monitor moved to HDMI.)

Issue doesn't match suggested duplicates from what I can see - this is a kernel memory leak issue.

主要语言
C
星标
17.7k
派生
2k
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/open-gpu-kernel-modules 的其他 Issue

查看 NVIDIA/open-gpu-kernel-modules 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。