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

Game syncs to wrong display device on nVidia GPU #377

Open
mohaa-man opened this issue Sep 29, 2024 · 3 comments
Open

Game syncs to wrong display device on nVidia GPU #377

mohaa-man opened this issue Sep 29, 2024 · 3 comments
Labels

Comments

@mohaa-man
Copy link

Describe the bug
If multiple monitors are enabled and the game is launched full screen, the VSYNC event used to synchronize is not reliably the correct one.

To Reproduce
Steps to reproduce the behavior:

  1. Launch game and play a map (single or multiplayer, doens't matter) on a multi-monitor system
  2. enable VSYNC (r_swapinterval 1), disable FPS limit (com_maxfps 0, or at least higher than the refresh rate of your display)
  3. monitor the FPS (fps 1)

Expected behavior
The game should sync to the display it is being shown on, but this is not reliably the case. In my setup, I have an nVidia RTX3070 laptop with 2560x1600x165Hz internal display (DisplayPort), and 1 to 2 external displays (DisplayPort and/or HDMI) which are both at 2560x1440x75 Hz. When trying to run on the laptop display, I should get 165 FPS, but instead I only get 75. I am able to "force" the nVidia driver to override the application behavior with an env var: __GL_SYNC_DISPLAY_DEVICE=DP-4 (DP-4 is the internal laptop display in my case, which is also set as the primary display in my Cinnamon DE). It's not clear if this is an nVidia bug, or the game simply choosing the wrong display for VSYNC timing.

Version information (please complete the following information):
OS: arch linux x86_64
OS Version: latest (rolling release), kernel 6.10.10-arch1-1, nvidia 560.35.03-6 (RTX 3070 Max-Q laptop)
OpenMoHAA Version: 0.70.0-alpha+20.0a90757 (Sep 2 2024)

@mohaa-man mohaa-man added the bug label Sep 29, 2024
@openmoh openmoh deleted a comment Sep 29, 2024
@mohabhassan
Copy link
Collaborator

mohabhassan commented Oct 5, 2024

I've tested on my laptop, Win10 22H2, 1660ti with max q, 60Hz laptop display and 144Hz secondary display, and vsync is working as expected on both displays.
I've built the debug binaries today
This could be a linux-only issue

@mohabhassan
Copy link
Collaborator

Yeah it's linux-only, I've tested on ubuntu 20.04 and the bug occurs.
After doing some search, I couldn't find any way to programmatically fix it.
It seems this issue is due to the nature of the nvidia drivers.
It could be non-existent in AMD systems

@Crimewavez
Copy link

Not a game bug. Issue is how X11 and Compositors affect refresh rate in multi-monitor setups, it's up to you to configure system correctly.

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

No branches or pull requests

3 participants