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

Vsync not working on some PCs #3003

Closed
1 of 11 tasks
erexo opened this issue May 28, 2024 · 6 comments
Closed
1 of 11 tasks

Vsync not working on some PCs #3003

erexo opened this issue May 28, 2024 · 6 comments

Comments

@erexo
Copy link
Contributor

erexo commented May 28, 2024

Ebitengine Version

86e0bcc

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

Go Version (go version)

go version go1.20.13 windows/amd64

What steps will reproduce the problem?

When I upgraded my game to latest ebitengine (d0aaa23) one of my players noticed that the ebiten.SetVsyncEnabled(true) does not work, that is the FPSes are not capped and the GPU usage is very, very high.
It's quite strange because he is the only reported case, other players (including myself) can limit their FPSes.

His dxdiag:


------------------
System Information
------------------
      Time of this report: 5/29/2024, 00:06:15
             Machine name: DESKTOP-F44N2BQ
               Machine Id: {CABE96D1-EEFE-4041-A864-C0598CD2C59B}
         Operating System: Windows 10 Pro 64-bit (10.0, Build 19045) (19041.vb_release.191206-1406)
                 Language: Polish (Regional Setting: Polish)
      System Manufacturer: Gigabyte Technology Co., Ltd.
             System Model: To be filled by O.E.M.
                     BIOS: F5 (type: UEFI)
                Processor: AMD A8-6600K APU with Radeon(tm) HD Graphics    (4 CPUs), ~3.9GHz
                   Memory: 28672MB RAM
      Available OS Memory: 28612MB RAM
                Page File: 6017MB used, 22593MB available
              Windows Dir: C:\Windows
          DirectX Version: DirectX 12
      DX Setup Parameters: Not found
         User DPI Setting: 96 DPI (100 percent)
       System DPI Setting: 96 DPI (100 percent)
          DWM DPI Scaling: Disabled
                 Miracast: Available, no HDCP
Microsoft Graphics Hybrid: Not Supported
 DirectX Database Version: 1.0.8
           DxDiag Version: 10.00.19041.4355 64bit Unicode

------------
DxDiag Notes
------------
      Display Tab 1: No problems found.
        Sound Tab 1: No problems found.
        Sound Tab 2: No problems found.
        Sound Tab 3: No problems found.
        Sound Tab 4: No problems found.
          Input Tab: No problems found.

--------------------
DirectX Debug Levels
--------------------
Direct3D:    0/4 (retail)
DirectDraw:  0/4 (retail)
DirectInput: 0/5 (retail)
DirectMusic: 0/5 (retail)
DirectPlay:  0/9 (retail)
DirectSound: 0/5 (retail)
DirectShow:  0/6 (retail)

---------------
Display Devices
---------------
           Card name: NVIDIA GeForce GT 710
        Manufacturer: NVIDIA
           Chip type: NVIDIA GeForce GT 710
            DAC type: Integrated RAMDAC
         Device Type: Full Device (POST)
          Device Key: Enum\PCI\VEN_10DE&DEV_128B&SUBSYS_8C931462&REV_A1
       Device Status: 0180200A [DN_DRIVER_LOADED|DN_STARTED|DN_DISABLEABLE|DN_NT_ENUMERATOR|DN_NT_DRIVER] 
 Device Problem Code: No Problem
 Driver Problem Code: Unknown
      Display Memory: 16313 MB
    Dedicated Memory: 2007 MB
       Shared Memory: 14305 MB
        Current Mode: 1920 x 1080 (32 bit) (60Hz)
         HDR Support: Not Supported
    Display Topology: Internal
 Display Color Space: DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
     Color Primaries: Red(0.646484,0.333008), Green(0.321289,0.625977), Blue(0.157227,0.060547), White Point(0.312500,0.329102)
   Display Luminance: Min Luminance = 0.500000, Max Luminance = 270.000000, MaxFullFrameLuminance = 270.000000
        Monitor Name: Generic PnP Monitor
       Monitor Model: S22D300
          Monitor Id: SAM0B3B
         Native Mode: 1920 x 1080(p) (60.000Hz)
         Output Type: HDMI
Monitor Capabilities: HDR Not Supported
Display Pixel Format: DISPLAYCONFIG_PIXELFORMAT_32BPP
      Advanced Color: Not Supported
         Driver Name: C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_964d6838c79da0a2\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_964d6838c79da0a2\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_964d6838c79da0a2\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_964d6838c79da0a2\nvldumdx.dll
 Driver File Version: 30.00.0014.7482 (English)
      Driver Version: 30.0.14.7482
         DDI Version: 12
      Feature Levels: 11_0,10_1,10_0,9_3,9_2,9_1
        Driver Model: WDDM 2.7
 Hardware Scheduling: Supported:False Enabled:False 
 Graphics Preemption: DMA
  Compute Preemption: DMA
            Miracast: Not Supported
      Detachable GPU: No
 Hybrid Graphics GPU: Not Supported
      Power P-states: Not Supported
      Virtualization: Paravirtualization 
          Block List: No Blocks
  Catalog Attributes: Universal:False Declarative:True 
   Driver Attributes: Final Retail
    Driver Date/Size: 14.01.2024 02:00:00, 1057168 bytes
         WHQL Logo'd: Yes
     WHQL Date Stamp: Unknown
   Device Identifier: {D7B71E3E-51CB-11CF-E86A-9DAC0EC2D335}
           Vendor ID: 0x10DE
           Device ID: 0x128B
           SubSys ID: 0x8C931462... (Pozostało: 51 KB)

I've managed to pinpoint this issue to this strange commit 86e0bcc, that is one commit after everything was working as expected.

Additionally some players reported that their GPU usage is noticeably higher even if the vsync is working correctly, and the problem also seems to be it this particular commit.

What is the expected result?

vsync should work, GPU usage should be limited

What happens instead?

for unknown reason one player reported that vsync is completely not working and others report increased resources usage

Anything else you feel useful to add?

~~ It does not seems to be related to OpenGL/DirectX ~~

@erexo
Copy link
Contributor Author

erexo commented May 28, 2024

EDIT:
when I reverted changes made in this particular commit, it seems that vsync is now working properly on OpenGL (and DirectX still not) for that user, and others claim that the GPU usage is reduced

@hajimehoshi hajimehoshi added this to the v2.8.0 milestone May 29, 2024
@hajimehoshi
Copy link
Owner

This change was only for OpenGL. Let me think, but I feel like reverting the change should be less risky.

@erexo
Copy link
Contributor Author

erexo commented May 29, 2024

As I mentioned reverting this commit fixes the OpenGL case, but people also report that DirectX still can take up to 95% of GPU resources. I'll try to investigate more

@hajimehoshi
Copy link
Owner

Perhaps, didn't the environment disable vsync in a hardware setting? (e.g. Nvidia Control Panel)

https://www.nvidia.com/en-us/geforce/technologies/adaptive-vsync/technology/

@erexo
Copy link
Contributor Author

erexo commented Jun 4, 2024

I'm not sure, but I sent one player two game clients, first with this commit and second without it, and he claims that he run both of those clients one by one, and the client "with" the commit was using extreme amounts of GPU, and the one "without" was fine.

Currently my released version is using more or less HEAD with changes in this commit specifically excluded and I heard no complains about anything really.

And it's not only the vsync problem, as I mentioned some of the players report that the GPU usage was increased (while the vsync is working correctly), and also just by removing this commit I was able to return the GPU usage to the proper values

@hajimehoshi
Copy link
Owner

hajimehoshi commented Jun 4, 2024

OK I reverted the suspicious commit. Thanks!

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

No branches or pull requests

2 participants