Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU use in drmModeCloseFB on common actions such as mouse movement #767

Open
2 tasks done
Gert-dev opened this issue Jan 16, 2025 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@Gert-dev
Copy link

Gert-dev commented Jan 16, 2025

NVIDIA Open GPU Kernel Modules Version

565.77

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

Arch Linux

Kernel Release

6.12.8

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 4090 Laptop GPU

Describe the bug

(This is an upstream report of mutter issue 3579.)

In mutter we are noticing that screen changes, e.g. caused by moving the mouse cursor or even spinner animations running, is causing rather high CPU usage located in drmModeCloseFB. Using sysprof to analyze the root, it ends up being due to nv_drm_framebuffer_destroy and its callees:

Image

From the profile it seems as if every close of the framebuffer a buffer is immediately being destroyed. I'm not familiar with the callees in the profile, but the destroy may or may not be a red herring as it looks as if this code ends up relying on some kind of lock across threads underneath that blocks for longer than expected, resulting in high CPU usage.

This happens on single-GPU NVIDIA systems as well as hybrid systems with a monitor attached to the NVIDIA dGPU. As can be seen in the discussions on the ticket we did some testing on various NVIDIA drivers and it seems less problematic with the GSP firmware disabled on the closed driver. It's also not happening on other graphics drivers and seems to be unique to this driver.

To Reproduce

  1. Ensure you are on an empty desktop in GNOME (47.4).
  2. Start a terminal, start top.
  3. Observe baseline of gnome-shell CPU use. For me it is about 0% to 1%.
  4. Keep moving the mouse over the background wallpaper whilst observing top.
  5. Notice gnome-shell spiking. For me it goes to 15% or higher.
  6. Stop moving the cursor, notice CPU use going back to what it was.

(Having a clean desktop/workspace ensures damage of applications that you are moving the mouse over is not influencing the result.)

Bug Incidence

Always

nvidia-bug-report.log.gz

nvidia-bug-report.log.gz

More Info

No response

@Gert-dev Gert-dev added the bug Something isn't working label Jan 16, 2025
@Gert-dev Gert-dev changed the title Expensive drmModeCloseFB due to framebuffers being destroyed immediately High CPU use in drmModeCloseFB on common actions such as mouse movement Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant