Skip to content

Instantly share code, notes, and snippets.

@omsai
Created April 25, 2021 11:15
Show Gist options
  • Save omsai/c3cb8c7b68d7797e2b275eddaf01ec90 to your computer and use it in GitHub Desktop.
Save omsai/c3cb8c7b68d7797e2b275eddaf01ec90 to your computer and use it in GitHub Desktop.
Attempt to create a container to run Steam with a newer GLIBC for Surviving Mars' March 2021 patch on Debian 10
Bootstrap: library
From: ubuntu:20.04
%environment
export STEAM_RUNTIME=1
export LD_LIBRARY_PATH=". ldd vgui2_s.so"
#export LC_ALL=C
%post
# Set noninteractive or the keyboard-configuration step will cause it to hang.
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
# # Install nvidia container runtime.
# apt-get -qq install curl gnupg
# curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | apt-key add -
# distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
# curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list |tee /etc/apt/sources.list.d/nvidia-container-runtime.list
# Enable 32-bit packages to install steam.
dpkg --add-architecture i386
sed -i -E 's/main$/main universe restricted multiverse/' /etc/apt/sources.list
apt-get update
# Set locale to match your system to get rid of steam's warning.
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
apt-get -qq install locales
# Method 1: Use Ubuntu's steam package from multiverse. Using this method,
# steam still hangs on startup due to an X Error:
#
# $ /opt/singularity-3.6/bin/singularity run --nv ./steam.sif
# Running Steam on ubuntu 20.04 64-bit
# STEAM_RUNTIME is enabled automatically
# Pins up-to-date!
# Steam client's requirements are satisfied
# WARNING: Using default/fallback debugger launch
# /home/omsai/.steam/debian-installation/ubuntu12_32/steam -nominidumps -nobreakpad
# WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
# [2021-04-21 23:37:34] Startup - updater built Apr 12 2021 18:51:36
# SteamUpdateUI: An X Error occurred
# X Error of failed request: BadValue (integer parameter out of range for operation)
# ^C
#
# ...but the nvidia configuration works fine with --nv:
#
# $ /opt/singularity-3.6/bin/singularity shell --nv -s /bin/bash steam.sif
# To run a command as administrator (user "root"), use "sudo <command>".
# See "man sudo_root" for details.
#
# Singularity> cat /proc/driver/nvidia/version
# NVRM version: NVIDIA UNIX x86_64 Kernel Module 418.181.07 Sun Dec 27 19:26:35 UTC 2020
# GCC version: gcc version 8.3.0 (Debian 8.3.0-6)
# Singularity> nvidia-smi
# Wed Apr 21 23:38:57 2021
# +-----------------------------------------------------------------------------+
# | NVIDIA-SMI 418.181.07 Driver Version: 418.181.07 CUDA Version: 10.1 |
# |-------------------------------+----------------------+----------------------+
# | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
# | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
# |===============================+======================+======================|
# | 0 GeForce GTX 650 Ti On | 00000000:01:00.0 N/A | N/A |
# | 21% 35C P8 N/A / N/A | 223MiB / 1999MiB | N/A Default |
# +-------------------------------+----------------------+----------------------+
#
# +-----------------------------------------------------------------------------+
# | Processes: GPU Memory |
# | GPU PID Type Process name Usage |
# |=============================================================================|
# | 0 Not Supported |
# +-----------------------------------------------------------------------------+
# Singularity> exit
#
# # Install graphics driver per https://askubuntu.com/a/1264592
# # to get rid of the "SteamUpdateUI: An X Error occurred".
# apt-get -qq install nvidia-driver-418
# # Also install the dependencies the launcher complains about:
# # libXtst.so.6
# # libXrandr.so.2
# # libXrender.so.1
# # libgobject-2.0.so.0
# # libglib-2.0.so.0
# # libgio-2.0.so.0
# # libgtk-x11-2.0.so.0
# # libpulse.so.0
# # libgdk_pixbuf-2.0.so.0
# # libva.so.2
# # libbz2.so.1.0
# # libvdpau.so.1
# # libva.so.2
# # libva-x11.so.2
# apt-get -qq install steam libxtst6:i386 libgtk2.0-0:i386 libpulse0:i386 libbz2-1.0:i386 libvdpau1:i386 libva-x11-2:i386
# Method 2: Use Valve's deb.
apt-get -qq install gdebi-core wget libnvidia-gl-418 xserver-xorg-video-nvidia-418
wget http://media.steampowered.com/client/installer/steam.deb
gdebi -nq ./steam.deb
# Starting steam complains of these missing packages, so install them.
# Error: You are missing the following 32-bit libraries, and Steam may not run:
# libXtst.so.6
# libXrandr.so.2
# libXrender.so.1
# libgobject-2.0.so.0
# libglib-2.0.so.0
# libgio-2.0.so.0
# libgtk-x11-2.0.so.0
# libpulse.so.0
# libgdk_pixbuf-2.0.so.0
# libva.so.2
# libbz2.so.1.0
# libvdpau.so.1
# libva.so.2
# libva-x11.so.2
apt-get -qq install libxtst6:i386 libgtk2.0-0:i386 libpulse0:i386 libbz2-1.0:i386 libvdpau1:i386 libva-x11-2:i386 libgl1-mesa-dri:i386 libgl1:i386 libc6:i386 xdg-desktop-portal xdg-desktop-portal-gtk sudo pciutils mesa-utils libgl1-mesa-glx
%runscript
# Method 1: Ubuntu installs the steam executable under games.
#/usr/games/steam
# Method 2: Valve installs the steam executable in the standard /usr prefix.
/usr/bin/steam
%help
This container runs Steam with the newer libc used by Paradox to be able to run
Surviving Mars.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment