Heavy stuttering related to block updates + Buffer Crash
ruvaldak opened this issue ยท 9 comments
What happened?
In some instances, especially extreme ones regarding block updates such as massive amounts of sugarcane growing, a bug/lack of optimization present in main Sodium causes increasingly heavy stuttering every few frames. In Iris, as this stuttering gets worse, the game will eventually crash.
Screenshots
Relevant log output
[14:02:57] [main/FATAL]: Unreported exception thrown!
java.lang.IllegalArgumentException: Not enough space in destination buffer (writeOffset + bytes > bufferSize)
at Not Enough Crashes deobfuscated stack trace.(1.16.5+build.9) ~[?:?]
at me.jellysquid.mods.sodium.client.gl.device.GLRenderDevice$ImmediateCommandList.copyBufferSubData(GLRenderDevice.java:83) ~[sodium-fabric-mc1.16.5-0.2.0+IRIS3-rev.f3caed8.jar:?]
at me.jellysquid.mods.sodium.client.gl.arena.GlBufferArena.uploadBuffer(GlBufferArena.java:62) ~[sodium-fabric-mc1.16.5-0.2.0+IRIS3-rev.f3caed8.jar:?]
at me.jellysquid.mods.sodium.client.render.chunk.backends.multidraw.MultidrawChunkRenderBackend.upload(MultidrawChunkRenderBackend.java:144) ~[sodium-fabric-mc1.16.5-0.2.0+IRIS3-rev.f3caed8.jar:?]
at me.jellysquid.mods.sodium.client.render.chunk.ChunkRenderManager.updateChunks(ChunkRenderManager.java:494) ~[sodium-fabric-mc1.16.5-0.2.0+IRIS3-rev.f3caed8.jar:?]
at me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer.updateChunks(SodiumWorldRenderer.java:227) ~[sodium-fabric-mc1.16.5-0.2.0+IRIS3-rev.f3caed8.jar:?]
at net.minecraft.client.render.WorldRenderer.setupTerrain(WorldRenderer:4186) ~[?:?]
at net.minecraft.client.render.WorldRenderer.render(WorldRenderer:1131) ~[?:?]
at net.minecraft.client.render.GameRenderer.renderWorld(GameRenderer:727) ~[?:?]
at net.minecraft.client.render.GameRenderer.render(GameRenderer:546) ~[?:?]
at net.minecraft.client.MinecraftClient.render(MinecraftClient:1048) ~[?:?]
at net.minecraft.client.MinecraftClient.run(MinecraftClient:681) ~[?:?]
at net.minecraft.client.main.Main.main(Main:215) [intermediary-minecraft-1.16.5-client.jar:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:234) [fabric-loader-0.11.6.jar:?]
at net.fabricmc.loader.launch.knot.Knot.launch(Knot.java:153) [fabric-loader-0.11.6.jar:?]
at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:28) [fabric-loader-0.11.6.jar:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196) [NewLaunch.jar:?]
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231) [NewLaunch.jar:?]
at org.multimc.EntryPoint.listen(EntryPoint.java:143) [NewLaunch.jar:?]
at org.multimc.EntryPoint.main(EntryPoint.java:34) [NewLaunch.jar:?]
Iris and Minecraft Version
MC: 1.16.6, iris version: all
Are you running Sodium along with Iris?
Yes
Operating System
Arch Linux
What is your GPU?
RTX 2080ti
Java Version
Java 8, Java 11, Java 16
Additional context
I am convinced the stuttering is related to the crashing, however I as of yet cannot get stock sodium to crash in the same manner as sodium+iris. Even with shaders disabled, sodium+iris will eventually crash if the stuttering goes on long enough.
I believe that, while this only happens presently in extreme situations, the problem exists at all time and is merely brought to surface faster by extreme situations; similar to some sort of memory leak or program that isn't cleaning up properly after itself.
This issue should be linked to in sodium's GitHub issues as well, as it seems to be related to iris and sodium.
I've as of yet had no luck getting the game to crash on single player, but multiplayer seems to be quite constant in some situations, especially a sugar cane farm I've built on a Skyblock server. Thanks to a spigot plugin, I'm able to plant sugarcane without water nearby, which allows me to create a massively dense sugarcane farm which no doubt pulls a lot of shenanigans to prevent the sugar cane from exploding on block updates.
Same issue for me on win10 with a gtx1650
* For me it doesn't need to be "extreme" block updates, casual mining will cause drops down to 4fps - where I exited before crash
I opened an already generated creative world with no buildings and had massive drops just flying around on 1.17 on a GTX1650 too. The drops were from 105fps to around 4~10fps and happened continuously.
You're reporting this under the wrong ticket. This has been fixed in dev. Please do not use github issues for unrelated things to report issues.
I have successfully made a workaround for sodium 0.16.x in CaffeineMC/sodium-fabric#740, if you're interested.
I also applied my patch to sodium's iris fork, with great success. Stuttering is mostly gone, crashes do not occur.
@coderbot16 are you interested in updating the 1.16.5 branch with this workaround? I suppose in 1.17 this would be irrelevant, given the architectural redesign made throughout sodium's 1.17 branch. (I still play in 1.16.)
Since Iris now uses official Sodium (and has done so since 1.1.3), we probably won't be addressing this on our side now. CaffeineMC/sodium-fabric#740 is probably the best place to continue discussing this.
Same issue for me on win10 with a gtx1650
- For me it doesn't need to be "extreme" block updates, casual mining will cause drops down to 4fps - where I exited before crash