-
Notifications
You must be signed in to change notification settings - Fork 832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RivaTuner Statistics (RTSS) causes extreme performance issues #2048
Comments
Disabling "Use No Error Context" under Video Settings -> Performance should work around this issue, but you will lose a bit of performance. |
The overlay which RivaTuner provides is rendered using legacy OpenGL functions, and it needs to hook into the game process so that it can enable these functions. Unfortunately, Sodium is also trying to enable a "No Error Context", and that's mutually exclusive with using legacy OpenGL functions, which get disabled when the other is enabled. There is nothing we can do to actually fix this problem. At best, we can terminate the game instantly if an OpenGL error occurs, to prevent the game from filling the hard drive with logged errors. |
Is this documented anywhere or was it just discovered through trial-and-error? 😆 I couldn't find anything about this on the Khronos wiki. |
It's not actually described that it should work this way in the OpenGL specification. It's just been my observation with the drivers on Windows. And quite frankly it's the only explanation which makes any sense... though I could be wrong. |
If someone finds a way to fix this, then feel free to open a pull request... but as it stands I'm not going to waste my time trying to resolve this -- it's almost impossible to fix issues which are caused by other processes randomly hacking into your application. |
Future versions of Sodium will prevent the use of RivaTuner entirely with an error on startup. It's not possible to fix the compatibility issues with it, and having it hooked into the game causes severe problems. If you depend on Rivatuner, then you can do one of two things:
|
Just a correction: RTSS isn't useful to look at FPS, obviously, since there are a million of alternatives. But to cap framerates in a reliable way. Therefore it's not the overlay the useful function, and crashing the whole thing regardless may simply be counterproductive. Disabling the option "No Error Context" when you detect the program, or even show a warning screen would be much more logical and practical solutions. |
We can't disable the "No Error" bits once the context has been created. The game would have to be restarted in order to apply any kind of workaround. And waiting for the user to restart the game themselves, when their hard drive is being filled by logged errors, is not really an acceptable solution. |
Then forcefully crash after setting the option and restart with the workaround applied? Making sure to add an explicit warning just in case someone goes switching the option back from the game, in case you cannot detect it at that time. |
You guys borked something. Setting the use_no_error_g_l_context flag to true or to false changes nothing. I still crash with the RivaTuner warning message |
I've set an exclusion in RTSS for Are we actually checking if RTSS is hooking into the game? If so, what is the mechanism? |
Not sure... it's checked here For now, you can set the flag from the error it gives you |
There's nothing wrong with the checks that Sodium is using. RivaTuner injects itself into everything and only conditionally decides to actually hijack the process. It's not possible for us to know whether or not RivaTuner is actually doing something, so we have to assume that the presence of the module is evidence of it doing so. We have many reported issues (#2088, #2095, #2119, #2171...) and many more support threads on our Discord server which all demonstrate this problem. The only thing which fixed these problems was disabling RTSS, so that the module wasn't loaded into the game any longer. |
I read whole thread and still not understand why you can't crash game once (if you really can't change it on go) and give single popup with "hey, we detected this app, it does some errors so we had to disable this setting, oki?" instead of those crashing shenanigans |
I'm not interested in permanently disabling features of the mod because the user happened to have some software running on their computer. Even then, I'm under the impression that more than just the "No Error" context bits are interacting poorly with Rivatuner, based on other support threads we've seen. Graphics drivers do in fact change their behavior when a Compatibility context is requested, and that in turn can silently change the behavior of Sodium's rendering without us really knowing. |
It is possible for me to know, because I set the exclusions in RTSS running on my computer. |
Then |
As has already been mentioned, the game crash does give important information on a) why this problem happens, b) what can be done about it, and c) how you bypass the checks. We only use a JVM argument here (instead of an entry in the config file) to stop modpack authors from (easily) overriding the default. Doing so is almost always a bad idea if you're distributing Sodium alongside something else, since you cannot reasonably know the configuration of every computer the modpack is going to run on. |
It's in the log file, not the crash report file. Those log files will be in |
It seems like the problem here is not really our implementation, but rather the launcher not being helpful. I'm going to see about creating a wiki page on this repository, and change the URL mentioned in the crash message to point to the wiki with a full description of the problem. |
Yeah the message is not really user friendly and i like to think of myself as a pro user and not a dumb one.. Just swapping out the old message for the one you pasted earlier would be enough, even better if you could guide the user on how to set java arguments for the vanilla launcher |
There is now an entry for the RivaTuner issues in our wiki. We'll publish an update for Sodium in the upcoming days which changes the error message to link to this wiki page. |
OK, so as per usual, when we implement "workarounds" for things, it tends to really stir people up. Someone else, after hearing about these problems, was able to figure out more precisely what's causing the compatibility problem. Summarily: The problems with Sodium only occur if RivaTuner 7.3.3 or older is being used. When using RivaTuner 7.3.4 (and newer?), it works correctly. The changelog actually mentions this:
So it seems like other applications were affected, and they just preferred to self-terminate rather than grinding to a halt like Minecraft does. Anyways... this doesn't help us any. The authors of RivaTuner do not correctly include version information within the module they are injecting into the game, so we can't actually determine which version is installed. So the workaround is going to remain in Sodium until someone engineers a way to detect it, or until the authors of RivaTuner begin including version information. |
Sodium 0.5.5 at least includes better error diagnostics so that users receive a link to the wiki, with instructions on how to disable the check (if they must.) |
It seems the author of RTSS is not interested in doing the bare minimum to include a version string within the module they are injecting. Their response is frustrating and utterly dismissive, for a number of reasons:
Anyways, the solution we are now using to detect the RTSS version is relatively straight-forward, even if it's a huge pain to write in Java (due to the misery that is C/Winapi interop)...
Also, you will need to do the following things:
If anyone else doing module injection reads this, please include a version string in your module. This should not take you more than 30 seconds and it saves other people a world of pain. |
Bug Description
Upon enabling the MSI Afterburner overlay/Rivatuner Statistics, the game starts to lag. Concurrently, there's a consistent spam of OpenGL debug error messages in the console. These error messages are predominantly of the type "GL_INVALID_OPERATION" and "GL_INVALID_ENUM", saying that OpenGL functions like 'glPushAttrib' and 'glPopAttrib' are deprecated. This behavior does not occur when running the game with Sodium disabled.
The game itself does not crash but experiences significant lag due to these errors.
This issue seems to be exclusive to scenarios where both Sodium and overlays (I've been using MSI Afterburner which for me causes this bug) are active.
Mods I'm using:
Sodium [1.20.1 0.5.2]
Fabric API [1.20.1 0.87.0]
Reproduction Steps
There you go, it should be filled with 100s of thousands of opengl messages
Log File
latest.log
Crash Report
crash-2023-08-27_02.13.17-client.txt
The text was updated successfully, but these errors were encountered: