REFramework icon indicating copy to clipboard operation
REFramework copied to clipboard

MHWilds occasional extreme stuttering caused by "D3D12 resize target called" reset

Open Saren-Arterius opened this issue 10 months ago • 4 comments

Describe the bug The game runs normally until it stutters and drops to 5-10 FPS. If the REFramework window is open, it will flash several times. This issue doesn't occur without REFramework installed or in unmodded MHWilds.

This issue is more likely to occur the longer the game is running. Using freecam and traveling very quickly/far is likely to trigger the issue.

After the occasional stutter, the MHWilds overlay loses all DPS-related information (due to the reset).

Upload logs and any crash dumps

(normal initialization...)
[2025-03-12 02:54:25.536] [REFramework] [info] D3D12 resize target called
[2025-03-12 02:54:25.536] [REFramework] [info]  Parameters: new_target_parameters 1ef3e420
[2025-03-12 02:54:25.536] [REFramework] [info] callstack: 
dinput8+0x1BBEC
MonsterHunterWilds+0x21AE11
MonsterHunterWilds!CHECKSUMAPI_OBFUSCATE_MAXIMUM_CODEMARKER+0x29111F
MonsterHunterWilds+0x1C2E0E
MonsterHunterWilds!AK::WriteBytesCount::SetCount+0x535EE
MonsterHunterWilds!AK::WriteBytesCount::SetCount+0x77AF8
KERNEL32!BaseThreadInitThunk+0x14
ntdll!RtlUserThreadStart+0x21

[2025-03-12 02:54:25.536] [REFramework] [info] Reset!
[2025-03-12 02:54:25.538] [REFramework] [info] VR: on_device_reset
[2025-03-12 02:54:25.540] [REFramework] [info] Attempting to initialize DirectX 12
[2025-03-12 02:54:25.540] [REFramework] [info] [D3D12] Creating DXTK graphics memory...
[2025-03-12 02:54:25.540] [REFramework] [info] [D3D12] Creating command allocator...
[2025-03-12 02:54:25.540] [REFramework] [info] [D3D12] Creating RTV descriptor heap...
[2025-03-12 02:54:25.540] [REFramework] [info] [D3D12] Creating SRV descriptor heap...
[2025-03-12 02:54:25.540] [REFramework] [info] [D3D12] Creating render targets...
[2025-03-12 02:54:25.540] [REFramework] [info] [D3D12] Swapchain buffer count: 2
[2025-03-12 02:54:25.540] [REFramework] [info] [D3D12] Back buffer format is 24
[2025-03-12 02:54:25.551] [REFramework] [info] [D3D12] Initializing ImGui...
[2025-03-12 02:54:25.551] [REFramework] [info] REFramework initialized
[2025-03-12 02:54:25.635] [REFramework] [info] D3D12 resize target called
[2025-03-12 02:54:25.635] [REFramework] [info]  Parameters: new_target_parameters 1ef3e420
[2025-03-12 02:54:25.636] [REFramework] [info] callstack: 
dinput8+0x1BBEC
MonsterHunterWilds+0x21AE11
MonsterHunterWilds!CHECKSUMAPI_OBFUSCATE_MAXIMUM_CODEMARKER+0x29111F
MonsterHunterWilds+0x1C2E0E
MonsterHunterWilds!AK::WriteBytesCount::SetCount+0x535EE
MonsterHunterWilds!AK::WriteBytesCount::SetCount+0x77AF8
KERNEL32!BaseThreadInitThunk+0x14
ntdll!RtlUserThreadStart+0x21

[2025-03-12 02:54:25.636] [REFramework] [info] Reset!
[2025-03-12 02:54:25.637] [REFramework] [info] VR: on_device_reset
[2025-03-12 02:54:25.637] [REFramework] [error] [APIProxy] Exception occurred in on_pre_application_entry callback (BeginRendering); one of the plugins has an error.
[2025-03-12 02:54:25.647] [REFramework] [info] Attempting to initialize DirectX 12
[2025-03-12 02:54:25.647] [REFramework] [info] [D3D12] Creating DXTK graphics memory...
[2025-03-12 02:54:25.647] [REFramework] [info] [D3D12] Creating command allocator...
[2025-03-12 02:54:25.647] [REFramework] [info] [D3D12] Creating RTV descriptor heap...
[2025-03-12 02:54:25.647] [REFramework] [info] [D3D12] Creating SRV descriptor heap...
[2025-03-12 02:54:25.647] [REFramework] [info] [D3D12] Creating render targets...
[2025-03-12 02:54:25.647] [REFramework] [info] [D3D12] Swapchain buffer count: 2
[2025-03-12 02:54:25.647] [REFramework] [info] [D3D12] Back buffer format is 24
[2025-03-12 02:54:25.648] [REFramework] [info] [D3D12] Initializing ImGui...
[2025-03-12 02:54:25.648] [REFramework] [info] REFramework initialized
[2025-03-12 02:54:25.656] [REFramework] [info] D3D12 resize target called
[2025-03-12 02:54:25.656] [REFramework] [info]  Parameters: new_target_parameters 1ef3e420
(repeat for 5-10 times)

Full log: https://drop.wtako.net/file/de876a2f6ab822c16c9613973e78bc258ee5f407.txt

Identify the REFramework version Nightly 01104/01105

Desktop and VR (please complete the following information):

  • Windows 10 very fresh install
  • RTX4090 572.60
  • 9800X3D and 96GB ram

Mods used (latest ATM):

  • MHWilds overlay
  • CatLib
  • reframework-d2d No similar bug report for the mods.

Tried:

  • DLSS FG off or on
  • reflex off or on
  • Upscaling off
  • Turned off MSI Afterburner/RiverTuner stat server
  • Pitikapp, hwinfo64, fancontrol are left on

To Reproduce Steps to reproduce the behavior:

  1. Install the mods
  2. Open freecam
  3. Turn up speed to maximum, fly around and far (or hunt normally for me)
  4. Stutter occurs for a second

Expected behavior The game runs normally with REFramework installed without stuttering issue.

Saren-Arterius avatar Mar 11 '25 19:03 Saren-Arterius

The issue is wilds randomly resizing the backbuffer during certain events like USB getting removed and re-inserted.

praydog avatar Mar 11 '25 23:03 praydog

The issue is wilds randomly resizing the backbuffer during certain events like USB getting removed and re-inserted.

Thanks for the major hint! I can confirm in Linux dmesg that there are occasional USB Hub related disconnect/new events, caused by autosuspend/powersave. Now it's my hardware problem to solve.

Saren-Arterius avatar Mar 12 '25 08:03 Saren-Arterius

Workaround works.

I used a smaller USB hub (3 ports, for keyboard, mouse, and audio only) and disconnected the very large USB hub (16 ports). I also unchecked all "Allow the computer to turn off this device to save power" checkboxes for all USB-related entries in Windows Device Manager. However, if I use the large USB hub instead, the disconnect events still occur (although less likely), even after unchecking all the "save power" checkboxes of newly connected USB hub devices.

Saren-Arterius avatar Mar 12 '25 18:03 Saren-Arterius

This should be fixed in the newest nightly.

praydog avatar Mar 14 '25 00:03 praydog