Open musjj opened 6 months ago
I get the same error in steam. As both are inside a fhsenv maybe it is worth investigating bwrap ? I saw that in steam there is a security wrapper for setuid bit. But that doesnt seem to be sufficient
I created an account just to share this. Extremely hacky and unsafe but this allows lutris to work with gamescope with capSysNice enabled.
myLutrisPkg = let hackedPkgs = pkgs.extend (final: prev: { buildFHSEnv = args: prev.buildFHSEnv (args // { extraBwrapArgs = (args.extraBwrapArgs or []) ++ [ "--cap-add ALL" ]; }); }); in hackedPkgs.lutris;
Basically I overrode the package to add an extra bwrap argument of "--cap-add ALL" which fixes the issues with lutris not being able to get permission to set niceness in the FHS env. Add that to top of file and add myLutrisPkg instead of lutris in your systemPackages. This works with gamemode niceness enabled and gamescope capSysNice.
I haven't experienced any issues, however I did notice there was an issue with vkCreateDevice obtaining a high priority queue so not sure if the niceness actually is working, but it bypassed the error and gamescope doesn't state that it doesn't have cap_sys_nice... This could be due to my use of chaotic nyx mesa_git or my older polaris card.
I'm facing this when trying to set launch options on a game with steam for example:
gamescope -W 3840 -H 2160 -r 60 -- %command%
Results in:
failed to inherit capabilities: Operation not permittedUploaded AppInterfaceStats to Steam
I haven't experienced any issues, however I did notice there was an issue with vkCreateDevice obtaining a high priority queue so not sure if the niceness actually is working, but it bypassed the error and gamescope doesn't state that it doesn't have cap_sys_nice... This could be due to my use of chaotic nyx mesa_git or my older polaris card.
Thanks for ure workaround I am pretty confident that the vkCreateDevice is from mesa-git I got that same error also on mesa git. I am wondering whether it would be sufficient to add the renice capability instead of all, have you tried that ? Otherwise I will try that in the following days when I find time
I did try just adding —cap-add sys_nice I think it was however that didn’t resolve the issue so I just added all the capabilities. It’s just an issue with using bubblewrap for lutris that you don’t have the necessary permissions in the namespace. I also initially tried overriding the bwrap executable used in the module with a wrapped one (tried setuid and just set cap) but that didn’t work.
Not sure if this would fix your issue with Lutris, but I recently had a similar issue with running gamescope from steam (e.g. gamescope -- %command%
in the game's launch options). Running steam from the terminal allowed me to see what the issue is. First it was something about failed to inherit capabilities
, after disabling cap_sys_nice it said something about missing libraries. Ultimately this is the config that fixed it for me:
programs = {
steam.enable = true;
# Fixes using gamescope in steam
steam.package = pkgs.steam.override {
extraPkgs = pkgs:
with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
];
};
gamescope.enable = true;
gamescope.capSysNice = false; # Breaks gamescope in steam
};
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/unable-to-activate-gamescope-capsysnice-option/37843/6
Describe the bug
When trying to use gamescope from inside lutris (
Configure
->System options
->Enable Gamescope
), the game will simply not start.Steps To Reproduce
Lutris isn't providing any gamescope logs, so I tried to run it manually from inside the fshenv via the built-in terminal (
Open Bash terminal
):And I got this error:
This is my gamescope & gamemode config:
Expected behavior
Games in Lutris should be able to run with gamescope.
Notify maintainers
@kira-bruneau @nrdxp @Madouura
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.