Steam: Difference between revisions

From Alpine Linux
(mesa-dri-gallium)
(→‎Troubleshooting: recommend gamescope)
 
(31 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[http://store.steampowered.com/about/ Steam] is a popular game distribution platform by Valve.
This page explains how to run [https://store.steampowered.com/about/ Steam], a popular game distribution platform by Valve on Alpine Linux. Steam requires glibc to run, and thus won't run natively on Alpine Linux. The simplest approach is to run it as [[Flatpak]]. Other workarounds involve using a virtual machine, a chroot or a container. It is theoretically possible to run the windows version of Steam using {{Pkg|wine}}.


{{Note|Steam for Linux only supports Ubuntu LTS. Thus, do not turn to Valve for support for issues with Steam on Alpine Linux.}}
== Installation via Flatpak ==


== Installation ==
# Follow the [[Flatpak#Installing_Flatpak|Flatpak]] wiki page and ensure that [[Flatpak#Installing_Flatpak|Flathub repository]] is enabled.
# Install the Steam flatpak package from Flathub.{{Cmd|$ flatpak --user install com.valvesoftware.Steam}}
# After installation Steam can be started either using its .desktop file or from the command line: {{Cmd|$ flatpak run com.valvesoftware.Steam}}


Steam requires glibc to run, and thus doesn't straight up run on Alpine Linux.
== Installation via Rootfs ==
To work around this problem, we'll use [https://wiki.alpinelinux.org/wiki/Flatpak Flatpak].
Make sure you have the Flathub repository installed.


  # apk add flatpak
The [https://git.sr.ht/~whynothugo/steam-container steam-container] project provides a Makefile to provision a rootfs with Arch Linux and runs Steam in a [[Bubblewrap]] container.
  $ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
  $ flatpak install com.valvesoftware.Steam


After installation Steam can be started using it's .desktop file or on the command line:
== Troubleshooting ==
 
=== My controllers aren't detected ===
 
By default regular desktop users don't have permission to interact with controllers' device nodes. The exact solution varies depending on whether udev, logind or mdevd are being used:
 
==== With udev and logind ====
 
On systems with [[udev]] and [[Elogind]], the rules from the official Steam package address this. They are available as an Alpine package.
 
  # apk add {{pkg|steam-devices|arch=x86_64}}
 
These udev rules rely on the <code>TAG+="uaccess"</code>, and will not work without [[Elogind]].


  $ flatpak run com.valvesoftware.Steam
==== With udev without logind ====


== Troubleshooting ==
On systems with [[udev]] and without logind, the above rules can be used as reference, modifying them to change device ownership to a user or group of your choosing (typically, plugdev).


=== My controllers aren't detected ===
==== With mdevd ====


By default Steam doesn't have permission to read your controllers.
With mdevd, you'll need to write your own rules. Be sure that they precede te generic input rule, since the first match wins. The following example sets changes group ownership for a "Nintendo Switch Pro Controller" to the "plugdev" group, and sets permissions so that any member of the group may access the device:
This can be fixed by installing an udev rule from the official Steam package, but the udev rules are also available as an Alpine package.


  # apk add steam-devices
# Nintendo Switch Pro Controller (must precede generic input rule)
DEVPATH=/devices/virtual/misc/uhid/0005:057E:2009\.[0-9A-F]{4}/input/input[0-9]+;.* root:plugdev 660


=== SteamVR won't launch ===
=== SteamVR won't launch ===
Line 40: Line 50:
Add the Mesa gallium driver and reboot your system.
Add the Mesa gallium driver and reboot your system.


  # apk add mesa-dri-gallium
  # apk add {{pkg|mesa-dri-gallium|arch=x86_64}}


=== eventfd: Too many open files ===
=== eventfd: Too many open files ===


Due to a low amount of allowed open file descriptors, Proton games may crash shortly after launching. This can be worked around by disabling esync but many games will perform measurably worse without it. Instead, user limits should be increased.
Due to a low amount of allowed open file descriptors, Proton games may crash shortly after launching. This can be worked around by disabling esync but many games will perform measurably worse without it. Instead, user limits should be increased. In order to do this, you will need [[PAM]] and a PAM enabled login.
 
In order to do this, you will need PAM and a PAM enabled login:
# apk add linux-pam shadow-login


Add the following to <code>/etc/security/limits.conf</code>:
Add the following to <code>/etc/security/limits.conf</code>:
  @users hard nofile 524288
  @users hard nofile 524288
{{Note|Although you should already belong to the users group, you can run <code>groups</code> to check.}}
{{Note|Although you should already belong to the users group, you can run <code>groups</code> to check.}}
Reboot and run <code>ulimit -Hn</code> to verify the new limits are applied.
Reboot and run <code>ulimit -Hn</code> to verify the new limits are applied.
=== dbus-launch: no such file or directory ===
Set up [[D-Bus|dbus]] for your session.
=== Steam games launched via Proton crash before creating a window ===
Instead of just using the in-Steam menu to install and select a Proton version, try installing the flatpak community build for Proton onto your system. There are several versions, depending on your desired stability, and the experimental version available in Flathub is called "com.valvesoftware.Steam.CompatibilityTool.Proton-Exp". After you install your chosen version, go into Steam to specify compatibility tool for a game as usual. The installed community build will now be an option. Select that and try launching the game again.
As your last resort, you can try installing [https://github.com/GloriousEggroll/proton-ge-custom proton-ge-custom], but please note that in order for this to be even detected by Steam, you will need to install Steam via Nix due to high level of isolation that Flatpaks utilize. This can however come at the expense of your [https://tosdr.org/en/service/180 privacy].
=== Steam spams dmesg with x86/split lock detection entries ===
Add the below line to {{path|/etc/sysctl.conf}}:
  kernel.split_lock_mitigate = 0
=== Steam hangs on start with a steamwebhelper popup ===
If this happens and {{path|~/.var/app/com.valvesoftware.Steam/.local/share/Steam/logs/steamwebhelper.log}} says that you are missing X server or <var>DISPLAY</var>, it means your <var>DISPLAY</var> is not present in the activation environment. For more information please see https://github.com/ValveSoftware/steam-for-linux/issues/10554
'''[[Sway]]''': Go into your sway config file and ensure that <var>DISPLAY</var> appears in the {{ic|dbus-update-activation environment}} line, as well as the [https://github.com/swaywm/sway/wiki#systemd-and-dbus-activation-environments others stated here], then restart:
<pre>exec dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP=sway SWAYSOCK I3SOCK XCURSOR_SIZE XCURSOR_THEME</pre>
For more information about this line, please see the [[Sway|Alpine Linux wiki entry]] on Sway
'''Hyprland''': Add an exec-once to the configuration file at {{path|~/.config/hypr/hyprland}} to set <var>DISPLAY</var>. Similarly to Sway you may already have a line that sets other variables. If so, add <var>DISPLAY</var> to the line. The line should look similar to this:
<pre>exec-once = dbus-update-activation-environment DISPLAY</pre>
=== Game look blurry ===
When using factional scaling, consider using [[gamescope]] to mediate sizes between the compositor and games, so that games render at a native resolution and are not scaled by the compositor:
gamescope -W 3440 -H 1440 -e flatpak run com.valvesoftware.Steam
Replace 3440 and 1440 with your monitor's native resolution.
== See Also ==
* [[Gaming on Alpine|Gaming on Alpine Linux]]
* [[Flatpak]]
* [https://github.com/ValveSoftware/gamescope Gamescope] - SteamOS session compositing window manager, available on Alpine Linux as {{Pkg|gamescope}}
* [https://wiki.postmarketos.org/wiki/Steam Steam on postmarketOS]
[[category:Gaming]]

Latest revision as of 07:24, 26 March 2026

This page explains how to run Steam, a popular game distribution platform by Valve on Alpine Linux. Steam requires glibc to run, and thus won't run natively on Alpine Linux. The simplest approach is to run it as Flatpak. Other workarounds involve using a virtual machine, a chroot or a container. It is theoretically possible to run the windows version of Steam using wine.

Installation via Flatpak

  1. Follow the Flatpak wiki page and ensure that Flathub repository is enabled.
  2. Install the Steam flatpak package from Flathub.

    $ flatpak --user install com.valvesoftware.Steam

  3. After installation Steam can be started either using its .desktop file or from the command line:

    $ flatpak run com.valvesoftware.Steam

Installation via Rootfs

The steam-container project provides a Makefile to provision a rootfs with Arch Linux and runs Steam in a Bubblewrap container.

Troubleshooting

My controllers aren't detected

By default regular desktop users don't have permission to interact with controllers' device nodes. The exact solution varies depending on whether udev, logind or mdevd are being used:

With udev and logind

On systems with udev and Elogind, the rules from the official Steam package address this. They are available as an Alpine package.

 # apk add steam-devices

These udev rules rely on the TAG+="uaccess", and will not work without Elogind.

With udev without logind

On systems with udev and without logind, the above rules can be used as reference, modifying them to change device ownership to a user or group of your choosing (typically, plugdev).

With mdevd

With mdevd, you'll need to write your own rules. Be sure that they precede te generic input rule, since the first match wins. The following example sets changes group ownership for a "Nintendo Switch Pro Controller" to the "plugdev" group, and sets permissions so that any member of the group may access the device:

# Nintendo Switch Pro Controller (must precede generic input rule)
DEVPATH=/devices/virtual/misc/uhid/0005:057E:2009\.[0-9A-F]{4}/input/input[0-9]+;.* root:plugdev 660

SteamVR won't launch

Out of the box SteamVR might not be able to launch and give you various errors. Steam tries to fix this itself by setting the right capabilities on the SteamVR binary, but this doesn't work in the Flatpak. Instead we'll have do it manually.

 # setcap CAP_SYS_NICE+ep ~/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher

Then restart Steam.

There is an issue for this on the Flathub repository.

Steam - Error: OpenGL GLX extension not supported by display

Add the Mesa gallium driver and reboot your system.

# apk add mesa-dri-gallium

eventfd: Too many open files

Due to a low amount of allowed open file descriptors, Proton games may crash shortly after launching. This can be worked around by disabling esync but many games will perform measurably worse without it. Instead, user limits should be increased. In order to do this, you will need PAM and a PAM enabled login.

Add the following to /etc/security/limits.conf:

@users hard nofile 524288
Note: Although you should already belong to the users group, you can run groups to check.

Reboot and run ulimit -Hn to verify the new limits are applied.

dbus-launch: no such file or directory

Set up dbus for your session.

Steam games launched via Proton crash before creating a window

Instead of just using the in-Steam menu to install and select a Proton version, try installing the flatpak community build for Proton onto your system. There are several versions, depending on your desired stability, and the experimental version available in Flathub is called "com.valvesoftware.Steam.CompatibilityTool.Proton-Exp". After you install your chosen version, go into Steam to specify compatibility tool for a game as usual. The installed community build will now be an option. Select that and try launching the game again.

As your last resort, you can try installing proton-ge-custom, but please note that in order for this to be even detected by Steam, you will need to install Steam via Nix due to high level of isolation that Flatpaks utilize. This can however come at the expense of your privacy.

Steam spams dmesg with x86/split lock detection entries

Add the below line to /etc/sysctl.conf:

 kernel.split_lock_mitigate = 0

Steam hangs on start with a steamwebhelper popup

If this happens and ~/.var/app/com.valvesoftware.Steam/.local/share/Steam/logs/steamwebhelper.log says that you are missing X server or DISPLAY, it means your DISPLAY is not present in the activation environment. For more information please see https://github.com/ValveSoftware/steam-for-linux/issues/10554

Sway: Go into your sway config file and ensure that DISPLAY appears in the dbus-update-activation environment line, as well as the others stated here, then restart:

exec dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP=sway SWAYSOCK I3SOCK XCURSOR_SIZE XCURSOR_THEME

For more information about this line, please see the Alpine Linux wiki entry on Sway

Hyprland: Add an exec-once to the configuration file at ~/.config/hypr/hyprland to set DISPLAY. Similarly to Sway you may already have a line that sets other variables. If so, add DISPLAY to the line. The line should look similar to this:

exec-once = dbus-update-activation-environment DISPLAY

Game look blurry

When using factional scaling, consider using gamescope to mediate sizes between the compositor and games, so that games render at a native resolution and are not scaled by the compositor:

gamescope -W 3440 -H 1440 -e flatpak run com.valvesoftware.Steam

Replace 3440 and 1440 with your monitor's native resolution.

See Also