Open pchmykh opened 6 months ago
What does systemctl --user show-environment | grep DISPLAY
output?
And, if you run the Steam Flatpak app as a separate app (not via Cartridges, just opening Steam so you can see the Store/Library/etc.), does that work, or does it fail in the same way?
What does
systemctl --user show-environment | grep DISPLAY
output?
Hey, I get the same error when running Steam via flatpak run com.valvesoftware.Steam
and the output of that command gives:
DISPLAY=:0
WAYLAND_DISPLAY=wayland-1
Running dbus-update-activation-environment DISPLAY
right before starting the desktop environment did not solve it.
@truecrunchyfrog: because we have not had any confirmation from @pchmykh whether dbus-update-activation-environment DISPLAY
resolves the problem, or whether they can reproduce the same problem in a simpler scenario, we cannot know whether you are actually experiencing the same issue that they are and for the same reason. If the root cause turns out to be different, then we might need to ask you to open your own, separate issue with more details of your system.
You say that systemctl --user show-environment | grep DISPLAY
outputs DISPLAY=:0
. This indicates that DISPLAY
is set for systemd user services (that's good).
Some questions:
What host operating system?
What desktop environment? Or if your GUI environment is assembled from individual pieces, which pieces, integrated how?
Which version of Flatpak?
when running Steam via
flatpak run com.valvesoftware.Steam
When running Steam from where? (A graphical terminal like xterm
? A ssh session? A text console? ...)
In the same terminal from which you ran Steam, what do these commands output?
env | grep DISPLAY
flatpak run --command=bash com.valvesoftware.Steam -c 'env | grep DISPLAY'
flatpak run --command=bash com.valvesoftware.Steam -c 'flatpak-spawn env | grep DISPLAY'
flatpak run --command=bash com.valvesoftware.Steam -c \
'~/.steam/root/ubuntu12_32/steam-runtime/run.sh steam-runtime-launch-client --alongside-steam env | grep DISPLAY'
flatpak run -vv --command=bash com.valvesoftware.Steam -c 'env | grep DISPLAY'
(The output of the last one will be rather long and detailed.)
What does
systemctl --user show-environment | grep DISPLAY
output?
~$ systemctl --user show-environment | grep DISPLAY DISPLAY=:0 GNOME_SETUP_DISPLAY=:1 WAYLAND_DISPLAY=wayland-0
And, if you run the Steam Flatpak app as a separate app (not via Cartridges, just opening Steam so you can see the Store/Library/etc.), does that work, or does it fail in the same way?
Steam Flatpak works good, I cann see Library, run games.
Fedora Workstation 40
GNOME
default installation (except systemd-boot instead of GRUB, but I think it's irrelevant)
Flatpak 1.15.8
~$ env | grep DISPLAY
WAYLAND_DISPLAY=wayland-0
GNOME_SETUP_DISPLAY=:1
DISPLAY=:0
~$ flatpak run --command=bash com.valvesoftware.Steam -c 'env | grep DISPLAY'
WAYLAND_DISPLAY=wayland-0
GNOME_SETUP_DISPLAY=:1
DISPLAY=:0
~$ flatpak run --command=bash com.valvesoftware.Steam -c 'flatpak-spawn env | grep DISPLAY'
DISPLAY=:0
GNOME_SETUP_DISPLAY=:1
WAYLAND_DISPLAY=wayland-0
~$ flatpak run --command=bash com.valvesoftware.Steam -c \
'~/.steam/root/ubuntu12_32/steam-runtime/run.sh steam-runtime-launch-client --alongside-steam env | grep DISPLAY'
DISPLAY=:0
GNOME_SETUP_DISPLAY=:1
WAYLAND_DISPLAY=wayland-0
Hope I did it in right way, and I'm sorry for multiple messages. Running dbus-update-activation-environment DISPLAY
before attempt doesn't help I believe.
@smcv
I use NixOS with Hyprland, trying to get my nvidia gpu to work with steam and all.
Flatpak 1.14.6
I ran flatpak run com.valvesoftware.Steam
using both rofi's drun and directly in Alacritty.
env | grep DISPLAY flatpak run --command=bash com.valvesoftware.Steam -c 'env | grep DISPLAY' flatpak run --command=bash com.valvesoftware.Steam -c 'flatpak-spawn env | grep DISPLAY' flatpak run --command=bash com.valvesoftware.Steam -c \ '~/.steam/root/ubuntu12_32/steam-runtime/run.sh steam-runtime-launch-client --alongside-steam env | grep DISPLAY'
The first 4 commands give the same result as in my previous post (DISPLAY=:0
and WAYLAND_DISPLAY=wayland-1
)
flatpak run -vv --command=bash com.valvesoftware.Steam -c 'env | grep DISPLAY'
The last one's output ends with the same as the previous ones.
I start Hyprland with this in my login shell:
if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then
dbus-update-activation-environment DISPLAY
dbus-run-session Hyprland
fi
That said, I am quite new to window managers, nixos, and linux in general, so I am mostly experimenting and not sure of how much which I use works (like dbus).
@pchmykh:
Steam Flatpak works good, I cann see Library, run games.
Right. Then in your case (unlike @truecrunchyfrog), activation of the Steam Flatpak app is generally working fine - but some factor in the way Cartridges is starting it is causing a problem.
I think we should divide up this issue report into two. @pchmykh is the original reporter of issue #10866, so @pchmykh gets to keep #10866, and @truecrunchyfrog will need to open a separate issue.
@pchmykh or @kisak-valve, please could you retitle this to reflect its original scope? Perhaps something like:
game cannot be started by Cartridges app using flatpak-spawn --host xdg-open steam://rungameid/...
@truecrunchyfrog, because the original issue reporter @pchmykh has clarified that their situation is not the same is yours, I think it's best if you open a separate issue with full details of your system and symptoms. In their situation, merely starting the Steam Flatpak app "in the obvious way" is working fine, and the broken scenario is a more specific one where Steam is being launched by a different Flatpak app. In your situation, starting the Steam Flatpak app "in the obvious way" is also not working, for whatever reason.
Some of the debugging steps are the same, but anything that we do to help @pchmykh is not necessarily going to help you, and vice versa.
I am quite new to window managers, nixos, and linux in general
You've really jumped in at the deep end by using Hyprland and NixOS! My understanding is that Hyprland is an environment where you are expected to build all the system integration yourself out of individual components, which gives you extremely fine control over everything, but requires a level of understanding of how things are meant to fit together that I would not expect a new user to have.
If you're new to Linux, I'd personally suggest starting by using a distribution and desktop environment where the system integration has already been done for you - perhaps Debian, Fedora or Ubuntu, with a GNOME or KDE Plasma desktop - so that you can get a better picture of what the overall system should "normally" look like.
@pchmykh, back to you.
It looks as though "Cartridges" has full, unrestricted access to your host system, and is using that access to launch Steam via xdg-open
.
You say that when you launch the Steam Flatpak app in the most obvious way, it works fine, but it seems that when you launch it via flatpak-spawn --host xdg-open ...
from Cartridges, something is going wrong somewhere along the way.
This might be something to do with the use of flatpak-spawn --host
? Or maybe xdg-open
is involved? It's hard to say.
When you get the error message "... must provide the DISPLAY environment variable ...", what that means is that the steam-runtime-check-requirements
tool in the Steam Flatpak app tried to launch a new Flatpak "sub-sandbox" (which Steam needs to do for its user interface, for internal technical reasons), and found that in the new sub-sandbox, the DISPLAY environment variable is not set. This will break the Steam user interface completely, and will also break Proton and the Steam Linux Runtime container runtime framework, which is why steam-runtime-check-requirements
wants to diagnose it early.
Some next things to try:
flatpak run --command=bash page.kramo.Cartridges -c 'flatpak-spawn --host env | grep DISPLAY'
flatpak run --command=bash page.kramo.Cartridges -c \
'flatpak-spawn --host flatpak run --command=bash com.valvesoftware.Steam -c "env | grep DISPLAY"'
flatpak run --command=bash page.kramo.Cartridges -c \
'flatpak-spawn --host flatpak run --command=bash com.valvesoftware.Steam -c "flatpak-spawn env | grep DISPLAY"'
That last one is relatively close to being an equivalent of what steam-runtime-check-requirements
does.
It would also be useful to look for the flatpak-session-helper
process in pstree -p
and/or systemd-cgls
(it should be started automatically when you run one of the commands above). Check whether it's a child process from systemd --user
or dbus-daemon --session
, or maybe dbus-broker
. Also, if you get its process ID, you can run a command like:
perl -pe 's/\0/\n/g' /proc/12345/environ
replacing 12345 with the process ID, to find out whether it has inherited DISPLAY
from its parent or not. The good answer is "yes": if it has not inherited a DISPLAY
, then there is a system-integration problem.
~$ flatpak run --command=bash page.kramo.Cartridges -c 'flatpak-spawn --host env | grep DISPLAY'
~$ flatpak run --command=bash page.kramo.Cartridges -c \
'flatpak-spawn --host flatpak run --command=bash com.valvesoftware.Steam -c "env | grep DISPLAY"'
~$ flatpak run --command=bash page.kramo.Cartridges -c \
'flatpak-spawn --host flatpak run --command=bash com.valvesoftware.Steam -c "flatpak-spawn env | grep DISPLAY"'
~$
Looks like nothing comes up.
OK, thanks. I think this probably means the problem you are having is with flatpak-spawn --host
, and therefore with the fact that Cartridges uses that command.
flatpak-spawn --host
works by asking flatpak-session-helper
to start a new process on the host system. The intention is that it will normally end up running as part of the GUI session (in your case GNOME) and therefore it will pick up the DISPLAY
from your GUI session.
I suspect that, on your particular system, flatpak-spawn --host
is not inheriting the DISPLAY
environment variable from its parent correctly. I'm surprised if this isn't "joined up" correctly on Fedora - I would have expected that they would normally get this sort of thing right.
Please look for the flatpak-session-helper
process in pstree -p
and/or systemd-cgls
(it should be started automatically whenever you run one of the commands involving flatpak-spawn --host
). Is it a child process from systemd --user
or dbus-daemon --session
, or maybe dbus-broker
?
Also please get its process ID, and run a command like:
perl -pe 's/\0/\n/g' /proc/12345/environ | grep DISPLAY
replacing 12345 with the process ID.
As a workaround, you could try exiting from any Flatpak apps, and then running this in a terminal:
/usr/libexec/flatpak-session-helper --verbose --replace
If you do that, the next time you run a command involving flatpak-spawn --host
, you should see some debug output appear in the terminal where you ran flatpak-session-helper
, and you will probably find that it inherits its DISPLAY
from that terminal (and therefore Steam/Cartridges will probably work as expected).
Your system information
Steam client version (build number or date): 1.0.0.79 Flatpak
Distribution (e.g. Ubuntu): Fedora workstation 40
Opted into Steam client beta?: No
Have you checked for system updates?: Yes
Steam Logs: logs.zip
GPU: CPU Embedded Intel 12400
Please describe your issue in as much detail as possible:
Starting Steam game using 'Cartridges' software, but nothing happens. Output is:
Steps for reproducing this issue:
echo $DISPLAY
command returns:0
echo $XDG_CURRENT_DESKTOP
command returnsGNOME
Also filled https://github.com/kra-mo/cartridges/issues/258 for further information, looks like it is Steam's site.Thanks!