Repository navigation
Conversation
Fixes Proton Wayland gaming on Steam
| yield DevBind(x_resolved.parents[1]) | ||
|
|
||
| yield DevBind("/dev/dri") | ||
| yield DevBind("/sys/class/drm") |
There was a problem hiding this comment.
Would a ReadOnlyBind work here?
There was a problem hiding this comment.
No. From my testing, if a read-only bind is made, it only partially works.
For example in Warframe, if it's not passed at all, the launcher does start, but clicking anywhere on the launcher causes it to crash, with Proton logs mentioning /sys/class/drm.
If it's a read-only mount, Warframe's launcher works and is interactible, but clicking on "Play" causes the game to crash, and not launch.
Only if it's a read-write or DevBind, that the game launches and works fine.
I didn't try out other games, but it should be more or less the same.
There was a problem hiding this comment.
/sys/class/drm is a directory with a bunch of symlinks. I wonder why there is any difference. Maybe using strace can reveal more.
There was a problem hiding this comment.
After some digging, I think I have a clue. When a program attempts to open /sys/class/drm/version with write permissions, EROFS (Read-only file system) gets triggered, instead of EACCES (Permission denied).
In the Wine-Wayland source code, EACCES has its own error logic (STATUS_ACCESS_DENIED), but EROFS falls back to a generic error (STATUS_UNSUCCESSFUL).
https://github.com/nanomatters/wine-salkim/blob/wineland_20260713-reorg/dlls/mountmgr.sys/unixlib.c#L59
Though, I'm not sure why this even happens in the first place.
Read-only bind:
syntrait@localhost ~ [1]> python3 -c "open('/sys/class/drm/version', 'w')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
open('/sys/class/drm/version', 'w')
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 30] Read-only file system: '/sys/class/drm/version'
syntrait@localhost ~ [1]> echo > /sys/class/drm/version
warning: An error occurred while redirecting file '/sys/class/drm/version'
open: Read-only file system
DevBind:
syntrait@localhost ~ [1]> python3 -c "open('/sys/class/drm/version', 'w')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
open('/sys/class/drm/version', 'w')
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/sys/class/drm/version'
syntrait@localhost ~ [1]> echo > /sys/class/drm/version
warning: An error occurred while redirecting file '/sys/class/drm/version'
open: Permission denied
There was a problem hiding this comment.
So a read-write Bind will work?
There was a problem hiding this comment.
I think I will go with recreating /sys/class/drm/. The eventual plan for direct_rendering is to be able to select a particular GPU to pass to sandbox. This means the directory should only contain links to GPUs passed. Creating the directory from scratch gives control over that. I highly doubt version can change while sandbox is running.
There was a problem hiding this comment.
That sounds nice. In the meantime, I think it would be a good idea to fix the current direct_rendering first, since Steam Wayland gaming is getting more and more popular.
With how GloriousEggroll and CachyOS team made their own Steam Overlay compatibility layers that work with Wayland, people will start running their games with Wayland more often. I think GE's one even works for native Linux games like CS2, though I heard it requires you to compile it yourself.
It wouldn't be a good experience, if the out-of-the-box Steam profile didn't work for native Wayland games.
There was a problem hiding this comment.
I will rework the algorithm soon. It is a bit dated at this stage and inelegant.
Fixes Proton Wayland gaming on Steam
Games that are run through Proton-GE and
PROTON_ENABLE_WAYLAND=1crash on launch, if/sys/class/drmis not passed to the container.