GModCEFCodecFix icon indicating copy to clipboard operation
GModCEFCodecFix copied to clipboard

[Linux] Awful native performance compared to Windows/Proton

Open VickyFrenzy opened this issue 3 months ago • 5 comments

Here are some fps comparison with a simple CSS opacity animation

Constant DOM updates native no patch

game crash on startup as we know

Constant DOM updates native with patch

Image

Constant DOM updates Proton no patch

Image

Constant DOM updates Proton with patch

Image
Image

VickyFrenzy avatar Sep 24 '25 16:09 VickyFrenzy

For starters, "native" GMod on Linux uses ToGL, which is an ancient DirectX to OpenGL translation layer. Depending on your specific combination of hardware, drivers, etc, it may be better performance with Proton, which uses DXVK (DirectX to Vulkan).

Running GMod on actual Windows will always be more performant due to having to use some sort of translation layer on Linux.

Another thing to consider is if your machine has multiple GPUs, for example if you have a combination of integrated graphics and discrete graphics, like on "Nvidia Optimus/Prime" laptops. See hl2.sh post-patching for environment variables you can use to address that, and see #188 for some more background.

WinterPhoenix avatar Sep 24 '25 21:09 WinterPhoenix

For starters, "native" GMod on Linux uses ToGL, which is an ancient DirectX to OpenGL translation layer. Depending on your specific combination of hardware, drivers, etc, it may be better performance with Proton, which uses DXVK (DirectX to Vulkan).

With CEF in active use the performance is indeed way better with Proton as seen in the screenshots. I did not benchmark without CEF but yeah it is entirely possible gmod would run better overall through Proton because of ToGL.

Running GMod on actual Windows will always be more performant due to having to use some sort of translation layer on Linux.

Yeah but with my CPU, I don't think the translation layer would make any significant impact except maybe for loading times.

Another thing to consider is if your machine has multiple GPUs, for example if you have a combination of integrated graphics and discrete graphics, like on "Nvidia Optimus/Prime" laptops. See hl2.sh post-patching for environment variables you can use to address that, and see #188 for some more background.

Well I did look at that issue before and checked a bunch of things: my PC is not a laptop and the dedicated GPU is ID 0. I also could not find any usage of the integrated GPU (ID 1) on System Monitor. So unless I missed or misread something this shouldn't affect me.

VickyFrenzy avatar Sep 24 '25 21:09 VickyFrenzy

Something else to consider is your display compositor may be using the integrated graphics while GMod is using dedicated, so it has to cross a "bridge" along the way

WinterPhoenix avatar Sep 26 '25 03:09 WinterPhoenix

Why would it only happen when CEF is in active use tho? Frame rate is completely fine when nothing is going on in the CEF. This doesn't make sense.

Literally nothing else I'm doing is suffering from performance issues, only gmod CEF when sustaining active DOM changes is having this massive drop. When I look at the system monitor I can't find any process that actually use the integrated GPU.

Even if somehow the integrated GPU is being used by anything I sincerely doubt a "bridge" between the dGPU and iGPU through the PCIe 5.0 16x link would be this painful...

I historically did way worse on my laptop where an external dGPU (so it would be ID 1 btw) was used through Thunderbolt with PCIe 3.0 x4 which is shit-tier bandwidth and even then performance was not abysmal like demonstrated here when bridging the two...

Also to be perfectly clear, I do expect a drop in frame rate when DOM updates are happening since that also happens on Windows/Proton, probably because GPU acceleration is broken in the first place. But on Linux the performance drops to unusable levels, maybe it's ToGL idk but I can't find anything wrong with my PC setup (specially when gmod's CEF is the only thing to ever drop that much).

VickyFrenzy avatar Sep 26 '25 11:09 VickyFrenzy

Hey to be 100% sure I disabled the iGPU in the firmware and it yields the same results:

Image

Still with constant DOM updates.


Image

VickyFrenzy avatar Oct 09 '25 14:10 VickyFrenzy