rtx-remix icon indicating copy to clipboard operation
rtx-remix copied to clipboard

Infinitely Expanding Window, Potential BSoD on Hook - Xuan-Yuan Sword: The Gate of Firmament (Steam)

Open anchorlightforge opened this issue 2 years ago • 8 comments

Bug:

  • Remix will hook to the game Xuan-Yuan Sword: The Gate of Firmament then expand and reinitialize the window rapidly.
  • When the window grows past a certain size, Windows will crash and return a blue-screen. Until the system or application stops, the application will seemingly behave as normal despite the steady resolution changes.
  • According to the logs, the window increases in width and height by 50 pixels every change in the affected XYS games. This can vary depending on the title affected, such as Shadowrun Returns where only the width is affected by an error of 10px.
  • This bug only occurs in windowed mode. Affected applications will start without error in fullscreen.
  • This behavior has been observed in multiple engines and in games by multiple developers.

Environment:

  • Build: Bridge Remix 4d6dc56-6, DXVK Remix 72c4d36-90 and fe511a5
  • GPU: Nvidia Geforce RTX 3080
  • Drivers: Nvidia Studio Driver 531.41
  • Known Affected Applications:
    • Shadowrun Returns - Unity 4.2.0f4 (GOG, current release build) (only grows in width, not height; occurs on startup)
    • Xuan-Yuan Sword: The Gate of Firmament - Unity 5.0.2f1 (Steam, current release build; occurs on startup, can induce BSoD after some time)
    • Xuan-Yuan Sword: The Clouds Faraway - RenderWare (Steam, current release build; occurs on in-game resolution change)
    • Xuan-Yuan Sword: The Cloud of Han - RenderWare (Steam, current release build; occurs on in-game resolution change)
    • Deus Ex: The Fall - Unity 4.3.4f1(Steam, current release build; occurs on startup)

Logs:

Note: These logs are from a session where the application was force-closed before a BSOD could occur.

To Reproduce Steps to reproduce the behavior:

  1. Open the game and make sure that Windowed mode is enabled in the settings.
  2. Set up Bridge and DXVK Remix in the game's EXE folder.
  3. Open the application.
  4. The window initializes successfully at a default resolution of 1280x720, then grows by 50 px in width and height incrementally on repeat until the application or the system crashes.
  • In some cases, the application will stop early and begin normal operation at its larger-than-intended resolution.

The log (example from Shadowrun Returns) will report an infinite loop of the following functions:

d3d9_device.cpp:7513: D3D9DeviceEx::ResetSwapChain ->

  • rtx_resources.cpp:744: Resources::createDownscaledResources(Rc<DxvkContext>& ctx) ->

    • rtx_resources.cpp:990: Resources::executeResizeEventList(ResizeEventList& eventList, Rc<DxvkContext>& ctx, const VkExtent3D& extent)
  • rtx_resources.cpp:939: Resources::createTargetResources(Rc<DxvkContext>& ctx) ->

    • rtx_resources.cpp:990: Resources::executeResizeEventList(ResizeEventList& eventList, Rc<DxvkContext>& ctx, const VkExtent3D& extent)
D3D9DeviceEx::ResetSwapChain:
  Requested Presentation Parameters
    - Width:              2900
    - Height:             1071
    - Format:             D3D9Format::A8R8G8B8
    - Auto Depth Stencil: false
                ^ Format: D3D9Format::D24S8
    - Windowed:           true


Render resolution changed, recreating rendering resources

Target resolution changed, recreating target resources

D3D9DeviceEx::ResetSwapChain:
  Requested Presentation Parameters
    - Width:              2910
    - Height:             1071
    - Format:             D3D9Format::A8R8G8B8
    - Auto Depth Stencil: false
                ^ Format: D3D9Format::D24S8
    - Windowed:           true

Expected behavior The window should initialize at the selected resolution and maintain this resolution.

  • @Aelthien observed that enabling the "Allow Resizable Window" flag in the Unity Editor will allow a newly built Unity application to reset the swapchain correctly. (tested with Unity 2017.2.5f1, just before D3D9 support was removed) UnityMenu

anchorlightforge avatar May 31 '23 03:05 anchorlightforge

I've now confirmed that this behavior also occurs with XYS: The Clouds Faraway if you attempt to change resolution in-game.

anchorlightforge avatar May 31 '23 16:05 anchorlightforge

This bug can also be reproduced in Shadowrun Returns (GOG). It manifests differently with only width affected instead of width and height, and at a slower rate-- but the log references the same functions that were returned in the original bug report.

anchorlightforge avatar Jun 30 '23 18:06 anchorlightforge

Also occurs with Unity projects built in 2017.2.5f1

Aelthien avatar Jul 06 '23 04:07 Aelthien

Hello! Will you please test this on the latest release and let us know if the issue persists? Thank you!

NV-LL avatar May 06 '24 20:05 NV-LL

@NV-LL I can confirm that with 0.5.0 release this bug still occurs. I noticed that it did not occur on launch this time, so I can't guarantee that it's not a different bug with the same impact. To reproduce:

  1. Open an affected game-- the one above will work, any Unity game where the window is not resizable will also work.
  2. Change the resolution in-game.
  3. The window will infinitely expand, though some games eventually stop growing and begin to function again at a higher-than-intended resolution.

For convenience I have also included a video @Kim2091 created of a Kerbal Space Program alpha build where this issue occurs. This is a much earlier version of Remix and a different title in the engine, but the issue is identical in impact.

https://github.com/NVIDIAGameWorks/rtx-remix/assets/55258193/359e7342-9af7-4eca-96eb-b37c631d29e1

anchorlightforge avatar May 07 '24 04:05 anchorlightforge

Hi @anchorlightforge , is this issue distinct from issue #499 at this point, or are they duplicates of each other?

nv-ajaus avatar Jun 04 '24 18:06 nv-ajaus

@nv-ajaus It's somewhat related and most likely the same issue. I posted separate issues because we were instructed to do so for a similar cascading issue that affected multiple titles. If desired I can close the latter of the tickets.

The main difference is that in this ticket, the engine's built-in behavior for resolution switching and initialization in windowed mode will fail without certain flags enabled in-editor, while with the latter tickets the developers' implementation of resolution toggles in windowed mode triggers the same issue.

anchorlightforge avatar Jun 05 '24 14:06 anchorlightforge

REMIX-3160 for tracking

NV-LL avatar Jun 12 '24 22:06 NV-LL

Hi, @anchorlightforge - we believe a recent update may address this issue. Will you please download the latest bridge and dxvk builds and let us know if the issue persists? Thank you!

NV-LL avatar Aug 21 '24 17:08 NV-LL

@NV-LL I cleared some time to test it tomorrow for this and related titles. Thanks for your patience.

anchorlightforge avatar Aug 22 '24 19:08 anchorlightforge

I gave it a test on two affected Unity3D titles. Both of them are now crashing before the main menu displays, but XYS6 managed to open, play opening movies, etc. without this swapchain bug. I think this may be resolved but I'll continue testing and close over the weekend if I'm satisfied. As for the new crashes, I'll compile info and I think it is unrelated. Shadowrun Returns is a great test case as it includes additional logs that aren't standard with Unity games and points to an access violation.

My time is extremely limited this week so I won't be able to look at it for a while, but I want to follow up with as much info as I can before the weekend is up. EDIT: I won't have access to a Remix-capable computer for a few days, so I'll tentatively say these issues should be fixed by end-of-August.

anchorlightforge avatar Aug 23 '24 14:08 anchorlightforge

Hi @anchorlightforge - checking in to see if you've had a chance to revisit this issue since your last update. If not, no worries; we just want to make sure the ticket doesn't go stale if you're still working on it. Thanks!

NV-LL avatar Sep 11 '24 16:09 NV-LL

@NV-LL Thank you for your patience. This issue slipped my mind over the last two weeks as I've been away without a Remix capable PC. I'm conducting one last test now. Based on my findings last week:

  • Some Unity games are crashing immediately, while some crash after 3D rendering begins
    • XYS 6 is fine while displaying intro movies. Unity only allows for basic image splash screens, so at this point the engine is fully initialized and going through some basic scene(s). On the main menu as rendering begins, it will hang.
    • Shadowrun Returns will fail before displaying anything, and a third-party plugin for debugging creates a dump of the game calling out an access violation.

I've tried to set up Unity 4 and 5 on my PC for further testing, but licensing for these engines is proving to be confusing as the engine providers have removed most public-facing downloads from their website and disabled the licensing server for 4. I'll keep poking at this to see if any progress can be made.

In the meantime, what I've seen of XYS6 makes me feel confident that the swapchain bug has been fixed. I'll test the other affected titles on RenderWare and report back today. I suspect that this ticket will be closed while a new ticket will be opened up for Unity games failing on launch.

anchorlightforge avatar Sep 12 '24 14:09 anchorlightforge

#615 is open to investigate the new crashing issue and with that, I'll close this ticket as it's been addressed and fixed. Thank you for your work in continuing to improve Remix.

anchorlightforge avatar Sep 12 '24 16:09 anchorlightforge