Steamworks Documentation
Developing for SteamOS and Linux

Linux Overview

Steam for Linux is now available to all Steam users. With a growing catalog of Linux-supported games and an active Steam for Linux community group, it's a good time to port your game to Linux.

Developing a Linux game for Steam can be challenging for developers coming from a Windows or macOS development background. The following information will help you successfully port your game to Steam for Linux.

Getting Started

Building your game on Linux requires the following:

  • A development machine running a fully-updated version of Linux. This can be a dual-boot machine, a dedicated Linux machine, or even a virtual machine running Linux. In addition, development is supported on both 32- and 64-bit Linux distributions. The recommended Linux distribution is the latest Ubuntu LTS release as they received the most testing by Valve and the linux community. Ubuntu can be installed from here.
  • The Steam for Linux client.
  • The basic Linux development tool set (e.g. g++, gcc, and a make utility); contained in the build-essential package. Install this package either by using Ubuntu Software Center or from an open terminal window with the apt-get command: sudo apt-get install build-essential.
  • The latest version of the Steam Linux Runtime which includes the tools and a complete set of libraries required to ship Linux games on Steam. Instructions on how to use the runtime are included in the README.md contained within the repository.

If you have general Linux Steamworks questions or to report issues with the runtime, please join the Steamworks Development Group and post on the Linux Discussions .

Linux Tools

There is a vast array of Linux development tools ranging from command-line interfaces to graphical developer IDEs. The following information is based on the experience of the Valve Linux team.

For those with Windows development tool experience, the easiest route to Linux development is Visual Studio on Windows and WinGDB - a Visual C++ extension that allows debugging of remote Linux processes, using the Visual Studio debugging interface.

For development on Linux, the following tools were used by the Valve Linux team:
  • QtCreator - a debugger and IDE with familiar Visual Studio key bindings.
  • SlickEdit - provides a basic, configurable GUI with user-defined key bindings.
  • gdb - a popular command-line debugger.
  • cgdb - a wrapper of gdb that provides a split-screen view of the current location in source code during execution.
  • Eclipse - another IDE that can be configured for Linux development. Available on Windows,
    macOS, and Linux.
  • vim - a basic command-line text editor.

The following debugging and tracing tools have been used by the Valve Linux team:
  • QtCreator - see above.
  • Symbol Servers
  • PerfStudio - a fully-featured, frame-based debugger with support
    for API-tracing for games running on AMD graphics cards. Available on Windows.
  • Telemetry - a fully-featured profiler for games running on graphics cards. Available on
    Linux, Windows, and macOS.
  • gDEBugger - a debugger that debugs, profiles, and analyzes OpenGL code. Active development has shifted to
    CodeXL.
  • perf - a command-line tool with various performance features. Available on Linux.
  • NVIDIA Nsight - an extension for Visual Studio for debugging games running
    on Nvidia graphics cards.
  • lTTng - a Linux tracing tool
  • apitrace project - a set of tools for tracing and replaying OpenGL and OpenGL ES calls from your game
  • Zoom - a CPU profiler with a powerful and friendly user interface

Linux APIs

Vulkan is the prefered library for high-performance graphics rendering. It is the open equivalent to DirectX12 and Metal.

OpenGL was the older standard graphics rendering. A majority of games make direct calls to OpenGL but there are other games that use a translation method where legacy rendering code is translated into OpenGL calls. This is the approach used by older Valve Source games such as Team Fortress 2 and Counter-Strike: Source. If you choose OpenGL then we recommend using the core functionality in OpenGL 3.0 for your game.

Simple DirectMedia Layer (SDL) version 2.0 provides low-level access to audio and windowing, amongst many other things. Support for 3D rendering is provided using OpenGL. Installation instructions can be found here. For more information and documentation, see the SDL wiki. Valve uses this in Steam and most of our games to handle windowing and it provides the backend which powers the Steam Input API.

The following libraries provide support for other aspects of game development:
  • FreeType - font rendering (both vector-based and bitmap fonts) on Linux
  • Fontconfig - configuring and customizing font access
  • Miles Sound System - a middleware sound engine for Linux development
  • Bink Video - a video codec designed for game developers
  • WebM - an open media file format; used for recording Team Fortress 2 video instead of QuickTime.

GitHub Repositories

The following repositories are public and used for projects related to Steam for Linux:
  • steam-for-linux - contains content for the Steam for Linux client and the bug tracker for the Linux Steam client
  • steam-runtime - contains the Steam Linux Runtime project. The purpose is to provide a stable runtime environment for the development of Steam Linux games.

    Frequently Asked Questions

    Q: My Linux game has multiple external library dependencies. How do I solve this problem?
    A: Many popular libraries such as SDL, OpenAL, FreeType and Fontconfig are all included in the Steam Linux Runtime for your convenience. If you have other external library dependencies which are not in the runtime and are freely redistributable, please bring it up on the Linux & SteamOS Steamworks Development Discussions board.

    Q: Is there Steam DRM for Linux?
    A: Yes! The new drmtoolp DRM tool includes linux support. See Steam DRM for more information.

    Q: How does driver performance compare between Ubuntu and Windows?
    A: Proprietary Nvidia drivers are comparable to Windows in terms of stability, performance, and features. Proprietary drivers for both AMD and Intel are also available but their current performance and stability are lower than equivalent Windows drivers.

    In terms of Linux performance, it differs depending on the video card and driver type being used, e.g. such as open-source vs. proprietary. Typically, proprietary drivers out-perform open-source drivers and have a larger feature set. In addition, the age of the driver can vary between proprietary and open-source versions.

    Q: The Steam Overlay won't work when launching from outside of Steam.
    A: On Linux you must set the LD_PRELOAD environment variable to load the gameoverlayrenderer.so

    This will look something like:
    export LD_PRELOAD=~/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so;~/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so

    Q: What runtime should I use for testing my Linux build?
    A: The recommended Linux distribution is the latest Ubuntu LTS release as it receives the most testing by Valve and the Linux community. Ubuntu can be installed from here.