daretmavi Posted January 22, 2022 Report Share Posted January 22, 2022 It seems, that turning mesa_glthread on gives nice performance boost. (Avg FPS from 58 to 71) Change vintagestory.desktop file mono Vintagestory.exe to mesa_glthread=true mono Vintagestory.exe mesa_glthread is off mesa_glthread is on Not sure about the stability. I have to test it a little bit more, but it looks promising. Tested with AMD RX580 graphic card. Link to comment Share on other sites More sharing options...
Tyron Posted January 24, 2022 Report Share Posted January 24, 2022 Very nice, is that something I could add by default for all distris? Link to comment Share on other sites More sharing options...
daretmavi Posted January 24, 2022 Author Report Share Posted January 24, 2022 (edited) Not sure yet, the game seems to be freezing in the menu. Mostly on startup, or if I switch full-screen (F11). Edited January 24, 2022 by daretmavi Link to comment Share on other sites More sharing options...
daretmavi Posted January 24, 2022 Author Report Share Posted January 24, 2022 The game itself runs fine. Looks like game menu needs some love. Link to comment Share on other sites More sharing options...
rogston Posted January 29, 2022 Report Share Posted January 29, 2022 I've been trying few methods: compile mono with llvm support, mono -O=all, wine-proton but none gave a performance boost. Mesa_glthread didn't improve my performance tests (4k, max settings), it does crash if I switch working environment and occasionally when entering the main menu. Spoiler Normal performance: mesa_glthread=true: Settings: For me the biggest issue is the input delay after playing for a while, it mostly affects when moving around generating new terrain. The game is responsive but the view and mouse cursor are 0.5-1s behind the actual input. Worst case is if you load the world multiple times during a session and the lagging tends to continue even on a fresh start. Easiest fix is to restart the game completely but it's not great if you have to do it every hour or so. I wonder if it's linux/mono or the game causing the issue. Link to comment Share on other sites More sharing options...
Tyron Posted January 30, 2022 Report Share Posted January 30, 2022 20 hours ago, rogston said: The game is responsive but the view and mouse cursor are 0.5-1s behind the actual input. Set mouse smoothing to 0, in case you haven't already Link to comment Share on other sites More sharing options...
rogston Posted January 30, 2022 Report Share Posted January 30, 2022 1 hour ago, Tyron said: Set mouse smoothing to 0, in case you haven't already I've always had the mouse smoothing off. I suspect that the terrain generation is causing the issue since it's pushing gpu usage to 100% when travelling around. Having a limiter to cap terrain gen processing on the gpu to 95% would probably help. Check the following video for more info. Link to comment Share on other sites More sharing options...
Sinda Posted January 30, 2022 Report Share Posted January 30, 2022 (edited) I recently also have issues with performance on linux, game is using almost all of my 16 GB ram and GPU shows a big lag spikes. Dunno what happened, but I'm using 1.16.1 version of the game, all my mods are updated, checked almost everyone of them and it isn't an issue with mods. When I generated totally new world ram usage went down quite drastically. I have an i5 processor so it rather shouldn't happen. Edited January 30, 2022 by Sinda Link to comment Share on other sites More sharing options...
daretmavi Posted February 3, 2022 Author Report Share Posted February 3, 2022 On 1/30/2022 at 1:08 PM, Sinda said: I recently also have issues with performance on linux, game is using almost all of my 16 GB ram and GPU shows a big lag spikes. Try to set different Ram optimalisations and set fps limit. Link to comment Share on other sites More sharing options...
Sinda Posted February 3, 2022 Report Share Posted February 3, 2022 Already changed quality preset to "low" and it helped, but imho on PC with i5 and 16GB ram I shouldn't need to do that. Link to comment Share on other sites More sharing options...
Unquadtrium Posted September 8, 2022 Report Share Posted September 8, 2022 On 1/29/2022 at 1:45 PM, rogston said: The game is responsive but the view and mouse cursor are 0.5-1s behind the actual input. The fix for this (and input lag in general, even in other games) is to run the game with libstrangle, like this: (pick whatever target framerate you want) strangle 60 mono ./Vintagestory.exe I am not sure why this helps in Vintage Story, as usually this "trick" only solves the 1-2 frames (at minimum) worth of input lag in other games (such as most Source engine games) by changing the moment at which the framebuffer is flipped enough to stop extra frames from being buffered in the GPU driver side (nVidia drivers for example are known to buffer anywhere from 1 to more than 5 frames). This however, does not explain the 0.5 - 1s worth of lag in Vintage Story, as that is very excessive. Perhaps OpenTK (if that is still used for windowing and input) has a sub-optimal input handler which makes things worse on high input rate (1000Hz) devices and libstrangle somehow manages to "throttle" that as well, so it has to process less events (and less stale events) each frame. In any case, with this "tweak", the input lag is almost completely gone, and moving around no longer correlates to higher CPU usage as well. 1 Link to comment Share on other sites More sharing options...
Tyron Posted September 8, 2022 Report Share Posted September 8, 2022 Neat! I added a small section for this on the wiki - https://wiki.vintagestory.at/index.php/Framerate_and_Performance#For_Linux_users 1 Link to comment Share on other sites More sharing options...
rogston Posted September 11, 2022 Report Share Posted September 11, 2022 On 9/8/2022 at 3:01 AM, Unquadtrium said: The fix for this (and input lag in general, even in other games) is to run the game with libstrangle, like this: (pick whatever target framerate you want) strangle 60 mono ./Vintagestory.exe I am not sure why this helps in Vintage Story, as usually this "trick" only solves the 1-2 frames (at minimum) worth of input lag in other games (such as most Source engine games) by changing the moment at which the framebuffer is flipped enough to stop extra frames from being buffered in the GPU driver side (nVidia drivers for example are known to buffer anywhere from 1 to more than 5 frames). This however, does not explain the 0.5 - 1s worth of lag in Vintage Story, as that is very excessive. Perhaps OpenTK (if that is still used for windowing and input) has a sub-optimal input handler which makes things worse on high input rate (1000Hz) devices and libstrangle somehow manages to "throttle" that as well, so it has to process less events (and less stale events) each frame. In any case, with this "tweak", the input lag is almost completely gone, and moving around no longer correlates to higher CPU usage as well. Thanks for the info. I got strangle to work with proton and native games but no luck with vs on latest stable mono version. No error messages on cli or logs. Link to comment Share on other sites More sharing options...
Sinda Posted September 11, 2022 Report Share Posted September 11, 2022 (edited) Well tried it on debian and this is the result: Running on 64 bit Linux with 15 GB. Game Version: v1.17.3 (Stable) 11.09.2022 11:08:10: Critical error occurred Loaded Mods: OpenTK.Graphics.GraphicsContextException: Failed to create OpenGL context. Glx.CreateContext call returned 0. at OpenTK.Platform.X11.X11GLContext..ctor (OpenTK.Graphics.GraphicsMode mode, OpenTK.Platform.IWindowInfo window, OpenTK.Graphics.IGraphicsContext shared, System.Boolean direct, System.Int32 major, System.Int32 minor, OpenTK.Graphics.GraphicsContextFlags flags) [0x001dd] in <a4886e33f9fc416195d24950e7205b94>:0 at OpenTK.Platform.X11.X11Factory.CreateGLContext (OpenTK.Graphics.GraphicsMode mode, OpenTK.Platform.IWindowInfo window, OpenTK.Graphics.IGraphicsContext shareContext, System.Boolean directRendering, System.Int32 major, System.Int32 minor, OpenTK.Graphics.GraphicsContextFlags flags) [0x00000] in <a4886e33f9fc416195d24950e7205b94>:0 at OpenTK.Graphics.GraphicsContext..ctor (OpenTK.Graphics.GraphicsMode mode, OpenTK.Platform.IWindowInfo window, OpenTK.Graphics.IGraphicsContext shareContext, System.Int32 major, System.Int32 minor, OpenTK.Graphics.GraphicsContextFlags flags) [0x000c3] in <a4886e33f9fc416195d24950e7205b94>:0 at OpenTK.Graphics.GraphicsContext..ctor (OpenTK.Graphics.GraphicsMode mode, OpenTK.Platform.IWindowInfo window, System.Int32 major, System.Int32 minor, OpenTK.Graphics.GraphicsContextFlags flags) [0x00008] in <a4886e33f9fc416195d24950e7205b94>:0 at OpenTK.GameWindow..ctor (System.Int32 width, System.Int32 height, OpenTK.Graphics.GraphicsMode mode, System.String title, OpenTK.GameWindowFlags options, OpenTK.DisplayDevice device, System.Int32 major, System.Int32 minor, OpenTK.Graphics.GraphicsContextFlags flags, OpenTK.Graphics.IGraphicsContext sharedContext, System.Boolean isSingleThreaded) [0x00164] in <a4886e33f9fc416195d24950e7205b94>:0 at OpenTK.GameWindow..ctor (System.Int32 width, System.Int32 height, OpenTK.Graphics.GraphicsMode mode, System.String title, OpenTK.GameWindowFlags options, OpenTK.DisplayDevice device, System.Int32 major, System.Int32 minor, OpenTK.Graphics.GraphicsContextFlags flags, OpenTK.Graphics.IGraphicsContext sharedContext) [0x00000] in <a4886e33f9fc416195d24950e7205b94>:0 at OpenTK.GameWindow..ctor (System.Int32 width, System.Int32 height, OpenTK.Graphics.GraphicsMode mode, System.String title, OpenTK.GameWindowFlags options, OpenTK.DisplayDevice device, System.Int32 major, System.Int32 minor, OpenTK.Graphics.GraphicsContextFlags flags) [0x00000] in <a4886e33f9fc416195d24950e7205b94>:0 at Vintagestory.Client.NoObf.GameWindowNative..ctor (OpenTK.Graphics.GraphicsMode mode, OpenTK.GameWindowFlags flags, System.Int32 openGlMajor, System.Int32 openGlMinor) [0x00017] in <6215ae1029cd4696b4c4b2c34106b061>:0 at Vintagestory.Client.ClientProgram.Start (Vintagestory.Client.ClientProgramArgs args, System.String[] rawArgs) [0x0034c] in <9422a14f759b4537aaff44309dc950a2>:0 at Vintagestory.Client.ClientProgram+<>c__DisplayClass14_0.<.ctor>b__0 () [0x00000] in <9422a14f759b4537aaff44309dc950a2>:0 at Vintagestory.ClientNative.CrashReporter.Start (System.Threading.ThreadStart start) [0x00007] in <6215ae1029cd4696b4c4b2c34106b061>:0 Not sure what to do about it It is even worse - after changing it back in the activator to mono Vintagestory.exe I still get the same error in return Any idea how to repair it? EDIT Fortunately restart of PC was enough to help but it was kinda scary Anyway would still like to know why this was the result and what to do to change it. Edited September 11, 2022 by Sinda Link to comment Share on other sites More sharing options...
.ztx Posted July 5 Report Share Posted July 5 mesa_glthread=true made my client randomly freeze and also the window became black every time I changed it's size. I never even loaded into any world, it had always hanged before that. Tested on Void Linux with AMD Ryzen 2600 + Radeon RX6700 + 32gb RAM. Link to comment Share on other sites More sharing options...
Meekology Posted August 1 Report Share Posted August 1 (edited) Interesting. I'm also using Linux I'll have to try these out. So far performance (as in frame rate) has been fine on my side. I do have a strange issue where the system will lag very intensely for 5~ seconds or so (massive lag spikes) every once in awhile like 20 minutes. I thought it was chunk loading maybe, though that doesn't seem to be the case. 32GB DDR4 Ram 5800x3d RTX3090 I'm playing on the high or very high preset IIRC at 4k resolution. GPU usage is usually around 40 - 50%, cpu usage negligible (something around 10% IIRC). I'm not really sure what is causing the hangups. I tried to run the game in gamescope though I can't seem to get it to fit nicely into the nested gamescope window. It's always a vertical slice so that is interesting behavior. I have only tried messing with gamescopes arguments a bit to no avail. I'll have to try a bit harder though maybe? I thought that maybe that would help with the occasional stuttering issue I'm having. Anywho, when I next play here I'll have to try out just to see! Anyone have any ancedotes about proton / GeWine compared to "native" (as native as it can be, being mono that is)? mesa_glthread=true mono Vintagestory.exe Edited August 1 by Meekology Link to comment Share on other sites More sharing options...
sushieater Posted August 1 Report Share Posted August 1 (edited) I've had performance issues with the default Mono settings (a lot of suttering). Running things with: mono-sgen --llvm --gc-params="nursery-size=32m,minor=simple-par" Vintagestory.exe improved stuff a great deal. The .Net7 release resolves those issues. Edited August 1 by sushieater Link to comment Share on other sites More sharing options...
Meekology Posted August 2 Report Share Posted August 2 The Net7 version is exciting. I'm just waiting for it to be on stable 1.19 I'm guessing? Link to comment Share on other sites More sharing options...
Recommended Posts