Sodium

Sodium

35M Downloads

Crashing with NVIDIA Drivers version 536.23

BluebirdYT opened this issue ยท 14 comments

commented

Version information

sodium-fabric-mc1.20-0.4.10+build.27

Reproduction Steps

  1. Hold down f3+a for 3-10 seconds
  2. The game crashes

Crash Report file

Crash Report:
[Removed to protect personal info]

Latest Log:
latest.log

Additional information

I have recently updated my NVIDIA Drivers to version 536.23 and started crashing a lot. I had no crashes before I updated and now I am experiencing so many. I just randomly crash when switching servers and holding f3+a down for a while. These are the two most common crashes I get. This crash also started to happen in versions 1.19.2-1.20 (The ones I've tested so far) while previously 1.19.2-1.20 were not crashing.

commented

The workaround introduced by #1486 is no longer working, since it seems NVIDIA changed the application detection logic for Minecraft. Unfortunately, it's very hard for us to workaround, because they're checking the command line arguments of the process for the string net.minecraft.client.main.Main (with one space on each side of the string), and then installing a DRS profile with Threaded Optimization and some other things enabled, which are unstable and cause crashes.

commented

You can workaround this issue by using Prism Launcher instead of the vanilla launcher. This prevents the NVIDIA drivers from detecting Minecraft, but it results in reduced performance as their optimization can no longer take effect. The reason why Prism Launcher is not affected comes down to the fact that it doesn't pass -DFabricMcEmu= net.minecraft.client.main.Main as a JVM argument, which the NVIDIA drivers are looking for.

We'll have to look into whether we can implement some additional NVIDIA-specific optimizations in Sodium in order to make up for this difference.

commented

Prism launcher actually works in this case, it no longer crashes.

commented

I may be stating the obvious, but it appears that at least a part of the optimizations has to do with chunk loading.

commented

We have an issue for tracking the performance issues on NVIDIA as well (see #1830.) The discussion would be better suited there.

commented

Is this about the original set of OpenGL optimizations that caused issues, or is this a new set?

commented

It seems to be the same set of OpenGL optimizations, though figuring out what exactly they're doing is difficult. The only thing that has obviously changed is the way it detects whether the optimization should be applied.

commented

I've spent some time looking into what the driver is doing, and I don't think there is any way for us to workaround this without egregious hacks. The current running theory is that we can try hooking into the Win32 function GetCommandLineW and strip the process command line, so that when the NVIDIA driver queries it on OpenGL context creation, it is unable to detect the presence of Minecraft.

Either that, or we will block all NVIDIA users from using Sodium, because they cannot stop breaking our mod...

commented

Is there something we as users can do to advance this issue on Nvidia's side? Some public issue to upvote? How can we let Nvidia know that this issue exists and is affecting us?

commented

We already tried to generate a lot of noise by giving every NVIDIA user a pop-up warning on game startup, which asked that they submit a bug report. A NVIDIA representative said they were aware of the issue, and that a bug had been filed internally, but we have not heard anything since. Fast forwarding to now, they have changed the process detection to be much more difficult to dodge, and it's still been radio silence.

This is the same issue we've ran into when reporting bugs to AMD's engineers. We make phone calls even, and something get raised "internally" and then we never hear back again.

I just don't think we register on the radar of these companies. Getting these issues fixed never works out.

commented

We've implemented some exceedingly terrible workarounds in Sodium to try and solve this problem. The initial user reports suggest that all crashes have been fixed, micro-stutter is significantly reduced, and that frame rates are (on average) improved by 50% to 250%.

commented

Shouldn't the previous workaround be scrapped if it doesn't work?

commented

Fixed in Sodium 0.5.0.

commented

Weird, I have not updated to sodium 0.5.0 but I noticed it stopped crashing recently, I haven't changed anything & I am using 531.79, which released may 2nd, does the sodium fix apply to previous versions in some way? (I am using the latest 1.19.2 build on modrinth, yes im a bit outdated lol)