You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mangohud OpenGL doesn't work out of the box with runtime ( native and Proton) #435
What compatibility tool are you using?: Steam Linux Runtime and Proton
If you are using Steam Linux Runtime for native Linux games: VERSIONS.txt
If you are using Steam Linux Runtime, or Proton 5.13 or newer: VERSIONS.txt
Please describe your issue in as much detail as possible:
OpenGL games ( native and Proton) doesn't work out of the box with runtime. Normally they should work with just mangohud %command% or mangohud --dlsym %command%
-Floating Point ( 32 bit native GL, SLR forced)
-Mount & Blade: Warband ( 64 bit native GL, SLR forced )
-Wolfenstein New Order ( 64 bit Windows only GL , proton )
-Wolfenstein Old Blood ( 64 bit Windows only GL , proton )
What does mangohud set LD_PRELOAD and LD_LIBRARY_PATH to on your system?
The easiest way to answer that question might be to run mangohud steam and grab the Help -> System Information.
On my Debian system, the answers are:
LD_PRELOAD="${LD_PRELOAD}:libMangoHud.so" # or libMangoHud_dlsym.so:libMangoHud.so
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/\$LIB/mangohud/"
and one possible trigger for this problem might be the special $LIB token in the LD_LIBRARY_PATH. We can't know what that token will expand to - glibc has no API to tell us. Recent versions of the steam-runtime-tools library can try to guess from a list of likely possibilities, but that isn't currently wired up to the LD_PRELOAD and LD_LIBRARY_PATH handling.
Please could you get a log without the workaround when you have a chance?
In general, what we need is a log from the broken/bad situation. If you're able to get logs with a workaround as well, that's sometimes a useful comparison, but a log in the broken situation is usually more important.
I also have this issue. Tested with Half-Life 2 with Steam Linux Runtime forced.
Replacing \$LIB with lib32 makes it work for Half-Life 2.
Here's MangoHud script on my system /usr/bin/mangohud:
#!/bin/sh
if [ "$#" -eq 0 ]; then
programname=`basename "$0"`
echo "ERROR: No program supplied"
echo
echo "Usage: $programname <program>"
exit 1
fi
if [ "$1" = "--dlsym" ]; then
MANGOHUD_DLSYM=1
shift
fi
MANGOHUD_LIB_NAME="/usr/lib/mangohud/\$LIB/libMangoHud.so"
if [ "$MANGOHUD_DLSYM" = "1" ]; then
MANGOHUD_LIB_NAME="/usr/lib/mangohud/\$LIB/libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
fi
# Preload using the plain filenames of the libs, the dynamic linker will
# figure out whether the 32 or 64 bit version should be used, and will search
# for it in the correct directory
LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:"
exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" LD_PRELOAD="${LD_PRELOAD}" "$@"
Yeah, I think this is because MangoHud is using the special token $LIB and we don't handle that yet. I'll look into it.
Workaround: have two modified versions of the script, mangohud32 and mangohud64, in which you replace $LIB with the correct expansion, and then choose which script to use for each game. The expansion varies between distributions:
Distribution
32-bit
64-bit
Arch, Manjaro etc.
lib32
lib
Red Hat, Fedora, openSUSE etc.
lib
lib64
Debian, Ubuntu etc.
lib/i386-linux-gnu
lib/x86_64-linux-gnu
Replacing $LIB with lib32 makes it work for Half-Life 2
FYI, that'll make it work for 32-bit games like HL2 and TF2, but not for 64-bit games like Artifact and (I think) DOTA 2.
@Leopard1907: is your mangohud script the same as @lukashoracek has? If different, it would be useful to see its content.
Both @lukashoracek and @Leopard1907: Have you modified the script, or is this as supplied by your OS's package manager, or did you install MangoHud from upstream source code, or something different? If you installed from upstream source code, did you use build.sh or something else?
(I'm trying to cover all the reasonable configurations while testing a solution for this, and I'd prefer to be able to say "the way Debian installs MangoHud" or "the way Arch installs MangoHud" or "the way upstream installs MangoHud", rather than "the way @lukashoracek reports that it works"!)
#!/bin/sh
if [ "$#" -eq 0 ]; then
programname=`basename "$0"`
echo "ERROR: No program supplied"
echo
echo "Usage: $programname <program>"
exit 1
fi
if [ "$1" = "--dlsym" ]; then
MANGOHUD_DLSYM=1
shift
fi
MANGOHUD_LIB_NAME="/usr/lib/mangohud/\$LIB/libMangoHud.so"
if [ "$MANGOHUD_DLSYM" = "1" ]; then
MANGOHUD_LIB_NAME="/usr/lib/mangohud/\$LIB/libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
fi
# Preload using the plain filenames of the libs, the dynamic linker will
# figure out whether the 32 or 64 bit version should be used, and will search
# for it in the correct directory
LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:"
exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" LD_PRELOAD="${LD_PRELOAD}" "$@"
I didn't modify the script, using Mangohud release as what it is.
Thanks. It's looking as though solving this for the way MangoHud works when installed from upstream (absolute paths in LD_PRELOAD) is going to be more straightforward than solving this for the way Debian installs it (basename in LD_PRELOAD, absolute path in LD_LIBRARY_PATH), but I'm aiming to do both.
This will hopefully be solved in the next client_beta version of Steam Linux Runtime - soldier (SteamLinuxRuntime_soldier/VERSIONS.txt should say depot 0.20210809.21 or later).
Note that if you use Steam Linux Runtime, this particular beta will also require updating Steam Linux Runtime to the client_beta branch (if you don't update both tools, a few native Linux games like Shadowrun Returns won't work).
Thanks for the fix. I tried some of the games i noted above with those new runtime versions and cannot reproduce the problem.
Floating Point
Mount & Blade: Warband
Wolfenstein New Order
MangoHud OGL works as expected with mangohud %command and mangohud --dlsym %command%
Content of SteamLinuxRuntime_soldier/VERSIONS.txt:
#Name Version Runtime Runtime_Version Comment
depot 0.20210809.22 # Overall version number
pressure-vessel 0.20210809.1
scripts v0.20210806.0-0-g21006f2 # Entry point scripts, etc.
soldier 0.20210806.0 soldier 0.20210806.0 # soldier_platform_0.20210806.0/
Content of SteamLinuxRuntime/VERSIONS.txt:
#Name Version Runtime Runtime_Version Comment
depot 0.20210809.34 # Overall version number
LD_LIBRARY_PATH - scout - # see ~/.steam/root/ubuntu12_32/steam-runtime/version.txt
scripts v0.20210806.0-0-g21006f2 # Entry point scripts, etc.
Great, let's leave this issue open for now, but we can close it when soldier depot 0.20210809.22 goes to the default branch.
This has now happened (with a bit more delay than usual, because this change triggered a regression for users of libstrangle, which I fixed in libstrangle). @kisak-valve, I think we can close this now.
Activity
smcv commentedon Jul 23, 2021
What does
mangohudsetLD_PRELOADandLD_LIBRARY_PATHto on your system?The easiest way to answer that question might be to run
mangohud steamand grab theHelp -> System Information.On my Debian system, the answers are:
and one possible trigger for this problem might be the special
$LIBtoken in theLD_LIBRARY_PATH. We can't know what that token will expand to - glibc has no API to tell us. Recent versions of the steam-runtime-tools library can try to guess from a list of likely possibilities, but that isn't currently wired up to theLD_PRELOADandLD_LIBRARY_PATHhandling.Are these with or without your workaround?
Leopard1907 commentedon Jul 23, 2021
Those logs were taken with workaround in place.
smcv commentedon Jul 23, 2021
Please could you get a log without the workaround when you have a chance?
In general, what we need is a log from the broken/bad situation. If you're able to get logs with a workaround as well, that's sometimes a useful comparison, but a log in the broken situation is usually more important.
Leopard1907 commentedon Jul 25, 2021
@smcv Fresh logs, without workaround in place.
mangohud %commandslr-app48700-t20210725T123955.log
slr-app302380-t20210725T123818.log
Leopard1907 commentedon Jul 25, 2021
Without workaround in place.
mangohud --dlsym %command%slr-app48700-t20210725T124801.log
slr-app302380-t20210725T124737.log
Leopard1907 commentedon Jul 25, 2021
System info report tool output from
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only mangohud steam:https://gist.github.com/Leopard1907/e874de378f642855ddb9058ac64ac3cd
lukashoracek commentedon Jul 25, 2021
I also have this issue. Tested with Half-Life 2 with Steam Linux Runtime forced.
Replacing
\$LIBwithlib32makes it work for Half-Life 2.Here's MangoHud script on my system
/usr/bin/mangohud:smcv commentedon Jul 26, 2021
Yeah, I think this is because MangoHud is using the special token
$LIBand we don't handle that yet. I'll look into it.Workaround: have two modified versions of the script,
mangohud32andmangohud64, in which you replace$LIBwith the correct expansion, and then choose which script to use for each game. The expansion varies between distributions:lib32libliblib64lib/i386-linux-gnulib/x86_64-linux-gnuFYI, that'll make it work for 32-bit games like HL2 and TF2, but not for 64-bit games like Artifact and (I think) DOTA 2.
smcv commentedon Aug 3, 2021
@lukashoracek: What OS are you using?
@Leopard1907: is your
mangohudscript the same as @lukashoracek has? If different, it would be useful to see its content.Both @lukashoracek and @Leopard1907: Have you modified the script, or is this as supplied by your OS's package manager, or did you install MangoHud from upstream source code, or something different? If you installed from upstream source code, did you use
build.shor something else?(I'm trying to cover all the reasonable configurations while testing a solution for this, and I'd prefer to be able to say "the way Debian installs MangoHud" or "the way Arch installs MangoHud" or "the way upstream installs MangoHud", rather than "the way @lukashoracek reports that it works"!)
Leopard1907 commentedon Aug 4, 2021
@smcv Content of
usr\bin\mangohud:I didn't modify the script, using Mangohud release as what it is.
https://github.com/flightlessmango/MangoHud#github-releases
./mangohud-setup.sh installlukashoracek commentedon Aug 4, 2021
@smcv I am using Arch Linux and I installed MangoHud by cloning git repository and running
./build.sh install.smcv commentedon Aug 4, 2021
Thanks. It's looking as though solving this for the way MangoHud works when installed from upstream (absolute paths in
LD_PRELOAD) is going to be more straightforward than solving this for the way Debian installs it (basename inLD_PRELOAD, absolute path inLD_LIBRARY_PATH), but I'm aiming to do both.smcv commentedon Aug 9, 2021
This will hopefully be solved in the next
client_betaversion of Steam Linux Runtime - soldier (SteamLinuxRuntime_soldier/VERSIONS.txtshould saydepot 0.20210809.21or later).Note that if you use Steam Linux Runtime, this particular beta will also require updating Steam Linux Runtime to the
client_betabranch (if you don't update both tools, a few native Linux games like Shadowrun Returns won't work).Leopard1907 commentedon Aug 9, 2021
Thanks for the fix. I tried some of the games i noted above with those new runtime versions and cannot reproduce the problem.
MangoHud OGL works as expected with
mangohud %commandandmangohud --dlsym %command%Content of
SteamLinuxRuntime_soldier/VERSIONS.txt:Content of
SteamLinuxRuntime/VERSIONS.txt:lukashoracek commentedon Aug 10, 2021
MangoHud in Half-Life 2 works now, thanks!
smcv commentedon Aug 10, 2021
Great, let's leave this issue open for now, but we can close it when soldier depot 0.20210809.22 goes to the default branch.
smcv commentedon Sep 3, 2021
This has now happened (with a bit more delay than usual, because this change triggered a regression for users of
libstrangle, which I fixed inlibstrangle). @kisak-valve, I think we can close this now.