solsticegamestudios / GModCEFCodecFix

🛠 Automatic Patching/Updating of GMod CEF. Also fixes macOS/Linux launch issues. And missing main menu issues.
GNU General Public License v3.0
446 stars 21 forks source link

Support Linux Steam Proton #34

Closed EntityinArray closed 1 year ago

EntityinArray commented 2 years ago

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: contact@solsticegamestudios.com

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: contact@solsticegamestudios.com

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?

WinterPhoenix commented 2 years ago

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.

UltraBlackLinux commented 2 years ago

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.

synesthesium commented 2 years ago

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).

EntityinArray commented 1 year ago

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)
snowkat commented 1 year ago

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

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

WinterPhoenix commented 1 year ago

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

snowkat commented 1 year ago

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.

WinterPhoenix commented 1 year ago

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 commented 1 year ago

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

onlyreportingissues commented 1 year ago

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).

AkikoKumagara commented 1 year ago

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.

onlyreportingissues commented 1 year ago

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.

WinterPhoenix commented 1 year ago

Try again with the latest release

onlyreportingissues commented 1 year ago

Try again with the latest release

Works now, thanks.