GModCEFCodecFix icon indicating copy to clipboard operation
GModCEFCodecFix copied to clipboard

Support Linux Steam Proton

Open EntityinArray opened this issue 2 years ago • 3 comments

Hello, thank you for working on this amazing patch! I have a Windows version of Gmod installed, that i play through Proton. I apply the patch, but it throws an error that it cannot find hl2.sh

GMod CEF Codec Fix
Created by: Solstice Game Studios
How To Guide:
        https://www.solsticegamestudios.com/forums/threads/60/
Contact Us:
        Discord: https://www.solsticegamestudios.com/chat.html
        Email: [email protected]

You are running the latest version of CEFCodecFix [Local: 20220528 / Remote: 20220528]!

Steam Path:
/home/entityinarray/.local/share/Steam

Steam Libraries:
['/home/entityinarray/.local/share/Steam', '/mnt/Windows/SteamLibrary']

Got Most Recent Steam User: unforseen consequencer (76561198080940659 / [U:1:120674931])

Found Garry's Mod:
/mnt/Windows/SteamLibrary/steamapps/common/GarrysMod

Found Garry's Mod Manifest:
/mnt/Windows/SteamLibrary/steamapps/appmanifest_4000.acf

Garry's Mod Branch:
x86-64

Getting Steam AppInfo for GMod...
        Platform: linux
        /mnt/Windows/SteamLibrary/steamapps/common/GarrysMod/hl2.sh
                [Errno 2] No such file or directory
Error: Could not detect GMod EXE Launch Options!

If you need help, follow the Guide first:
- https://www.solsticegamestudios.com/forums/threads/60/

If that doesn't work, contact us:
- Discord: https://www.solsticegamestudios.com/chat.html
- Email: [email protected]

Press Enter to continue...

Basically, when program sees that the platform is Linux, it makes a wrong assumption that Gmod install is also for Linux, which is not always the case. Is there a way to patch Windows version of Gmod on Linux?

EntityinArray avatar Jul 23 '22 19:07 EntityinArray

We don’t currently support Proton, but this issue has come up enough that we’re probably going to have to look into it.

For now we recommend just using the Native Linux build for GMod.

WinterPhoenix avatar Jul 24 '22 00:07 WinterPhoenix

I would also need this pretty badly. Apparently the linux version of gmod is a total buggy mess including problems with case sensitivity like in other games that got ported from windows to linux.

UltraBlackLinux avatar Aug 03 '22 10:08 UltraBlackLinux

As a temporary workaround, using some symlinks and intuition you can get the Windows version of the CEF Codec Fix to run under Proton by running the following commands (not verbatim, you may have to edit some things to fit your setup if it's out of the ordinary, especially the Proton Version Here and path to codecfix, replace those with what you've got): cd ~/.steam/steam/steamapps/compatdata/4000/pfx ln -s $HOME/.steam/steam/config/loginusers.vdf "drive_c/Program Files (x86)/Steam/config/loginusers.vdf" mkdir -p "drive_c/Program Files (x86)/Steam/appcache/" ln -s $HOME/.steam/steam/appcache/appinfo.vdf "drive_c/Program Files (x86)/Steam/appcache/appinfo.vdf" ln -s $HOME/.steam/steam/userdata "drive_c/Program Files (x86)/Steam/userdata" STEAM_COMPAT_CLIENT_INSTALL_PATH="$HOME/.steam" STEAM_COMPAT_DATA_PATH="$HOME/.steam/steam/steamapps/compatdata/4000" WINEPREFIX=$PWD "$HOME/.steam/root/steamapps/common/Proton Version Here/proton" run /path/to/codecfix/here/GModCEFCodecFix-Windows.exe

However, currently on Proton Experimental with KDE Neon 20.04 using launch options mesa_glthread=true RADV_PERFTEST=aco PROTON_USE_D9VK=1 gamemoderun %command% -novid -dxlevel 90 -high -console -threads 12 -nod3d9ex -nojoy -r_emulate_gl -heapsize "4194304" the game crashes during startup due to Chromium not being able to start it's GPU process (for whatever reason).

synesthesium avatar Sep 03 '22 10:09 synesthesium

As a temporary workaround, using some symlinks and intuition you can get the Windows version of the CEF Codec Fix to run under Proton by running the following commands (not verbatim, you may have to edit some things to fit your setup if it's out of the ordinary, especially the Proton Version Here and path to codecfix, replace those with what you've got): cd ~/.steam/steam/steamapps/compatdata/4000/pfx ln -s $HOME/.steam/steam/config/loginusers.vdf "drive_c/Program Files (x86)/Steam/config/loginusers.vdf" mkdir -p "drive_c/Program Files (x86)/Steam/appcache/" ln -s $HOME/.steam/steam/appcache/appinfo.vdf "drive_c/Program Files (x86)/Steam/appcache/appinfo.vdf" ln -s $HOME/.steam/steam/userdata "drive_c/Program Files (x86)/Steam/userdata" STEAM_COMPAT_CLIENT_INSTALL_PATH="$HOME/.steam" STEAM_COMPAT_DATA_PATH="$HOME/.steam/steam/steamapps/compatdata/4000" WINEPREFIX=$PWD "$HOME/.steam/root/steamapps/common/Proton Version Here/proton" run /path/to/codecfix/here/GModCEFCodecFix-Windows.exe

However, currently on Proton Experimental with KDE Neon 20.04 using launch options mesa_glthread=true RADV_PERFTEST=aco PROTON_USE_D9VK=1 gamemoderun %command% -novid -dxlevel 90 -high -console -threads 12 -nod3d9ex -nojoy -r_emulate_gl -heapsize "4194304" the game crashes during startup due to Chromium not being able to start it's GPU process (for whatever reason).

Crashes for me too on Fedora 37 Workstation in the same way, I coudn't figure it out, what a bummer.

[1217/160007.600:ERROR:sandbox_policy_base.cc(158)] Failed to add sandbox rule. error = 2, subsystem = 0
, semantics = 0, pattern = 'Z:\home\entityinarray\.var\app\com.valvesoftware.Steam\.local\share\Steam\st
eamapps\common\GarrysMod/chromium.log'
[1217/160007.600:ERROR:gpu_process_host.cc(984)] GPU process launch failed: error_code=2
[1217/160007.600:WARNING:gpu_process_host.cc(1337)] The GPU process has crashed 4 time(s)

EntityinArray avatar Dec 17 '22 13:12 EntityinArray

I was able to get a build working with the following changes:

  • Running cmake with -DUSE_SANDBOX=off resolves the gpu_process_host.cc errors in a brute force sort of way, but at least doesn't require kernel.unprivileged_userns_clone.
  • msvproc.dll is missing on Proton/Wine's DXVA2 impl. I made a PR in the other repository (solsticegamestudios/gmod-html#2) to disable the DXVA decoder and use the D3D11 one instead.

I'm still testing it out, but so far it's pretty stable on my system (SteamOS + Proton Experimental).

snowkat avatar Jul 21 '23 04:07 snowkat

Disabling the sandbox is non-ideal. Does it work with the sandbox enabled with kernel.unprivileged_userns_clone + your DXVA fix?

WinterPhoenix avatar Jul 21 '23 06:07 WinterPhoenix

tl;dr: Setting launch options to PROTON_SET_GAME_DRIVE=1 %command% in Steam allows CEF to work with the sandbox enabled.

Unfortunately SteamOS 3 doesn't use the patch that provides kernel.unprivileged_userns_clone, so I'm not able to easily test changing it. However, after digging into the CEF/Chromium side of things, I believe my initial guess of what failed was incorrect.

After creating a build with debug logging enabled, I get the following in my bin/win64/debug.log:

[0722/233451.998:ERROR:filesystem_policy.cc(96)] Check failed: false.
[0722/233451.998:ERROR:sandbox_policy_base.cc(215)] Check failed: false.
[0722/233451.998:ERROR:sandbox_policy_base.cc(192)] Failed to add sandbox rule. error = 2, subsystem = 0, semantics = 0, pattern = 'Z:\home\deck\.local\share\Steam\steamapps\common\GarrysMod\chromium.log'

The first check corresponds to this code in Chromium, and the other lines cascade from that point. Since /home is a separate mount point on my Steam Deck, wine treats it as an NT reparse point, meaning Chromium doesn't consider any paths under Z:\home as possible to sandbox.

The env var PROTON_SET_GAME_DRIVE=1 tells Proton to create an S: drive mapped to ~/.local/share/Steam/steamapps, bypassing the mount point.

snowkat avatar Jul 23 '23 22:07 snowkat

Okay, the script supports patching GMod in Proton as of https://github.com/solsticegamestudios/GModCEFCodecFix/commit/b9d121fcfd61de97503028ce132142f1bdb99b46

You'll have to set the launch option manually, but the tool should work now, problems with GMod/Proton/your OS notwithstanding.

It seems to be mostly functional on Steam Deck, except for missing emojis in CEF and some weird font rendering issues, but GMod outright crashes no matter what using Proton on Ubuntu 20.04. So YMMV

WinterPhoenix avatar Jul 28 '23 02:07 WinterPhoenix

Closing since this technically works now. Please open separate issues for issues with Proton on specific distros

WinterPhoenix avatar Jul 28 '23 02:07 WinterPhoenix

Closing since this technically works now. Please open separate issues for issues with Proton on specific distros

The installer doesn't work with Proton GE (same issue as above). Had to switch to Proton Experimental for it to start working. Proton GE is pretty popular though that's why I thought it might be worth mentioning it here. (You can easily install it using ProtonUp-Qt).

onlyreportingissues avatar Jul 30 '23 17:07 onlyreportingissues

Closing since this technically works now. Please open separate issues for issues with Proton on specific distros

The installer doesn't work with Proton GE (same issue as above). Had to switch to Proton Experimental for it to start working. Proton GE is pretty popular though that's why I thought it might be worth mentioning it here. (You can easily install it using ProtonUp-Qt).

When did you experience this? There was a fix employed for this late last night but I didn't test it yet.

AkikoKumagara avatar Jul 30 '23 18:07 AkikoKumagara

Closing since this technically works now. Please open separate issues for issues with Proton on specific distros

The installer doesn't work with Proton GE (same issue as above). Had to switch to Proton Experimental for it to start working. Proton GE is pretty popular though that's why I thought it might be worth mentioning it here. (You can easily install it using ProtonUp-Qt).

When did you experience this? There was a fix employed for this late last night but I didn't test it yet.

Yesterday.

onlyreportingissues avatar Jul 31 '23 08:07 onlyreportingissues

Try again with the latest release

WinterPhoenix avatar Aug 01 '23 00:08 WinterPhoenix

Try again with the latest release

Works now, thanks.

onlyreportingissues avatar Aug 01 '23 19:08 onlyreportingissues