Steam

From Gentoo Wiki
Jump to: navigation, search
Resources

Steam is an Internet-based digital distribution, digital rights management (DRM), multiplayer, and social networking platform developed by Valve Corporation. Steam provides the user with installation and automatic updating of games on multiple computers, and community features such as friends lists and groups, cloud saving, and in-game voice and chat functionality. - Wikipedia, the free encyclopedia

Games

Prerequisites

Dependencies

Note
This section can be skipped when using the steam-launcher ebuild from an overlay.

Create a set to conveniently manage and update the Steam dependencies without changing the world set.

Note
The following lists may be outdated and require verification. Several libraries may be provided by the Steam runtime, in which case the system library will not be used.

x86

FILE /etc/portage/sets/steam
dev-libs/glib:2
dev-libs/libgcrypt
dev-libs/nspr
dev-libs/nss
media-libs/alsa-lib
media-libs/fontconfig
media-libs/freetype:2
media-libs/libjpeg-turbo
media-libs/libogg
media-libs/libpng:1.2
media-libs/libsdl
media-libs/libtheora
media-libs/libvorbis
media-libs/openal
media-sound/pulseaudio
net-misc/curl
net-print/cups
sys-apps/dbus
>=sys-devel/gcc-4.6.0
>=sys-libs/glibc-2.15
>=sys-libs/zlib-1.2.4
virtual/opengl
x11-libs/cairo
x11-libs/gdk-pixbuf
x11-libs/gtk+:2
>=x11-libs/libX11-1.5
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/pango
>=x11-libs/pixman-0.24.4

amd64

Note
Steam is a 32-bit application and requires a multilib profile on amd64, unless a chroot is used.
FILE /etc/portage/sets/steam
dev-libs/expat abi_x86_32
dev-libs/libffi abi_x86_32
dev-libs/libpthread-stubs abi_x86_32
media-libs/mesa abi_x86_32
sys-devel/llvm abi_x86_32
sys-libs/zlib abi_x86_32
virtual/libffi abi_x86_32
virtual/opengl abi_x86_32
x11-libs/libdrm abi_x86_32
x11-libs/libpciaccess abi_x86_32
x11-libs/libX11 abi_x86_32
x11-libs/libXau abi_x86_32
x11-libs/libxcb abi_x86_32
x11-libs/libXdamage abi_x86_32
x11-libs/libXdmcp abi_x86_32
x11-libs/libXext abi_x86_32
x11-libs/libXfixes abi_x86_32
x11-libs/libxshmfence abi_x86_32
x11-libs/libXxf86vm abi_x86_32
x11-proto/damageproto abi_x86_32
x11-proto/dri2proto abi_x86_32
x11-proto/dri3proto abi_x86_32
x11-proto/fixesproto abi_x86_32
x11-proto/glproto abi_x86_32
x11-proto/inputproto abi_x86_32
x11-proto/kbproto abi_x86_32
x11-proto/presentproto abi_x86_32
x11-proto/xcb-proto abi_x86_32
x11-proto/xextproto abi_x86_32
x11-proto/xf86bigfontproto abi_x86_32
x11-proto/xf86driproto abi_x86_32
x11-proto/xf86vidmodeproto abi_x86_32
x11-proto/xproto abi_x86_32

Texture compression

Certain games, such as those that use the Source engine, require S3 Texture Compression (S3TC) support.

FILE /etc/portage/sets/steam
media-libs/libtxc_dxtn abi_x86_32

Next, install the set:

root #emerge --ask @steam

Kernel

Steam expects that /dev/shm, which requires kernel tmpfs support, is mounted prior to being started. /dev/shm should be mounted automatically by OpenRC and systemd during boot, but can also be explicitly mounted via /etc/fstab:

FILE /etc/fstab
# to limit the size add e.g. size=768M to opts (default is 50%)
 
#<fs>      <mountpoint>    <type>	<opts>		     <dump/pass>
shm        /dev/shm        tmpfs        nodev,nosuid,noexec  0 0

Installation

Note
Currently Steam only supports Ubuntu 12.04+. Attempting to run Steam on any other distribution may cause issues. Refer to Steam client and games troubleshooting for details.

The Steam installer downloads and installs the Steam client to the users home directory. This prevents Portage from managing the Steam client updates or the software installed by it. The Steam client is solely responsible for managing software installation and updates.

Manual

Fetch and extract the Steam installer:

user $tar -xvzpf steam_latest.tar.gz

Run the Steam installer:

user $cd steam
user $./steam

Steam can be started with:

user $~/steam/steam
Note
The following is recommend with a dedicated Steam user account, to prevent Steam (or the software it depends on) from interfering with the regular user account.

To avoid restarting or running two X servers in parallel, use su to switch to the Steam user, and use x11-apps/xauth to give the Steam user access to the running X server. Refer to bash-steam-launcher for details.

Manual with alternative installer script

Note
The following instructions are almost the same as the manual instructions, except that an alternative Steam installer script is used.

Fetch the Steam installer and extract the required files:

user $tar -xvzf steam_latest.tar.gz steam/bootstraplinux_ubuntu12_32.tar.xz
user $tar -xvzf steam_latest.tar.gz steam/steam.desktop

Fetch and run Julian Ospald's (hasufell) Steam installer script:

Overlay

The steam-launcher ebuild is available from the Gentoo Gamers overlay or anyc's Steam overlay.

Chroot

It is possible to run Steam in a 32-bit chroot on amd64 without relying on multilib, or the emul-linux-x86-* packages (which are masked and set for removal[1]).

Create the chroot directory:

root #mkdir /usr/local/steam32
root #cd /usr/local/steam32

Fetch and extract the stage tarball:

Create the Portage directory:

root #mkdir usr/portage

Mount the necessary filesystems:

root #mount -R /usr/portage usr/portage
root #mount -R /dev dev
root #mount -R /sys sys
root #mount -t proc proc proc

Copy DNS information:

root #cp /etc/resolv.conf etc

Chroot with linux32, which is provided by the sys-apps/util-linux package, and reload the environment:

root #linux32 chroot .
root #source /etc/profile && env-update

Create the Steam user:

root #useradd -m -G audio,video steam

Next, install Steam from one of the above installation methods. When complete, create the following wrapper script to setup the chroot, su to the Steam user, and run Steam.

FILE /usr/local/bin/steam32
#!/bin/sh
 
CHROOT_DIR=/usr/local/steam32
 
mount -R /dev "${CHROOT_DIR}/dev"
mount -R /sys "${CHROOT_DIR}/sys"
mount -t proc proc "${CHROOT_DIR}/proc"
 
[ -f $CHROOT_DIR/var/run/dbus.pid ] || chroot "${CHROOT_DIR}" dbus-launch --system
chroot "${CHROOT_DIR}" su steam -c "dbus-launch steam"
 
umount -l "${CHROOT_DIR}/dev"
umount -l "${CHROOT_DIR}/sys"
umount -l "${CHROOT_DIR}/proc"

Although the above script uses D-Bus, it is possible to run Steam without it, but a manual method is required to connect the X server from within the chroot.

Client troubleshooting

Video drivers

  • nvidia-drivers: You will need to unmask latest x11-drivers/nvidia-drivers.
  • If S3TC support is missing, install media-libs/libtxc_dxtn.
  • Starting some games (TF, CS:S) on legacy ATI drivers will give this error: "Required OpenGL extension "GL_EXT_texture_sRGB_decode" is not supported. Please update your OpenGL driver." Workaround is here.

OpenGL GLX context is not using direct rendering

If steam is complaining about a lack of 3D capability and you do have a 3D drivers, libraries (eselect opengl list) all setup (glxinfo | grep "direct rendering" # direct rendering: Yes), steam is accessing the wrong libGL. This was caused by a recent update of app-eselect/eselect-opengl to version 1.3.0. Temporary workaround:

  • Nvidia
user $LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib32/opengl/nvidia/lib" ~/.local/share/Steam/steam.sh
  • ATI
user $LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib32/opengl/ati/lib" ~/.local/share/Steam/steam.sh

Fonts

Some people seem to have problems with missing fonts. A user reported it being solved by emerging media-fonts/font-bitstream-100dpi.

Sometimes Xorg does not recognize the new fonts installed. To fix this temp. run:

user $xset +fp /usr/share/fonts/100dpi/
user $./steam.sh

You may also need media-fonts/corefonts if fonts don't appear to be rendering correctly.

The game Stealth Bastard Deluxe will segfault if media-fonts/font-misc-misc is not installed [1], specifically the game will request the fonts "9x15"/"9x15b", so check with x11-apps/xlsfonts if those are available, otherwise add them to the fontpath and possibly add an alias in e.g. /usr/share/fonts/misc/fonts.alias:

FILE /usr/share/fonts/misc/fonts.aliasAliases for misc fonts
9x15  -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
9x15B -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso10646-1

Mouse cursor

If your WM/DE does not set a mouse pointer theme, then Steam will overwrite the default X11 cursor theme, often resulting in a reversed pointer from left to right.

To fix this, just install and enable a compatible cursor theme via your WM/DE (e.g. x11-themes/vanilla-dmz-xcursors).

You can also enable the installed theme manually with the following method:

user $mkdir ~/.icons
user $ln -s /usr/share/cursors/xorg-x11/Vanilla-DMZ ~/.icons/default
Note
This fix will not work if you will try to symlink a KDE cursor theme (eg: Oxygen_White).

If the mouse cursor gets stuck pointing in the wrong direction after exiting steam you can work around that via:

user $xsetroot -cursor_name left_ptr

Flashplayer on amd64

Get the 32bit flashplayer from adobe and extract libflashplayer.so to your current working dir. Now run:

user $mkdir <path-to-steam-installation>/ubuntu12_32/plugins
user $mv libflashplayer.so <path-to-steam-installation>/ubuntu12_32/plugins/
user $chmod +x <path-to-steam-installation>/ubuntu12_32/plugins/libflashplayer.so

Typically the path located in ~/.local/share/Steam. Alternatively emerge www-plugins/adobe-flash with abi_x86_32 option enabled and run:

user $mkdir <path-to-steam-installation>/ubuntu12_32/plugins
user $ln -s /usr/lib32/nsbrowser/plugins/libflashplayer.so <path-to-steam-installation>/ubuntu12_32/plugins/

Memory corruption on startup

You might get an error like this:

user $steam
*** glibc detected *** zenity: malloc(): memory corruption: 0x00000000016cf020 ***

Try to emerge x11-libs/libXi and it should work.

Hardened Gentoo

It looks like the steam binary has rwx bits in it. You will need to mark the binary with the following to get it working on a hardened system.

user $paxctl-ng -m ~/.local/share/Steam/ubuntu12_32/steam

Binaries of most games also should be paxmarked, for ex.:

user $paxctl-ng -m ~/.local/share/Steam/SteamApps/common/"World of Goo/WorldOfGoo"
user $paxctl-ng -m ~/.local/share/Steam/SteamApps/common/Uplink/uplink.bin.x86_64
user $paxctl-ng -m ~/.local/share/Steam/steamapps/common/Team\ Fortress\ 2/hl2_linux

Failure to perform these paxmarkings will result in the game failing to run with little information given. You can check if the game needs to be paxmarked by running the game's startup script or binary file (found under ~/.local/share/Steam/steamapps or ~/.local/share/Steam/steamapps/common) under a debugger. This can be accomplished with some of Valve's provided startup scripts by passing in gdb in a GAME_DEBUGGER environment variable, for ex.:

user $env GAME_DEBUGGER=gdb ./hl2.sh

If the binary needs to be paxmarked, gdb should output something similar to "warning: Cannot call inferior functions, Linux kernel PaX protection forbids return to non-executable pages!" and/or "Cannot access memory at address 0x80486c6."

After latest update (around Jul 2013) steam also need paxmarked sh when the openGL libraries require RWX markings or it fail to run games from steam client (see https://github.com/ValveSoftware/steam-for-linux/issues/254 for details):

user $sudo paxctl-ng -m /bin/bash

However, this causes bash to not run. Also as it is a security issue you are strongly encouraged to try without paxmarking it. If it works for you when using proprietary nvidia drivers please report it back.

Steam runtime

By default, Valve bundles their own libraries with the steam package and uses them instead of installed system libraries. This behavior can be changed by setting the environment variable STEAM_RUNTIME=0.

Warning

It is not recommended to deactivate Steam runtime. This can lead to numerous problems, including runtime and missing 32-bit libraries.

Steam reset

If you want to wipe out your current steam installation which includes your installed games and reinstall steam without losing their data, you can use the --reset command line option:

user $steam --reset

Steam without D-Bus

When running Steam without D-Bus, do not select the Remember my password option at the Steam login dialog, otherwise Steam will segfault the next time it is run [2]. If Steam is segfaulting as a result of this option being selected, run the following to fix the issue:

user $rm -fr ~/.local/share/Steam/config

Taskbar buttons persist when Steam is minimzed to the system tray

Depending on your DE, you might have a taskbar button showing for Steam all the time, even when the main window is closed or minimized to the systray. To stop this behavior, add this to /etc/environment.

FILE /etc/environmentBasic Environment Variables for all Processes
STEAM_FRAME_FORCE_CLOSE=1

You will need to logout and back in to enact the changes.

Games troubleshooting

If you have problems on 64 bit, it's because emul-linux-x86-* are typically very out of date.

You can try using a 32-bit chroot.

Dota 2

If you notice lots of black textures, it's because the mesa driver is out of date, until version 9.1.6 or higher is released as part of emul-linux-x86-opengl, you will have to resort to using a 32 bit chroot.

If you are seeing the issues from above [lots of black textures] but are using multi-lib and, therefore, aren't using an old 32-bit mesa, you may try building mesa with USE -bindist like talked about here: https://github.com/ValveSoftware/Dota-2/issues/1434.

If you notice red screen, it's the libtxc_dxtn (again). (Look for it along this page.)

For the red textures in gentoo 64 bits emerge the package sys-libs/glibc with the line >=media-libs/libtxc_dxtn-1.0.1-r1 abi_x86_32 in /etc/portage/package.use

Left 4 Dead 2

If you experience black textures, you are missing S3TC texture (de)compression, add the following to package.use
media-libs/libtxc_dxtn abi_x86_32
and then emerge libtxc_dxtn

Rust (legacy)

After setting launch options in the configuration menu and clicking ok, if Rust fails to launch, then add the following Steam launch options to force Rust to use the correct binaries
LD_LIBRARY_PATH="/usr/lib:$LD_LIBRARY_PATH" %command%

Starbound

Starbound's launcher may fail with the following error:

This application failed to start because it could not find or load the Qt platform plugin "xcb".

Available platform plugins are: xcb.

Reinstalling the application may fix this problem.

You may be able to work around this problem by entering this into Starbound's launch options: $(dirname %command%)/starbound

Team Fortress 2

If you only get a black screen for 1-2 seconds, try adding "-nojoy" to Game->Properties->"Set Launch Options".

X3 Terran Conflict and Albion Prelude

If you are unable to start the launcher, make sure that media-libs/libtxc_dxtn is installed. See the official Linux Support Thread.

This system does not support the OpenGL extension GL_EXT_texture_compression_s3tc

Install helper library for S3TC texture (de)compression.
echo ">=media-libs/libtxc_dxtn-1.0.1-r1 abi_x86_32" >> /etc/portage/package.use
emerge libtxc_dxtn -j3

Restart graphic system and examine if GL extension is available.
glxinfo | grep GL_EXT_texture_compression_s3tc

If there is no GL_EXT_texture_compression_s3tc try to update driver. If you are using radeon open driver, set correct value to VIDEO_CARDS variable in make.conf. For example value VIDEO_CARDS="r600" is valid for HD6310. More info about radeon cards.

If GL extension is here, but error still raises, suppress it by next command.
export force_s3tc_enable=true
~/.steam/root/steam.sh

01:32, 30 May 2014 (UTC) had to emerge x11-libs/gtkglarea for s3tc errors to go away under nouveau.

Further help

Before you ask anywhere else, refer to the Gentoo forum thread. Post your solutions and update this wiki page if someone confirms. Please don't remove content without Discussion unless it's wrong content.

External resources

References

  1. Michał Górny. True multilib support on amd64, Gentoo, March 28th, 2015. Retrieved on May 25th, 2015.
  2. Shished. Steam segfaults when "remember my password" is checked, Steam for Linux, July 28th, 2014. Retrieved on May 25th, 2015.