RaphiMC / ImmediatelyFast

Speed up immediate mode rendering in Minecraft
https://modrinth.com/mod/immediatelyfast
GNU Lesser General Public License v3.0
281 stars 22 forks source link

Buffer size of 256 MB causes huge FPS drop for Terascale GPU on linux #186

Open kevinwidjaja21 opened 5 months ago

kevinwidjaja21 commented 5 months ago

So, the issue might be upstream with mesa r600 gallium driver but I would like to document this issue here with the workaround I found. So, Terascale GPU uses a different linux driver compare to newer RDNA/GCN3+ AMD GPU and it seems that fast_buffer_upload_size_mb of 256 is too big for the Terascale GPU and fps drops to < 10 fps. The work around is to reduce it to 128 or lower.

Now, I am not asking to change this default buffer size to 256 as this doesn't seems to cause any issue on both modern Intel iris driver and amdgpu driver (have not verify with other GPU on linux). But, if anyone encountered any issue with IF or any modpacks that use IF such as Fabulously Optimized when using terascale GPU on linux, this seems to be the workaround.

RaphiMC commented 5 months ago

Can you name the exact GPU model being used

RaphiMC commented 5 months ago

Also upload a game log of when the lag happens

kevinwidjaja21 commented 5 months ago

I tried it on both HD 6970 and HD 5770. Same issue. I look for the log later.

Edit: Other GPU I tried is R9 380X, Vega 6 iGPU, and Intel Iris Plus for i5-1035G7. No FPS drop on these GPU.

kevinwidjaja21 commented 5 months ago

Below are the logs I can get so far.

[20:30:21] [main/INFO]: Loading Minecraft 1.20.4 with Fabric Loader 0.15.7
[20:30:21] [main/WARN]: Warnings were found!
 - Mod 'ImmediatelyFast' (immediatelyfast) 1.2.10+1.20.4 recommends any version of sodium, which is missing!
     - You should install any version of sodium for the optimal experience.
[20:30:21] [main/INFO]: Loading 6 mods:
    - fabricloader 0.15.7
       \-- mixinextras 0.3.5
    - immediatelyfast 1.2.10+1.20.4
       \-- net_lenni0451_reflect 1.3.2
    - java 17
    - minecraft 1.20.4
[20:30:21] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/home/nobaratestbench2/.local/share/PrismLauncher/libraries/net/fabricmc/sponge-mixin/0.12.5+mixin.0.8.5/sponge-mixin-0.12.5+mixin.0.8.5.jar Service=Knot/Fabric Env=CLIENT
[20:30:21] [main/INFO]: Compatibility level set to JAVA_17
[20:30:25] [Datafixer Bootstrap/INFO]: 198 Datafixer optimizations took 170 milliseconds
[20:30:26] [Render thread/INFO]: Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.3.5).
[20:30:26] [Render thread/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD]
[20:30:26] [Render thread/INFO]: Setting user: my_username
[20:30:26] [Render thread/INFO]: Backend library: LWJGL version 3.3.2-snapshot
[20:30:26] [Render thread/INFO]: Initializing ImmediatelyFast 1.2.10+1.20.4 on AMD CAYMAN (DRM 2.50.0 / 6.7.6-201.fsync.fc39.x86_64, LLVM 17.0.6) (Mesa) with OpenGL 4.5 (Core Profile) Mesa 23.3.6
[20:30:27] [Render thread/INFO]: Reloading ResourceManager: vanilla
[20:30:27] [Worker-Main-5/INFO]: Found unifont_all_no_pua-15.1.04.hex, loading
[20:30:30] [Render thread/WARN]: Missing sound for event: minecraft:item.goat_horn.play
[20:30:30] [Render thread/WARN]: Missing sound for event: minecraft:entity.goat.screaming.horn_break
[20:30:30] [Render thread/WARN]: Missing sound for event: minecraft:entity.generic.wind_burst
[20:30:30] [Render thread/INFO]: OpenAL initialized on device Renoir Radeon High Definition Audio Controller Digital Stereo (HDMI)
[20:30:30] [Render thread/INFO]: Sound engine started
[20:30:30] [Render thread/INFO]: Created: 1024x512x4 minecraft:textures/atlas/blocks.png-atlas
[20:30:30] [Render thread/INFO]: Created: 256x256x4 minecraft:textures/atlas/signs.png-atlas
[20:30:30] [Render thread/INFO]: Created: 512x512x4 minecraft:textures/atlas/shield_patterns.png-atlas
[20:30:30] [Render thread/INFO]: Created: 512x512x4 minecraft:textures/atlas/banner_patterns.png-atlas
[20:30:30] [Render thread/INFO]: Created: 1024x1024x4 minecraft:textures/atlas/armor_trims.png-atlas
[20:30:30] [Render thread/INFO]: Created: 128x64x4 minecraft:textures/atlas/decorated_pot.png-atlas
[20:30:30] [Render thread/INFO]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas
[20:30:30] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas
[20:30:30] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas
[20:30:30] [Render thread/WARN]: Shader rendertype_entity_translucent_emissive could not find sampler named Sampler2 in the specified shader program.
[20:30:30] [Render thread/INFO]: Created: 512x256x0 minecraft:textures/atlas/particles.png-atlas
[20:30:30] [Render thread/INFO]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas
[20:30:30] [Render thread/INFO]: Created: 128x128x0 minecraft:textures/atlas/mob_effects.png-atlas
[20:30:30] [Render thread/INFO]: Created: 1024x512x0 minecraft:textures/atlas/gui.png-atlas
[20:30:38] [Render thread/INFO]: Loaded 7 recipes
[20:30:39] [Render thread/INFO]: Loaded 1271 advancements
[20:30:39] [Server thread/INFO]: Starting integrated minecraft server version 1.20.4
[20:30:39] [Server thread/INFO]: Generating keypair
[20:30:40] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[20:30:44] [Render thread/INFO]: Preparing spawn area: 0%
[20:30:44] [Render thread/INFO]: Preparing spawn area: 0%
[20:30:44] [Render thread/INFO]: Preparing spawn area: 0%
[20:30:44] [Render thread/INFO]: Preparing spawn area: 0%
[20:30:44] [Render thread/INFO]: Preparing spawn area: 0%
[20:30:44] [Render thread/INFO]: Preparing spawn area: 0%
[20:30:44] [Render thread/INFO]: Preparing spawn area: 0%
[20:30:44] [Render thread/INFO]: Preparing spawn area: 4%
[20:30:45] [Render thread/INFO]: Preparing spawn area: 52%
[20:30:45] [Render thread/INFO]: Time elapsed: 4195 ms
[20:30:45] [Server thread/INFO]: Changing view distance to 12, from 10
[20:30:45] [Server thread/INFO]: Changing simulation distance to 12, from 0
[20:30:45] [Server thread/INFO]: my_username[local:E:1edd4185] logged in with entity id 201 at (7.300000011920929, 75.0, -6.300000011920929)
[20:30:46] [Server thread/INFO]: my_username joined the game
[20:30:46] [Render thread/INFO]: Loaded 2 advancements
[20:31:17] [Server thread/INFO]: Saving and pausing game...
[20:31:17] [Server thread/INFO]: Saving chunks for level 'ServerLevel[Test]'/minecraft:overworld
[20:31:17] [Server thread/INFO]: Saving chunks for level 'ServerLevel[Test]'/minecraft:the_nether
[20:31:17] [Server thread/INFO]: Saving chunks for level 'ServerLevel[Test]'/minecraft:the_end
[20:31:19] [Server thread/INFO]: my_username lost connection: Disconnected
[20:31:19] [Server thread/INFO]: my_username left the game
[20:31:19] [Server thread/INFO]: Stopping singleplayer server as player logged out
[20:31:19] [Server thread/INFO]: Stopping server
[20:31:19] [Server thread/INFO]: Saving players
[20:31:19] [Server thread/INFO]: Saving worlds
[20:31:19] [Server thread/INFO]: Saving chunks for level 'ServerLevel[Test]'/minecraft:overworld
[20:31:20] [Server thread/INFO]: Saving chunks for level 'ServerLevel[Test]'/minecraft:the_nether
[20:31:20] [Server thread/INFO]: Saving chunks for level 'ServerLevel[Test]'/minecraft:the_end
[20:31:20] [Server thread/INFO]: ThreadedAnvilChunkStorage (Test): All chunks are saved
[20:31:20] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[20:31:20] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[20:31:20] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved
[20:31:21] [Render thread/INFO]: Stopping!
RaphiMC commented 5 months ago

Can you install the spark mod and run the profiler for ~30 seconds while the game is lagging. The command to start the profiler should be: /sparkc profiler start --thread * --timeout 30

kevinwidjaja21 commented 5 months ago

Cannot get spark to work. It was ablet o start but nothing changes. When trying to stop the profiler manually, it said no session has been started.

xboct02 commented 3 months ago

Очевидно, что на буфер Imediatelyfast игре не хватает памяти, но производительность всё равно снижается из-за дополнительных алгоритмов(даже не эксперементальных). IMG_20240514_222450

xboct02 commented 3 months ago

И да, android не предоставляет разрешения игре на глубокие анализы системных процессов, поэтому spark бесполезен.

Felix14-v2 commented 3 months ago

И да, android не предоставляет разрешения игре на глубокие анализы системных процессов, поэтому spark бесполезен.

How is Android related to the topic?

xboct02 commented 3 months ago

И да, android не предоставляет разрешения игре на глубокие анализы системных процессов, поэтому spark бесполезен.

Как Android связан с этой темой?

Games can be run on any device, and if the problem is a lack of memory, then this does not apply to the computer.

Felix14-v2 commented 3 months ago

Games can be run on any device, and if the problem is a lack of memory, then this does not apply to the computer.

The only reliable way to run Minecraft on Android is PojavLauncher (and its clones), but it runs OpenGL on top of Vulkan via Angle or Zink, so all the performance issues related to that, not to the mod ~unless you use VulkanMod~ So it makes zero sence to draw conclusions without the native graphics.

xboct02 commented 3 months ago

This mod caches graphics data and it definitely affects RAM even if it's a zink.

GanerCodes commented 1 month ago

idk what it is but im running a 6700xt on linux and i need to change that value to 128, otherwise at 256 i got around 140FPS whereas 128 its uncapped (like 1000FPS)