"Call of Duty" franchise titles in Proton fail to load libMangoHud.so citing "undefined symbol: vkNegotiateLoaderLayerInterfaceVersion (fatal)"
I have MangoHud set up as an environment variable in /etc/environment, using MANGOHUD=1, and with certain games running in Valve's Proton compatibility, it doesn't show up. I'm specifically having issues with Call of Duty: Black Ops III (311210). The game runs fine and other environment variables seem to apply, namely DRI_PRIME, on the same line.
Continuing from this, and copying from ValveSoftware/steam-runtime#530:
Your system information
- Steam Runtime Version: 0.20220804.66
- Distribution (e.g. Ubuntu 18.04): Ubuntu 22.04 LTS
- Link to your full system information (Help -> System Information) in a Gist: https://gist.github.com/SteveHeist/ac5a23f05f7f0413bc5445e5c943683f
- Have you checked for system updates?: [Yes/No] Yes
- What compatibility tool are you using?: [None / Steam Linux Runtime / Proton 5.13+ / older Proton] Proton 5.13+ (Experimental as of Sep 14 2022)
- If you are using Steam Linux Runtime for native Linux games: What versions are listed in
SteamLinuxRuntime/VERSIONS.txt? - If you are using Steam Linux Runtime, or Proton 5.13 or newer: What versions are listed in
SteamLinuxRuntime_soldier/VERSIONS.txt? (Not sure what of this you would want, so have a Gist https://gist.github.com/SteveHeist/d4ecaf7c945589c10e3b8148bcdbfeae#file-versions-txt)
Please describe your issue in as much detail as possible:
Running Call of Duty: Modern Warfare Remastered - Multiplayer (393100) should have provided MangoHud in the top corner compliant with the mangohud %command% call. Instead, nothing shows in-game. On a hunch I reran the game with PROTON_LOG=1 LD_DEBUG=libs and got a fatal error: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/vulkan_imp_layer/6/libMangoHud.so: error: symbol lookup error: undefined symbol: vkNegotiateLoaderLayerInterfaceVersion (fatal)
slr-app393100-t20220914T214411.log - slr log ran with all settings as predescribed above: PROTON_LOG=1 LD_DEBUG=libs gamemoderun mangohud %command%
steam-393100.log second log generated with PROTON_LOG=1 LD_DEBUG=libs while the slr log was also running.
Steps for reproducing this issue:
- configure MangoHud. I only have a global ~/.config/MangoHud/MangoHud.conf - nothing specific to any games
- attempt to add MangoHud functionality to 393100.
- Launch 393100 using the commands predescribed.
- Note, somewhere around line 30000 (the second proton log has it at line 28924, for example) the error.
I went looking around, and found some information that might mean this is an issue with MangoHud not implementing a feature, rather than an issue with the steam-runtime. Namely, when looking at Vulkan-Loader/LoaderLayerInterface.md, the vkNegotiateLoaderLayerInterfaceVersion is said to be called by a function contained in include/vulkan/vk_layer.h. Now, I could be wrong - I am far from a developer on the caliber of anyone who has committed to this repository - but from digging around a git pull I just did using the instructions provided in MangoHud's own README... include/vulkan/vk_layer.h does not exist as a file in MangoHud.
OK. SO.
I went and found an instance of "vk_layer.h" elsewhere in MangoHud's own file tree - namely subprojects/Vulkan-Headers-1.2.158/include/vulkan, copied it into include/vulkan, changed one line (line 29, #include "vulkan.h" to #include "vulkan/vulkan.h")and now it compiles and works. This is almost certainly somehow the "wrong way" to go about this - I am just a lowly end-user with my hands all up in your source code - but it works.
This is almost certainly somehow the "wrong way" to go about this
When compiling MangoHud on a particular operating system (like Ubuntu in your case), the expected situation is that the compiler finds vulkan/vk_layer.h in a system-wide location. On Ubuntu, it's the libvulkan-dev package. What version of that package do you have installed?