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

[NVIDIA] Mouse motion causes severe frame delays since linux_drm_syncobj implementation #1626

Open
3 of 6 tasks
ShadowApex opened this issue Nov 12, 2024 · 6 comments
Open
3 of 6 tasks

Comments

@ShadowApex
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Are you using any gamescope patches or a forked version of gamescope?

  • The issue occurs on upstream gamescope without any modifications

Current Behavior

Using Nvidia GPUs with a 4k display, certain games like Cyberpunk 2077 and Black Myth: Wukong experience severe frame delays when there is mouse motion input. Keyboard or gamepad input does not cause issues. After bisecting, it appears this issue was introduced in commit dd77e4de10974bdbfe8252f6ec6f4c8723ac3305 with the introduction of the new linux_drm_syncobj implementation in v3.15.0.

From testing Cyberpunk 2077, it appears this issue only manifests when using a 4k display (tested with a 3840x2160 monitor) or when using a 1080p display and the in-game resolution is set to a value lower than 1080p. Enabling vsync in-game also appears to help with the frame stuttering, but is severe when it is disabled.

Steps To Reproduce

  1. Launch gamescope embedded session (with a 4K display 3840x2160)
  2. Launch Cyberpunk 2077
  3. Go to game settings and ensure that resolution is set to 1920x1080 and vsync is disabled
  4. Load or start a new game
  5. Move mouse cursor around

Hardware information

- **Distro**: Fedora Linux 41.20241106.0 (Silverblue)
- **CPU**: 16-core Intel(R) Core(TM) Ultra 7 155H
- **GPU**: NVIDIA Corporation AD107M [GeForce RTX 4060 Max-Q / Mobile]
- **Driver Version**: NVIDIA 565.57.01

Software information

- **Desktop environment**: None (gamescope-session)
- **Session type**: wayland
- **Gamescope version**: gamescope version v3.15.0+ (starting at commit [dd77e4de10974bdbfe8252f6ec6f4c8723ac3305](https://github.com/ValveSoftware/gamescope/commit/dd77e4de10974bdbfe8252f6ec6f4c8723ac3305))
- **Gamescope launch command(s)**: `/usr/bin/gamescope --prefer-output *,eDP-1 --xwayland-count 2 --default-touch-mode 4 --hide-cursor-delay 3000 --fade-out-duration 200 --steam -R /run/user/1000/gamescope.rhDOTtu/startup.socket -T /run/user/1000/gamescope.rhDOTtu/stats.pipe`

Which gamescope backends have the issue you are reporting?

  • Wayland (default for nested gamescope)
  • DRM (default for embedded gamescope, i.e. gamescope-session)
  • SDL
  • OpenVR

Logging, screenshots, or anything else

gamescope version v3.15.0+ (dd77e4de10974bdbfe8252f6ec6f4c8723ac3305)

2024-11-11-14-23-09-090-clipped.mp4

gamescope version v3.14.29

2024-11-11-14-26-58-586.mp4
@alkazar
Copy link

alkazar commented Nov 12, 2024

I experience this issue at native 1080p with Senua's Sacrifice when using DirectX12, but not when using DirectX11.
The GPU used for testing was an RTX 4060.

@awsms
Copy link

awsms commented Nov 24, 2024

Getting this on Cyberpunk as well (launch command: ENABLE_GAMESCOPE_WSI=0 gamescope -w 2560 -h 1440 --hdr-enabled --hdr-itm-enable --force-grab-cursor -- %command% --launcher-skip -skipStartScreen).
Playing with a controller is perfectly fine, but as soon as I try moving my mouse, it stutters to hell and my terminal is spammed with [gamescope] [Warn] xwm: got the same buffer committed twice, ignoring.
It's WAY MORE exaggerated than in OP's video, making the game impossible to play with a mouse for me

@matte-schwartz
Copy link

can you try adding VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait before %command% as well? this seems to work around the mouse issue for me in Cyberpunk 2077 on a 4090 with HDR enabled on Plasma 6 Wayland and in gamescope-session.

@awsms
Copy link

awsms commented Dec 11, 2024

can you try adding VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait before %command% as well? this seems to work around the mouse issue for me in Cyberpunk 2077 on a 4090 with HDR enabled on Plasma 6 Wayland and in gamescope-session.

This reduces a lot the stutter duration, but still doesn't make it playable as the stutters are still there at every mouse move.
edit: btw it adds input latency for me.

@matte-schwartz
Copy link

NVIDIA/egl-wayland#154 hmm, i wonder if this is possibly related? i'm not too familiar with the egl-wayland repo though but this looks similar

@awsms
Copy link

awsms commented Dec 12, 2024

NVIDIA/egl-wayland#154 hmm, i wonder if this is possibly related? i'm not too familiar with the egl-wayland repo though but this looks similar

Interesting, however he suffers of FPS drops and no stuttering, while my FPS are not affected at all (there is 0 difference in the frame time/framerate graphs displayed by mangohud when the stuttering occurs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants