Search Unity

Windows standalone build GLCore crash on startup on high refresh-rate monitors

Discussion in 'Windows' started by ConanB, Jun 25, 2019.

  1. ConanB

    ConanB

    Joined:
    Jun 25, 2019
    Posts:
    12
    The standalone windows player crashes when using OpenGLCore API on high refresh-rate monitors (100/120/144Hz). It appears to crash when Unity is trying to create a device context so no window is created, only an error dialog appears stating that it has repeatedly failed to create a window of the correct resolution (1920x1080).

    Has anyone else had this problem? Or are you able to test if the same issue occurs for you?

    I have tested with Unity 2019.1.8f and the problem still exists. This problem does not exist for Unity 2018.3.1f1 or older versions of 2018, however it seems to have been introduced into Unity in a version after 2018.3.1 but I am unsure exactly when.

    I have been trying to find a work-around or some setting within Unity that would address this issue but have come up empty, and I can't figure out why Unity wouldn't work for this limited set of refresh-rates.

    To reproduce:
    - Create a new project
    - Change the Player Settings -> Other Settings -> Auto Graphics API for Windows, to use OpenGLCore by default
    - Create a standalone windows build
    - Run the executable on any PC with a high refresh-rate monitor an observe the crash

    I have tested using:
    - Razer Blade 15 laptop (RTX 2070 GPU + 144Hz in-built monitor (running at 144Hz)) running Windows 10
    - Multiple Dell Dual Xeon desktops with NVidia Quadro M6000 GPU + 144Hz monitor (running at 100Hz or 120Hz, but seems to work at 60/80/144Hz) running Windows 7 & 10 (tested under both windows versions)

    All have latest nvidia drivers and windows updates. The issue does not appear using D3D11/12, or when using lower refresh-rate monitors or having the refresh-rate of the monitors reduced (reducing a monitor to 60/80Hz works, but 120Hz is required for stereoscopic quad-buffering).
     
  2. ConanB

    ConanB

    Joined:
    Jun 25, 2019
    Posts:
    12
    I've narrowed down that this issue was introduced in Unity 2018.3.6, and still exists in 2019.1, 2019.2 and 2019.3.

    Capture.PNG

    Before 2018.3.6 there is no issue using OpenGLCore API on high refresh-rate monitors.
     

    Attached Files:

    • log.txt
      File size:
      11.8 KB
      Views:
      81
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,417
    Is there a reason you're using OpenGL? Generally we very much advice against that on Windows.
     
  4. ConanB

    ConanB

    Joined:
    Jun 25, 2019
    Posts:
    12
    Mainly for OpenGL quad-buffer and NV-Sync support using nvidia Quadro GPUs in a large cluster (56x HD displays).

    We have our own low-level native plugins and clustering solution that works great in unity, but as of Unity 2018.3.6 we can't run Unity using OpenGL. This is even when using a fresh project without any plugins (heck, without even anything added to the project or scene).

    The error logs and dialog aren't much help, considering it just repeats that it failed to set the resolution. But if we drop the display down to 60Hz (which means stereoscopic is not possible) it works under OpenGL.

    If we run our own OpenGL apps (C++, no Unity) there isn't any issue. It just seems like maybe there was some small issue introduced in 2018.3.6 that effects the OpenGL context creation, and that bug has stuck around since (still there in the latest 2019 release, alpha and betas).
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,417
    Alright, I'll see what we can do about this.
     
    ConanB likes this.
  6. ConanB

    ConanB

    Joined:
    Jun 25, 2019
    Posts:
    12
    Cheers for looking into this. We'd love to be able to upgrade the Unity version that all our labs use. I'll keep an eye on patch notes.

    Also, I had submitted a bug on this which I've included more logs from testing. Fogbugz ID 1165399.
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,417
    Hey, thanks for following up. I actually fixed this a week ago and I'm in the process of backporting it.
     
  8. ConanB

    ConanB

    Joined:
    Jun 25, 2019
    Posts:
    12
    Many many thanks, awesome news!
     
  9. ConanB

    ConanB

    Joined:
    Jun 25, 2019
    Posts:
    12
    I'm actually curious, what was the issue exactly? Just a simple enumeration/display modes issue?
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,417
    Yeah. DXGI uses Rationals (Numerator/Denominator) to represent refresh rates, while GDI uses rounded refresh rates. GDI is only used when switching display modes for OpenGL, and it would choke when fed data taken from DXGI since it would be one off (59994/1000 would become 59 Hz while GDI expected it to be 60 Hz).
     
  11. ConanB

    ConanB

    Joined:
    Jun 25, 2019
    Posts:
    12
    Ok cheers. That also explains some of the numbers we were seeing with other systems. Thanks for chasing this up.
     
  12. ConanB

    ConanB

    Joined:
    Jun 25, 2019
    Posts:
    12
    Would this bug be the same as https://issuetracker.unity3d.com/is...resh-rate-over-60hz-and-resolution-over-1080p ?

    Was it fixed in 2019.1.12f1? (the bug listing says "Fixed in 2019.1 and 2019.3"). Or is it still being rolled out? I didn't see it mentioned in release notes and the problem still shows up in a test I did just then with a new project :(

    I'm just wondering if there are any available beta/alpha/release versions that I can grab which have the issue fixed for testing.
     
    Last edited: Jul 31, 2019
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,417
    It landed to Unity 2019.1.13f1, 2019.2.1f1 and 2019.3.0a11. None of them are out yet but 2019.3 and 2019.1 ones should come out very shortly.
     
  14. ConanB

    ConanB

    Joined:
    Jun 25, 2019
    Posts:
    12
    Awesome, thanks again!
     
  15. SamiRehman1997

    SamiRehman1997

    Joined:
    Aug 13, 2018
    Posts:
    45
    i am facing this issue even i'm not using OpenGlCore default DX11 i tried to switch to DX12 but no luck giving me same error, unity 2018 is working fine tried lot of games they are working fine too arkham city,asylum,bioshock etc, when i report this problem to unity they said "we can't reproduce this problem problem will be in drivers" i tried every driver available for GPU. Not to mention i break my windows twice in this changing driver process
    my laptop is lenovo W520

    quadro 2000M 2GB
    Screen res is: 1080X1920
    i7 2nd gen

    upload_2019-8-1_14-50-51.png
     
    Last edited: Aug 1, 2019
  16. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,417
    That sounds like a different issue. Can you create a new thread about it?
     
  17. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,417
    2019.3.0a11 is now out. You can use that to test!

    And it just got merged into 2018.4.6f1, which should be out in around a week or so.
     
  18. ConanB

    ConanB

    Joined:
    Jun 25, 2019
    Posts:
    12
    Tested, and I can confirm the fix works. Cheers for looking into it!
     
  19. SamiRehman1997

    SamiRehman1997

    Joined:
    Aug 13, 2018
    Posts:
    45
  20. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,417