Iris Shaders

Iris Shaders

38M Downloads

Excessive VRAM allocations being exacerbated by using shaders in Iris 1.6.5 with Sodium 0.5.0.

PlanetSun3 opened this issue ยท 5 comments

commented

What happened?

Ever since Iris 1.6.5 and Sodium 0.5.0 the game has been allocating significantly more VRAM despite using less.

To reproduce is simple:

  1. Load up a single world mangrove swamp (this uses a ton of VRAM on it's own so the issue is clear)
  2. Turn around to load in all the chunks
  3. Do this in both 1.6.4 and 1.6.5 and observe the second number next to device memory

I also attached a screenshot of moving around causing insane stutters due to the excessive allocations. My GPU has 12GB of vram so it should easily handle a scene with 6GB with room for the framebuffer (I am running at 4K after all) and miscellaneous applications in the background.

Numbers (efficiency derived from dividing used vram by allocated vram):
0.4.10/1.6.4 standing still: 6950/7484 MiB (92.86% efficiency)
0.5.0/1.6.5 standing still: 6115/10714 MiB (57.07% efficiency)
0.5.0/1.6.5 moving around: 5970/11498 MiB (51.92% efficiency)

It is allocating almost twice as much as it is using, causing stutters that shouldn't exist.

Screenshots

2023-08-05_19 32 22
2023-08-05_19 35 17
2023-08-05_19 35 47

Log output

Logs didn't show anything interesting to me but sure here it is:
latest.log

Minecraft Version

Minecraft 1.20.1

Iris Version

iris-mc1.20.1-1.6.5.jar

Operating System

Windows 10

What is your GPU?

Nvidia GeForce RTX 3080 Ti

Additional context

I believe this might actually be a sodium issue that's been exacerbated by Iris, so please let me know if I should file this bug report there as well.

commented

What resource pack? I have the same GPU and tried to duplicate your result and for the Sodium 0.5 case I get about 3200 MB used, not 6000. I assume this is render distance 32 that you're testing at but that would also be good to show.

commented

Looks like you have a lot of water on your left, so try getting far inland to really get the vram high. But my main concern is the ratio of used to allocated VRAM. For you it's even worse than me, 3234/8020 is only 40.32% efficiency. I'm not using any resourcepacks that would inflate VRAM usage like 3d vines. Yes I am using 32 chunks, you can see that in D: 32. Also, are you sure you loaded up a single biome mangrove swamp, looks like there are deserts or something?

commented

Ah, I missed the detail of it having to be a single-biome world, I had teleported to a large-ish mangrove swamp in a standard world.

In a single-biome world I do see the extreme memory use and thrashing you see.

commented

2023-08-15_00 38 20
Ive found a similar issue in one of my worlds while flying around. I use a 16x PBR self-made texture pack that makes the game look nicer and helps it run alongside shaders like Complementary Reimagined which supports PBR. I am certainly aware that the pack is intensive but its worth mentioning that in previous versions of Iris and Sodium my game played at around 40FPS-lowest 80FPS-highest @ 20 RendDist - 12Sim.Dist -16ShadowDist - with tons of intensive mods.
Currently, im running my game at 16Rend.Dist - 8Sim.Dist - 10ShadowDist - Very Few Mods @ 1080p - RTX3070 - Ryzen 9 5900x - 8GB allocated. This gets me 160FPS-highest -10-Lowest
In other words my system is taking up significantly more resources since as far back as 1.19.3 and while I am aware this is partly because Minecraft is terribly optimized and makes frequent changes to its code. Slowdowns such as these have never been as bad before while mods such as Iris and Sodium have been installed at least.

After installing Sodium 0.5.1 and Iris 1.6.7 I can confirm that the issue is still present. I've ruled out other potential sources of the problem by attempting to troubleshoot, but to no avail. I hypothesized the following to be the source of the issue but troubleshooting them did not fix the issue:

-Turning shaderpack's shadow resolution and shadow distance down drastically and turning POM off.
-Changing shaderpack
-Changing Fabric &/or Quilt version
-Changed java (to adoptium) and its arrangements (From 8GB to more or less)
-Loaded up older (less intensive) versions of my resource pack
-Updated drivers
-Updated windows
-Systematically narrowed down mods that might cause the issue. (its definitely Iris or Sodium)
-Systematically benchmarked performance with settings enabled vs disabled (There was no culprit)

Its worth mentioning that the areas my system tends to struggle in are mountainous biomes and foliage-intensive biomes. This is presumably due to the vast number of custom models (flowers) and POM textures being loaded which of course takes up a lot of VRAM from my cards 8GB. While its true I only have 8GB of VRAM that was more than enough in previous versions of Iris/Sodium/Minecraft while right now, its bottlenecking me.
But it also appears that slowdowns or drops in FPS don't occur with shaders turned off while in the same areas, even though the same resource pack is being used. So it would seem that Sodium's renderer is doing its job from what I can tell. The same issue also did not occur when using older versions of Minecraft and iris. That being said, there are compromises I have found that rectify the issue such as:

-Turning off shaders with resource pack enabled
-Turning down shader settings to potato quality
-Turning down render distance drastically (-8)
-Turning off resource packs with shaders enabled

2023-08-15_00 36 54
2023-08-15_00 37 06

commented

Just giving a quick update, frame times have improved alot when viewing the same world at certain angles with the latest sodium 0.5.3 and Iris 1.6.10. However, when moving around the world while flying or while looking around too quickly VRAM allocation goes as high as about 11000MB before a frozen screen with excessive lag occurs which then crashes outright. Ive made sure to have my instance installed on a highspeed nvme and reverted any changes I made to java through the nvidia control panel but to no avail.
Weirdly it spikes really hard when looking at this particular wandering trader but I can confirm this is not due to the resourcepack since I optimized it beforehand to eliminate any old, broken, or intensive textures/files. For refference the pack used to be 75Mb and is now 35MB.

2023-12-01_16 45 32
2023-12-01_16 44 49