Re: Linux
Posted: Sat Apr 23, 2022 7:46 pm
ORIGINAL POST 21 APRIL:
I'm having all sorts of issues trying to play Black Mesa with Proton today. I think it's because I screwed up an upgrade of zlib at some point, but now it's just steadfast refusing to run, logging all sorts of unhelpful error messages. So… right now I'm burning a Linux Mint DVD. I figured life's too short for this, especially when I'm going back to work on Monday!
I'll still keep LFS for everyday use, and I'll probably get games working on it again in the future (or it might resolve itself) but having an up-to-date Mint around for gaming will probably help a lot. Hopefully…
EDIT: Well, the first attempt at installation over an old Debian install was a bust, but the second time I made sure to format the partition and then it worked like a charm. Dear God, it's glorious to have a distro that just works out of the box…
UPDATE 23 APRIL:
Well, after a couple of days cooling off (and playing Black Mesa on Mint), I came back and sorted it out. Indeed, the crux of the issue is in zlib, even if I don't fully understand it. Let me start at the beginning, just in case someone else has made the same mistakes I did…
After solving some unrelated issues (apparently to do with keeping Proton games on an encrypted partition), I got to the point where starting Steam from the terminal and trying to run Black Mesa gave some output like this:
Which is highly uninformative, it has to be said! Still, it suggested there was some issue with DXVK, so I tried again with PROTON_USE_WINED3D11=1. This time:
This was a lot more informative – apparently the Mesa video driver was trying to link to /usr/lib/libz.so as an absolute path, which didn't exist inside the Steam Runtime environment. I did some digging and it turned out that I had screwed up my last update of zlib, so I had /lib/libz.so.1 and /usr/lib/libz.so pointing at two different versions.
I rectified the symlinks, which caused a load of programs to start complaining about "no version information" but otherwise didn't really break anything.
I then tried recompiling Mesa, but the libraries it produced still pointed at the absolute path /usr/lib/libz.so – this is the part I still don't fully understand. But I was able to fix the build script manually to sort that out:
Recompiling and reinstalling, it looked like the problem was solved:
But there was zero improvement in the behaviour of Black Mesa!
This is when I gave up and went to Mint.
Today I decided to come back to it, and, being calmer, I realized that I could set this env variable:
Running Steam like this allowed me to press "Play" on Black Mesa, but instead it would pop up an interactive shell and allow me to explore the runtime environment – a lifesaver as far as I'm concerned!
So, from the interactive shell, I examined the libraries linked by the Mesa driver again:
And there it is! "/usr/lib/libz.so => not found". I was scratching my head as to where that had come from, so I found libtree, which does the same thing as ldd but shows it as a tree view to see what libraries are pulling in what others.
The result:
So, it was coming from libLLVM-14.so
That being the case, I went and recompiled LLVM as I had done for Mesa a couple of days ago, and found the same problem: even though I had fixed the symlinks, it was still hard-coding an absolute path. But I was able to fix it with the same trick:
Once I recompiled and reinstalled with this change, Black Mesa worked a treat!
I should note, it even works with DXVK now, confirming that the same issue was behind all the weird errors. 
My system still isn't 100% right, I'll have to go and resolve the whole zlib thing properly, but for now it plays games again!
EDIT: Fixed code tags. Some of the story was hidden inside one of them
I'm having all sorts of issues trying to play Black Mesa with Proton today. I think it's because I screwed up an upgrade of zlib at some point, but now it's just steadfast refusing to run, logging all sorts of unhelpful error messages. So… right now I'm burning a Linux Mint DVD. I figured life's too short for this, especially when I'm going back to work on Monday!
EDIT: Well, the first attempt at installation over an old Debian install was a bust, but the second time I made sure to format the partition and then it worked like a charm. Dear God, it's glorious to have a distro that just works out of the box…
UPDATE 23 APRIL:
Well, after a couple of days cooling off (and playing Black Mesa on Mint), I came back and sorted it out. Indeed, the crux of the issue is in zlib, even if I don't fully understand it. Let me start at the beginning, just in case someone else has made the same mistakes I did…
After solving some unrelated issues (apparently to do with keeping Proton games on an encrypted partition), I got to the point where starting Steam from the terminal and trying to run Black Mesa gave some output like this:
Code: Select all
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
Setting breakpad minidump AppID = 362890
Steam_SetMinidumpSteamID: Caching Steam ID: 76561198025750625 [API loaded no]
terminate called after throwing an instance of 'dxvk::DxvkError'
abnormal program termination
Code: Select all
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
libGL error: MESA-LOADER: failed to open radeonsi: /usr/lib/libz.so: cannot open shared object file: No such file or directory (search paths /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri, suffix _dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/libz.so: cannot open shared object file: No such file or directory (search paths /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri, suffix _dri)
libGL error: failed to load driver: swrast
wine: Unhandled page fault on execute access to 00000000 at address 00000000 (thread 0024), starting debugger...
Unhandled exception: page fault on execute access to 0x00000000 in 32-bit code (0x00000000).
*snip*
I then tried recompiling Mesa, but the libraries it produced still pointed at the absolute path /usr/lib/libz.so – this is the part I still don't fully understand. But I was able to fix the build script manually to sort that out:
Code: Select all
sed '/^ *LINK_ARGS/s|/usr/lib/libz.so|-lz|g' -i build.ninja
Code: Select all
$ ldd /usr/lib/dri/radeonsi_dri.so
linux-gate.so.1 (0xf7ed7000)
libglapi.so.0 => /usr/lib/libglapi.so.0 (0xf65fd000)
libdrm.so.2 => /usr/lib/libdrm.so.2 (0xf65e5000)
libLLVM-14.so => /usr/lib/libLLVM-14.so (0xeecc6000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0xeec96000)
libz.so => /usr/lib/libz.so (0xeec7e000)
libdl.so.2 => /lib/libdl.so.2 (0xeec79000)
libsensors.so.5 => /usr/lib/libsensors.so.5 (0xeec67000)
libdrm_radeon.so.1 => /usr/lib/libdrm_radeon.so.1 (0xeec57000)
libdrm_amdgpu.so.1 => /usr/lib/libdrm_amdgpu.so.1 (0xeec4a000)
libelf.so.1 => /usr/lib/libelf.so.1 (0xeec2c000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xeea13000)
libm.so.6 => /lib/libm.so.6 (0xee946000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xee927000)
libpthread.so.0 => /lib/libpthread.so.0 (0xee907000)
libc.so.6 => /lib/libc.so.6 (0xee72b000)
libffi.so.6 => /usr/lib/../lib/libffi.so.6 (0xee723000)
librt.so.1 => /lib/librt.so.1 (0xee719000)
libncursesw.so.6 => /lib/libncursesw.so.6 (0xee6af000)
libxml2.so.2 => /usr/lib/../lib/libxml2.so.2 (0xee525000)
/lib/ld-linux.so.2 (0xf7ed9000)
libz.so.1 => /lib/libz.so.1 (0xee50d000)
libicui18n.so.71 => /usr/lib/../lib/libicui18n.so.71 (0xee1b6000)
libicuuc.so.71 => /usr/lib/../lib/libicuuc.so.71 (0xedfb3000)
libicudata.so.71 => /usr/lib/../lib/libicudata.so.71 (0xec2ae000)
liblzma.so.5 => /lib/liblzma.so.5 (0xec284000)
Today I decided to come back to it, and, being calmer, I realized that I could set this env variable:
Code: Select all
PRESSURE_VESSEL_SHELL=instead
So, from the interactive shell, I examined the libraries linked by the Mesa driver again:
Code: Select all
$ ldd /run/host/usr/lib/dri/radeonsi_dri.so
linux-gate.so.1 (0xf7f4f000)
/tmp/pressure-vessel-libs-C1M3K1/${PLATFORM}/gameoverlayrenderer.so => /tmp/pressure-vessel-libs-C1M3K1/i686/gameoverlayrenderer.so (0xf66aa000)
libglapi.so.0 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libglapi.so.0 (0xf6672000)
libdrm.so.2 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libdrm.so.2 (0xf665a000)
libLLVM-14.so => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libLLVM-14.so (0xeed3b000)
libexpat.so.1 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libexpat.so.1 (0xeed0b000)
libz.so => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libz.so (0xeecf3000)
libdl.so.2 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libdl.so.2 (0xeecee000)
libsensors.so.5 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libsensors.so.5 (0xeecdc000)
libdrm_radeon.so.1 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libdrm_radeon.so.1 (0xeeccc000)
libdrm_amdgpu.so.1 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libdrm_amdgpu.so.1 (0xeecbd000)
libelf.so.1 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libelf.so.1 (0xeec9f000)
libstdc++.so.6 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libstdc++.so.6 (0xeea86000)
libm.so.6 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libm.so.6 (0xee9bb000)
libgcc_s.so.1 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libgcc_s.so.1 (0xee99c000)
libpthread.so.0 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libpthread.so.0 (0xee97c000)
libc.so.6 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libc.so.6 (0xee7a0000)
librt.so.1 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/librt.so.1 (0xee796000)
/lib/ld-linux.so.2 (0xf7f51000)
libGL.so.1 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libGL.so.1 (0xee724000)
libffi.so.6 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libffi.so.6 (0xee71a000)
/usr/lib/libz.so => not found
libncursesw.so.6 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libncursesw.so.6 (0xee6b0000)
libxml2.so.2 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libxml2.so.2 (0xee526000)
libGLdispatch.so.0 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libGLdispatch.so.0 (0xee4a9000)
libGLX.so.0 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libGLX.so.0 (0xee467000)
libicui18n.so.71 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libicui18n.so.71 (0xee110000)
libicuuc.so.71 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libicuuc.so.71 (0xedf0f000)
libicudata.so.71 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libicudata.so.71 (0xec20a000)
liblzma.so.5 => /lib/i386-linux-gnu/liblzma.so.5 (0xec1dc000)
libX11.so.6 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libX11.so.6 (0xec08b000)
libxcb.so.1 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libxcb.so.1 (0xec05f000)
libXau.so.6 => /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libXau.so.6 (0xec05c000)
The result:
Code: Select all
$ ~/libtree_x86_64 /run/host/usr/lib/dri/radeonsi_dri.so
libgallium_dri.so
├── libglapi.so.0 [ld.so.conf]
│ └── libpthread.so.0 [ld.so.conf]
├── libelf.so.1 [ld.so.conf]
│ └── /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libz.so.1 [ld.so.conf]
├── libdrm_amdgpu.so.1 [ld.so.conf]
│ └── libdrm.so.2 [ld.so.conf]
├── libdrm_radeon.so.1 [ld.so.conf]
│ └── libdrm.so.2 [ld.so.conf]
├── libsensors.so.5 [ld.so.conf]
├── libpthread.so.0 [ld.so.conf]
├── /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libz.so [ld.so.conf]
├── libexpat.so.1 [ld.so.conf]
├── libLLVM-14.so [ld.so.conf]
│ ├── /usr/lib/libz.so is not absolute
│ ├── libffi.so.6 [ld.so.conf]
│ ├── libncursesw.so.6 [ld.so.conf]
│ ├── libpthread.so.0 [ld.so.conf]
│ ├── libxml2.so.2 [ld.so.conf]
│ │ ├── libicui18n.so.71 [ld.so.conf]
│ │ │ ├── libicuuc.so.71 [ld.so.conf]
│ │ │ │ ├── libicudata.so.71 [ld.so.conf]
│ │ │ │ └── libpthread.so.0 [ld.so.conf]
│ │ │ ├── libpthread.so.0 [ld.so.conf]
│ │ │ └── libicudata.so.71 [ld.so.conf]
│ │ ├── /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libz.so [ld.so.conf]
│ │ ├── libicudata.so.71 [ld.so.conf]
│ │ ├── libicuuc.so.71 [ld.so.conf]
│ │ └── liblzma.so.5 [ld.so.conf]
│ │ └── libpthread.so.0 [ld.so.conf]
│ └── librt.so.1 [ld.so.conf]
│ └── libpthread.so.0 [ld.so.conf]
└── libdrm.so.2 [ld.so.conf]
That being the case, I went and recompiled LLVM as I had done for Mesa a couple of days ago, and found the same problem: even though I had fixed the symlinks, it was still hard-coding an absolute path. But I was able to fix it with the same trick:
Code: Select all
sed '/^ *LINK_LIBRARIES/s|/usr/lib/libz.so|-lz|g' -i build.ninja
My system still isn't 100% right, I'll have to go and resolve the whole zlib thing properly, but for now it plays games again!
EDIT: Fixed code tags. Some of the story was hidden inside one of them