Experimenting with the Proton compatibility tool for Steam Play based on Wine and additional components for use with running Nintendo Switch games better on suyu and, as well as to test implementing in suyuOS more generally so it can become the ultimate gaming OS.
Find a file
2018-11-30 08:55:08 -06:00
.github/ISSUE_TEMPLATE Adjust Whitelist template 2018-11-16 12:55:47 -06:00
build Work around old mingw-w64 2018-11-30 08:52:48 -06:00
cmake@c4ab098097 makefile_base.mak: Implement makefile-based build system 2018-10-11 08:31:51 -05:00
dxvk@afe51131b1 Work around old mingw-w64 2018-11-30 08:52:48 -06:00
FAudio@6dda63ee5b Use FAudio for xaudio2 2018-11-19 14:33:03 -06:00
ffmpeg@ace829cb45 Add ffmpeg submodule at 4.0 and ship it 2018-05-31 12:30:43 -05:00
fonts Build replacement fonts 2018-10-31 07:48:33 -05:00
glslang Add glslang binary 2018-02-12 08:08:53 -06:00
lsteamclient lsteamclient: For relative paths, only fix up backslashes 2018-11-30 08:52:48 -06:00
openal-soft@ce6076091b Add openal-soft submodule at version 1.18.2 2018-03-08 12:52:57 -06:00
openvr@1fb1030f2a openvr: Update to v1.0.17 2018-10-31 07:48:33 -05:00
vrclient_x64 vrclient: Fix IVRRenderModels usage 2018-11-05 11:25:28 -06:00
wine@ce7cacbbf7 update wine 2018-11-30 08:52:48 -06:00
.gitignore gitignore: ignore build intermediates 2018-10-17 19:23:16 -07:00
.gitmodules Use FAudio for xaudio2 2018-11-19 14:33:03 -06:00
compatibilitytool.vdf.template fix namespace collision for multiple proton installs 2018-10-13 00:27:52 -07:00
configure.sh Shellcheck fixes for configure.sh and steamrt-bootstrap.sh 2018-11-16 12:54:56 -06:00
dist.LICENSE Remove ffmpeg from license 2018-11-16 12:56:52 -06:00
filelock.py proton: Lock on write access to the dist/ directory 2018-03-16 11:37:27 -05:00
LICENSE Update license info 2018-04-19 12:52:55 -05:00
LICENSE.proton Update LICENSE.proton 2018-05-01 09:30:59 -05:00
proton proton: Recreate Fonts directory if it somehow goes missing 2018-11-30 08:55:08 -06:00
proton_3.7_tracked_files proton: Track prefix files and remove them on a major proton version change 2018-10-12 08:30:19 -05:00
README.md Document Vagrant usage 2018-11-19 14:33:03 -06:00
steamrt-bootstrap.sh Shellcheck fixes for configure.sh and steamrt-bootstrap.sh 2018-11-16 12:54:56 -06:00
toolmanifest.vdf proton: Change waitforexit to waitforexitandrun 2018-08-08 08:01:55 -05:00
user_settings.sample.py proton: Use DXVK for d3d10 as well. 2018-10-16 09:44:32 -05:00
vagrant-user-setup.sh Document Vagrant usage 2018-11-19 14:33:03 -06:00
Vagrantfile Document Vagrant usage 2018-11-19 14:33:03 -06:00

Introduction
Introduction

Proton is a tool for use with the Steam client which allows games which are exclusive to Windows to run on the Linux operating system. It uses Wine to facilitate this.

Most users will prefer to use Proton provided by the Steam client itself. The source code is provided to enable advanced users the ability to alter Proton. For example, some users may wish to use a different version of Wine with a particular title.


Getting Started with Proton from Steam Play


Obtaining Proton from source

NOTE: If you are not comfortable in a command line terminal, or if you find any of the information presented in here strange and uncomfortable, then this is probably not for you. The instructions are likely to be incomplete and require some knowledge and skill on your part, and there is no warranty or guarantee that anyone will help you with this process.

We strongly recommend that most users use the production build of Proton.

The most current source for Proton is here: https://github.com/ValveSoftware/Proton

Which you can clone to your system with this command:

    git clone https://github.com/ValveSoftware/Proton.git proton

After cloning the Proton git repository, the next step will be to obtain the various submodules that go into building Proton:

    cd proton
    git submodule update --init

If you wish to change any subcomponent, now is the time to do so. For example, if you wish make changes to Wine, you would apply those changes to the wine/ directory.


Building

At a high level, the build instructions are:

  1. Set up your build environment
  2. Configure the build
  3. Build Proton
  4. Install Proton locally (optional)

See below for more details on all of these steps. Please read all of the instructions before proceeding.


Set up the build environment

Proton has a lot of build-time dependencies. The following instructions describe how we create the build environment for the production builds of Proton. For reproducibility and security reasons, we will be setting up a Debian 9 virtual machine. However, you should be able to follow these instructions on other distributions as well.

Proton provides a Vagrantfile, which will automatically set up the Debian 9 VM for you. After installing Vagrant, initialize the VM by running from within the Proton directory:

    vagrant up

It will take a long time to download and install the Steam runtime containers and so on. Eventually it will complete. You can SSH into the virtual machine with:

    vagrant ssh

The Vagrantfile is set up to rsync the proton directory into the VM on boot, and it will create a build directory in $HOME that is ready for you to run make. On the host machine, you can use vagrant rsync-auto to have Vagrant automatically sync changes on your host machine into the build machine. It is recommended that you make changes on your host machine, and then perform the build in the VM. Any changes you make in the proton directory on the VM may be overwritten by later rsync updates from the host machine.

The Vagrantfile also creates a directory called vagrant_share in the proton directory of your host machine, which is mounted at /vagrant within the VM. You can use this shared folder to move your Proton build out of the VM, or as one way to copy files into the VM.

If you do not wish to use Vagrant, you can reference Vagrantfile and vagrant-user-setup.sh for the list of dependencies and instructions on how to set up your own machine or another VM of your choosing.

When you are done with the VM, you can shut it down from the host machine:

    vagrant halt

Please read the Vagrant documentation for more information about how to use Vagrant VMs.


Alternative: Building without the Steam Runtime

The Steam Runtime provides a clean and consistent set of libraries. Software distributed through Steam should depend only on libraries available through the runtime, and so we build in that environment for production Proton builds. The Vagrantfile described above will set this up for you. However, if you are simply making a build for yourself, you may want to skip setting up the Steam runtime, as it takes a very long time to set up. To do this, edit the vagrant-user-setup.sh script appropriately before running vagrant up.


Configure the build

After setting up the build system, it is time to run the configure script which will generate the Makefile to build your project. The Vagrantfile is set up to do this automatically for you in a directory called $HOME/build within the VM. If you are configuring manually, run these steps:

    mkdir proton/mybuild/
    cd proton/mybuild
    ../configure.sh --steam-runtime64=docker:steam-proton-dev --steam-runtime32=docker:steam-proton-dev32

If you are building without the Steam runtime, then instead use:

    ../configure.sh --no-steam-runtime

Tip: If you are building without the Steam runtime, you should now run make obj-wine64/Makefile obj-wine32/Makefile and check the files obj-wine64/config.log and obj-wine32/config.log for missing packages. Search for won't be supported. A couple of missing packages are normal: opencv, gstreamer, vkd3d, oss. More than that may indicate a problem. Please see your distro's documentation to acquire the considerable build dependencies for Wine.


Build Proton

A couple of Makefile targets are provided. make dist will create a Proton installation that you can install locally with make install. make deploy will package Proton up for distribution via Steamworks.

The dist/ folder now contains a build of Proton which you can install manually or with make install to install into your user's Steam installation. See the next section for more details.


Install Proton locally

Steam ships with several versions of Proton, which games will use by default or that you can select in Steam Settings's SteamPlay page. Steam also supports running games with local builds of Proton, which you can install on your machine. The install target will perform the below steps for you.

To install a local build of Proton into Steam, make a new directory in ~/.steam/steam/compatibilitytools.d/ with a tool name of your choosing and place the contents of dist into that folder. The make install target will perform this task for you, installing the Proton build into the Steam folder for the current user. You will have to restart the Steam client for it to pick up on a new tool.

A correct local tool installation should look like this:

    compatibilitytools.d/my_proton/
    ├── compatibilitytool.vdf
    ├── filelock.py
    ├── LICENSE
    ├── proton
    ├── proton_dist.tar.gz
    ├── toolmanifest.vdf
    ├── user_settings.sample.py
    └── version

Each component of this software is used under the terms of their licenses. See the LICENSE files here, as well as the LICENSE, COPYING, etc files in each submodule and directory for details. If you distribute a built version of Proton to other users, you must adhere to the terms of these licenses.


Runtime Config Options

Proton can be tuned at runtime to help certain games run. The Steam client sets some options for known games using the STEAM_COMPAT_CONFIG variable. You can override these options using the environment variables described below. The best way to set these environment overrides for all games is by renaming user_settings.sample.py to user_settings.py and modifying it appropriately. If you want to change the runtime configuration for a specific game, you can use the Set Launch Options setting in the game's Properties dialog in the Steam client. You can launch the game as you would with "PROTON_VARIABLE=1 %command%" (source).

To enable an option, set the variable to a non-0 value. To disable an option, set the variable to 0. To use Steam's default configuration, do not specify the variable at all.

All of the below are runtime options. They do not effect permanent changes to the Wine prefix. Removing the option will revert to the previous behavior.

Compat config string Environment Variable Description
PROTON_LOG Convenience method for dumping a useful debug log to $HOME/steam-$APPID.log. For more thorough logging, use user_settings.py.
PROTON_DUMP_DEBUG_COMMANDS When running a game, Proton will write some useful debug scripts for that game into $PROTON_DEBUG_DIR/proton_$USER/.
PROTON_DEBUG_DIR Root directory for the Proton debug scripts, /tmp by default.
wined3d PROTON_USE_WINED3D Use OpenGL-based wined3d instead of Vulkan-based DXVK for d3d11 and d3d10. This used to be called PROTON_USE_WINED3D11, which is now an alias for this same option.
nod3d11 PROTON_NO_D3D11 Disable d3d11.dll, for games which can fall back to and run better with d3d9.
noesync PROTON_NO_ESYNC Do not use eventfd-based in-process synchronization primitives.