Windows Game crashes when resolution is changed (multi GPU)

drewdgt

Newcomer
Hi, my system has two NVIDIA GPUs, a RTX 2080 Super and a RTX A4000. The monitor is connected to the RTX 2080 Super. This worked fine when the system had Windows 10 but I recently installed Windows 11 and now the game crashes when I do either of the following:
  • Change the "Window Mode" setting from "Windowed Borderless" to "Windowed" or vice versa. The game does remember that this setting was switched the next time it starts.
  • Change the game window size when it starts with the "Windowed" setting.
I have Stardew Valley Modding API installed, but the crash still occurs when "Stardew Valley.exe" is executed independently. And it occurs after the Modding API is uninstalled. The crash does not occur when the A4000 is disabled using Windows Device Manager. I've read troubleshooting guides that say the game should be configured to run on a specific GPU, but I've already set the game EXE (and the SMAPI exe) to run on the 2080 and that does not fix it. I've also tried clean installs of multiple versions of the Game Ready GPU driver. Currently I have the latest version (581.29) installed.

In Windows Event Viewer I see the following events associated with the crash:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Application: Stardew Valley.exe
CoreCLR Version: 6.0.3224.31407
.NET Version: 6.0.32
Description: The process was terminated due to an internal error in the .NET Runtime at IP 00007FFBDF054089 (00007FFBDEE80000) with exit code c0000005.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Faulting application name: Stardew Valley.exe, version: 1.6.15.24356, time stamp: 0x666c0000
Faulting module name: coreclr.dll, version: 6.0.3224.31407, time stamp: 0x666c84f2
Exception code: 0xc0000005
Fault offset: 0x00000000001d4089
Faulting process id: 0x25AC
Faulting application start time: 0x1DC26D3C9EC34ED
Faulting application path: E:\SteamLibrary\steamapps\common\Stardew Valley\Stardew Valley.exe
Faulting module path: E:\SteamLibrary\steamapps\common\Stardew Valley\coreclr.dll
Report Id: 27ce5e06-3d1e-4762-9dee-6f4246450aae
Faulting package full name:
Faulting package-relative application ID:

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Fault bucket 1767960118263325933, type 4
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: Stardew Valley.exe
P2: 1.6.15.24356
P3: 666c0000
P4: coreclr.dll
P5: 6.0.3224.31407
P6: 666c84f2
P7: c0000005
P8: 00000000001d4089
P9:
P10:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I did observe that when running with mods with the A4000 not disabled, the SMAPI log file has this line: "[23:44:55 TRACE SMAPI] Running on GPU: NVIDIA RTX A4000/PCIe/SSE2". When the A4000 is disabled, that message changes to show that is running on the 2080 Super. So it seems that specifying the GPU in Windows Graphics Settings is not working correctly.

And when I run the modding EXE from the command prompt, the following error is written to the console when it crashes:
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformPresent()
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop()
at Microsoft.Xna.Framework.Game.Run(Microsoft.Xna.Framework.GameRunBehavior)
at StardewModdingAPI.Framework.SCore.RunInteractively()
at StardewModdingAPI.Program.Start(System.String[])
at StardewModdingAPI.Program.Main(System.String[])
 

drewdgt

Newcomer
I focused on what might cause an application to ignore the Windows GPU Preference setting and I decided to investigate the settings in NVIDIA control panel. I changed the "OpenGL rendering GPU" setting to the RTX 2080 Super in base profile and that seems to have fixed it.
 
Top