Repository navigation
steam: fix proton versions with pressure-vessel - #114024
Conversation
Preserve top-level symlinks such as /lib -> /usr/lib. This allows nested containers such as Steam's new runtime to remount /usr if they need to and then run unmodified binaries that reference e.g. /lib/ld-linux-x86-64.so.2 Before, we would mount the fully resolved host directory at /lib and thus the dynamic loader would always be the one from the host filesystem.
|
Have been using this patches for weeks now, thanks a lot @LuigiPiucco <3 |
|
I am hoping to actually test the changes out as well, but this is the Result of 45 packages built:
|
|
This works great for me, tried Mordhau with an AMD GPU on i3 using Proton Experimental in Steam. |
|
Result of 45 packages built:
|
|
This looks good to me, I imagine @jonringer will want a look before merge though |
|
Works also for me. AMD GPU using Proton 5.13-6. Thanks! |
|
this supersedes #102178 |
Atemu
left a comment
There was a problem hiding this comment.
Amazing work! The games I play on Steam all work flawlessly.
SteamVR isn't reacting to the presence sensor or the base stations existence but that also happens when I revert the patches; I'll have to test that after the next reboot.
I also noticed this PR fixes #92795, thank you!
I have some small comments and questions:
| hardware.steam-hardware.enable = true; | ||
|
|
||
| environment.systemPackages = [ pkgs.steam ]; | ||
| environment.systemPackages = [ steam steam.run ]; |
There was a problem hiding this comment.
All the changes to programs.steam are there to pass system graphics drivers down to Steam's expression, which in turn passes them to build-fhsuserenv-bubblewrap, adding them to the ld cache that will be created in the container. This is also the part I alluded to in
find a better way to pass the system's drivers in a way that pressure-vessel will find them, allowing steam to be added and work without activating the module
Plus, steam.run was added as a convenience, since to add that manually the user would have to replicate the logic of the module.
There was a problem hiding this comment.
also, they only slightly diverge, the closure cost is essentially a small wrapping script
| --tmpfs ${glibc}/etc \ | ||
| --symlink /etc/ld.so.conf ${glibc}/etc/ld.so.conf \ | ||
| --symlink /etc/ld.so.cache ${glibc}/etc/ld.so.cache \ | ||
| --ro-bind ${glibc}/etc/rpc ${glibc}/etc/rpc \ | ||
| --remount-ro ${glibc}/etc \ | ||
| --tmpfs ${pkgsi686Linux.glibc}/etc \ | ||
| --symlink /etc/ld.so.conf ${pkgsi686Linux.glibc}/etc/ld.so.conf \ | ||
| --symlink /etc/ld.so.cache ${pkgsi686Linux.glibc}/etc/ld.so.cache \ | ||
| --ro-bind ${pkgsi686Linux.glibc}/etc/rpc ${pkgsi686Linux.glibc}/etc/rpc \ | ||
| --remount-ro ${pkgsi686Linux.glibc}/etc \ |
There was a problem hiding this comment.
This could use some comments explaining why all these dirs is needed (for future reference)
There was a problem hiding this comment.
Sure, I will add them, like so:
# Our glibc will look for the cache in its own path in `/nix/store`.
# As such, we need a cache to exist there, because pressure-vessel
# depends on the existence of an ld cache. However, adding one
# globally proved to be a bad idea (see #100655), the solution we
# settled on being mounting one via bwrap.
# Also, the cache needs to go to both 32 and 64 bit glibcs, for games
# of both architectures to work.
According to @smcv, due to being inside a bwrap container, pressure-vessel games can't rely on udev (see #100655 (comment)), having to do things the hard way and re-implement input logic. Since the devices they test the most with are official console-style controllers, things like flight sticks, VR gear, racing sim gear etc. are more likely to face problems. |
|
Result of 46 packages built: |
I had a similar problem, though less pervasive. I have an ultrawide monitor, and games that weren't previously configured to run on its resolution (mostly the ones I hadn't played yet) would start on regular 1080p, and Steam would lower my desktop resolution to match. After changing the settings in game, though, it went away. Have you tried that? Do the settings reset on relaunching the game or anything weird like that? |
|
It seems to happen on every game start. Changing the resolution manually does not seem to help. |
I actually removed those because I saw
I tried disabling my steam overlay but it didn't change anything sadly.
I tested all the way down to Proton 5.0 previously. I just tested and was able to run Modern Warfare 2 with Proton 4.11 and under actually. Looking at the change log, I suspect this is because proton 5.0 made DXVK the default for Direct3D 9 games (which MW2 probably is seeing as it came out in 2009) and that it used WINED3D before that (the game runs in proton 5.0 with
Doesn't look like it, I just ran both and diff'd the output: |
In that case it's a problem with Vulkan, rather than a problem with the pressure-vessel containers. (Proton 5.0 didn't use those, they're new in 5.13.) |
|
This is a very strange issue, I'm not entirely sure how to tackle it. Doing some research, I didn't find anything pointing to the problem being game-specific, the only remark is that it's a D3D9 game, so maybe disabling newer APIs might change things? Plus, you said you tested other games as well, this probably won't help. We could enable DXVK debug mode with
|
|
The missing ICD and automatic |
|
@LuigiPiucco I updated my input with your nixpkgs and everything is working now, I can start Modern Warfare 2, Among Us, 100% Orange Juice (all games which I tested previously and didn't run because DXVK couldn't find the video adapter). I can only assume that the 32-bit Nvidia ICD files were to blame! |
|
I think it's safe to say that could could open a new PR to add those fixes in. |
After getting SteamVR to work with the Index, it does indeed work; hooray! |
|
Wow, I wasn't expecting that, that's great. I just created the PR. #114884 |
steam: continuation of #114024 with missing edits
|
When will this be available in unstable? |
Should already be there: https://nixpk.gs/pr-tracker.html?pr=114024 |
|
@jasonodoom should already be available https://status.nixos.org/ |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
steam: continuation of NixOS#114024 with missing edits
|
Few issues I've noticed:
|
|
These sound like Steam on Xwayland or WINE issues, not NixOS issues. I would try reproducing them another GNOME distro or X11. In any case, I'm pretty sure they're unrelated to pressure-vessel and NixOS, but please create another issue if you think it's due to NixOS to avoid pinging everyone in this thread. |
|
System tray issue is WINE related behaviour; It has behaved like that as far back as I remember on GNOME @YellowOnion. |
|
Actually, I am using i3 + lxqt (not gnome), and the system tray icon is broken for me too. It just happened after an update without any changes on my part. |
|
Might be related: |
I do not think its related, steam icon is broken for a long time (check #87774). I also use rofi here but with awesomewm, no icon launched by rofi or terminal. Not sure about other launchers like Rockstar one, but like @hpfr said, its better to create a issue and map it from there. |
|
|
||
| export STEAM_RUNTIME=${if nativeOnly then "0" else "/steamrt"} | ||
|
|
||
| export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/intel_icd.x86_64.json:/usr/share/vulkan/icd.d/intel_icd.i686.json:/usr/share/vulkan/icd.d/lvp_icd.x86_64.json:/usr/share/vulkan/icd.d/lvp_icd.i686.json:/usr/share/vulkan/icd.d/nvidia_icd.json:/usr/share/vulkan/icd.d/nvidia_icd32.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json:/usr/share/vulkan/icd.d/radeon_icd.i686.json |
There was a problem hiding this comment.
This boke Dota2 Vulkan mode (native Linux game) for NixOS 21.05, see:
| --tmpfs ${pkgsi686Linux.glibc}/etc \ | ||
| --symlink /etc/ld.so.conf ${pkgsi686Linux.glibc}/etc/ld.so.conf \ | ||
| --symlink /etc/ld.so.cache ${pkgsi686Linux.glibc}/etc/ld.so.cache \ | ||
| --ro-bind ${pkgsi686Linux.glibc}/etc/rpc ${pkgsi686Linux.glibc}/etc/rpc \ | ||
| --remount-ro ${pkgsi686Linux.glibc}/etc \ |
There was a problem hiding this comment.
This broke fhsenv bubblewrap usage on non x86 systems.
❯ nix-build -A platformio --system aarch64-linux
error: i686 Linux package set can only be used with the x86 family.
There was a problem hiding this comment.
This one is easy enough to work around via optionalString but there are further i686 deps in the builder.


Motivation for this change
As detailed in #100655, Proton 5.13 and onward, due to the addition of pressure-vessel, stopped working on NixOS. pressure-vessel implements its own wrapping and distribution logic, and assumes an FHS-compatible environment all across its inner workings. As such, the old way we wrapped Steam was no longer enough. It's still backwards compatible, to allow older Proton to work (maybe some optimization could be done with the knowledge learned here, though). This PR's purpose is to get newer Proton working, hopefully to the same extent it works on other typical FHS distributions.
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)Additional details
A key component of how pressure-vessel works is
ld.so.cache. Since neither NixOS nor our Steam bwrap provided one, it failed in multiple ways to find libraries. A cache was added to the bwrapping expression, along with a change to mergesharefolders of 32 and 64 bit packages, preferring 64 bit for conflicting files. This was to bring things like ICDs for both architectures. Environment variables and a few libraries were added to Steam's bwrap, and so were the system's graphics drivers. To this end, theprograms.steammodule was complemented, to add a version of Steam with appropriate drivers tosystemPackages. As such, it is best to add Steam throughprograms.steam.enable = true, not by making it system-wide yourself.Possible improvements to this PR include trying to find a better way to pass the system's drivers in a way that pressure-vessel will find them, allowing steam to be added and work without activating the module, and checking documentation to see if already points to
programs.steam.Fixes #100655.
Fixes #106571.
Fixes #103547