Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.

Difference between revisions of "Game Porting Toolkit"

From AppleGamingWiki, the wiki about gaming on M1 Apple silicon Macs
Line 241: Line 241:
 
=== steamwebhelper.exe crashes ===
 
=== steamwebhelper.exe crashes ===
 
This is caused by Steam being run through macOS Ventura or below, most users should upgrade to macOS Sonoma. You can use the CrossOver workaround to login to Steam but you'll experience constant crashing.
 
This is caused by Steam being run through macOS Ventura or below, most users should upgrade to macOS Sonoma. You can use the CrossOver workaround to login to Steam but you'll experience constant crashing.
 +
 +
=== Nothing loads after a crash ==
 +
Try closing all Wine threads:
 +
<pre>killall -9 wineserver && killall -9 wine64-preloader</pre>
  
 
=== Anti-cheat and DRM ===
 
=== Anti-cheat and DRM ===

Revision as of 06:54, 11 June 2023

Released 6th June, 2023 at WWDC23.
Released 6th June, 2023 at WWDC23.

Game Porting Toolkit is Apple's new translation layer released on 6th June, 2023. Game Porting Toolkit (GPT) combines Wine with Apple's own D3DMetal which supports DirectX 11 and 12[1]. This is less user-friendly method of installing Windows games on Apple Silicon Macs compared to CrossOver or Parallels, however it unlocks the ability to play many DirectX 12 games. A lot more games work using GPTK, however, games that use anti-cheat or aggressive DRMs generally don't work, along with games that require AVX/AVX 2, e.g. The Last of Us Part I.

Toolkit install instructions

Requirements

  • macOS Sonoma should be used, currently it is in beta. You can download the pkg installer from Mr Macintosh blog.
  • macOS Ventura causes large numbers of issues with steamwebhelper.exe crashing so it isn't recommended, use the macOS Sonoma beta.
  • Visit Apple Developer Downloads site, these files are now free to download use for any logged in Apple account.
    • Search for Command Line Tools for Xcode 15 beta and download the dmg file, then install it.
  • If you have an old version Xcode installed, remove it.
    • Search for Game Porting Toolkit and download it. Open the dmg file and then run the pkg.

Homebrew

Note: if you have ever installed Homebrew before, then it is advised to remove ARM64 Homebrew as this can interfere with this build process. Either use a Homebrew uninstall script or delete the folder /opt/homebrew/bin. If you prefer to keep both ARM64 and x86 versions of brew installed, you may add a "brew-switcher" to your .zshrc file to allow either version to be used depending on the active architecture. You may follow the steps at the end of this section after installing Brew to achieve this.

Open Terminal (search in Spotlight on macOS).

Install Rosetta:

softwareupdate --install-rosetta

Enter an x86_64 shell to continue the following steps in a Rosetta environment. All subsequent commands should be run within this shell.

arch -x86_64 zsh

Install the x86_64 version of Homebrew if you don't already have it.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Set the path:

(echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> /Users/$USER/.zprofile
eval "$(/usr/local/bin/brew shellenv)"

Make sure the brew command is on your path:

which brew

If this command does not print /usr/local/bin/brew, you should use this command:

export PATH=/usr/local/bin:${PATH}
Optionally retain both ARM64 and x86 versions of Brew

(Optional) If you want to have both ARM64 and x86 versions of Brew installed, begin by editing your .zshrc file:

nano ~/.zshrc

Scroll down (by using the arrow keys or Control + V) to the bottom of the file, and paste the following script:

if [ "$(arch)" = "arm64" ]; then
    eval "$(/opt/homebrew/bin/brew shellenv)"
else
    eval "$(/usr/local/bin/brew shellenv)"
fi

You may now restart your terminal and use the following command to return to an x86_64 shell:

arch -x86_64 zsh

Your shell will now select the right installation of Brew, depending on your architecture.

Build

Run this command to download Apple tap:

brew tap apple/apple http://github.com/apple/homebrew-apple

Install the game-porting-toolkit formula. This formula downloads and compiles several large software projects. How long this takes will depend on the speed of your computer. It can take over 1 hour to complete depending on the speed of your Mac.

brew -v install apple/apple/game-porting-toolkit

If during installation you see an error such as “Error: game-porting-toolkit: unknown or unsupported macOS version: :dunno”, your version of Homebrew doesn’t have macOS Sonoma support. Update to the latest version of Homebrew and try again.

brew update brew -v install apple/apple/game-porting-toolkit

Preparing the toolkit

Make sure the Game Porting Toolkit dmg downloaded earlier is mounted at /Volumes/Game Porting Toolkit-1.0. Use this script to copy the Game Porting Toolkit library directory into Wine’s library directory.

ditto /Volumes/Game\ Porting\ Toolkit-1.0/lib/ `brew --prefix game-porting-toolkit`/lib/

Put the 3 scripts from the Game Porting Toolkit DMG into here /usr/local/bin using this command:

cp /Volumes/Game\ Porting\ Toolkit*/gameportingtoolkit* /usr/local/bin

Wine prefix

A Wine prefix contains a virtual C: drive, similar to a Bottle in CrossOver. You will install the toolkit and your game into this virtual C: drive. Run the following command to create a new Wine prefix named my-game-prefix in your home directory. This will create a Wine prefix called my-game-prefix but could be renamed to anything.

WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 winecfg
  • A “Wine configuration” window should appear on your screen.
  • Change the version of Windows to Windows 10.
  • Choose Apply and then OK to exit winecfg.

If the “Wine configuration” window does not appear, and no new icon appears in the Dock, verify that you have correctly installed the x86_64 version of Homebrew as well as the game-porting-toolkit formula.

Now you are ready to install a launcher or individual Windows games into this Wine prefix, see below.

Steam

Download the Windows version of Steam and place in your Downloads folder.

Install Steam

gameportingtoolkit ~/my-game-prefix ~/Downloads/SteamSetup.exe

Run Steam

gameportingtoolkit ~/my-game-prefix 'C:\Program Files (x86)/Steam/steam.exe'

Log into Steam

A common issue is that Steam will present with a blank black window.

Alternate way of launching Steam (after installing):

MTL_HUD_ENABLED=1 WINEESYNC=1 WINEPREFIX=~/my-game-prefix /usr/local/Cellar/game-porting-toolkit/1.0/bin/wine64 'C:\Program Files (x86)\Steam\steam.exe'

If this continues then close the Terminal window and then re-open and try again, repeat until the login screen opens. Now you should be able to download and launch Windows games through Steam.

Battle.net

Download the Windows version of Battle.net and place in your Downloads folder.

Make a new Wineprefix for Battle.net, you can choose to use my-game-prefix or change this to anything else.

WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 winecfg
  • A “Wine configuration” window should appear on your screen.
  • Change the version of Windows to Windows 10.
  • Choose Apply and then OK to exit winecfg.

If you are running Diablo IV, then you need to run this script to update the Wineprefix to appear as a more recent version of Windows:

WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 reg add 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentBuild /t REG_SZ /d 19042 /f
WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 reg add 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentBuildNumber /t REG_SZ /d 19042 /f
WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wineserver -k

Run Battle.net launcher

gameportingtoolkit ~/my-game-prefix ~/Downloads/Battle.net-Setup.exe

Be aware that there is an issue launching Battle.net once installed, the only current way to re-login is to 'install' the launcher again.

Start individual game without the launcher using this command:

arch -x86_64 gameportingtoolkit-no-hud ~/my-game-prefix 'C:\Program Files (x86)\Diablo IV\Diablo IV Launcher.exe'

Epic and GOG.com support with the Heroic Games Launcher

This is particularly useful because as it currently stands, the real Epic Games Launcher fails to install under the Game Porting Toolkit. Heroic supports Epic and GOG.com games.

  • Install the native macOS Heroic Games Launcher or from Homebrew.
  • Open Heroic, and log into your Epic Games and/or GOG.com account.
  • Go to the "Wine Manager" and install a numbered version of Wine, such that it won't auto update- we are going to modify it.
    • At the time of writing this, the newest numbered version of Wine-Crossover is Wine-Crossover-Wine-22.1.0
  • Press the folder icon that appears after installing it to open the directory containing Heroic's Wine installations.
  • Right-click on the version of Wine you just installed and press "Show Package Contents".
  • Open this directory in the Terminal.
    • If you have "OpenInTerminal" this is one button, otherwise press "Show Path Bar" and navigate where it says with "cd".
    • It should be something like cd ~/Library/Application\ Support/heroic/tools/wine/Wine-crossover-wine-22.1.0.
  • cd Contents/MacOS
  • Remove the existing Wine:
    rm wine
  • Create a symlink to Game Porting Toolkit's Wine:
    • If using Game Porting Toolkit Wineprefix:
      ln -s `/usr/local/bin/brew --prefix game-porting-toolkit`/bin/wine64 wine
    • If using Whisky:
      ln -s /Applications/Whisky.app/Contents/Resources/Libraries/Wine/bin/wine64 wine
  • cd ../Resources
  • Remove the existing Wine:
    rm -rfv wine
  • Create a symlink to Game Porting Toolkit's Wine
    • If using Game Porting Toolkit Wineprefix:
      ln -s `/usr/local/bin/brew --prefix game-porting-toolkit` wine
    • If using Whisky:
      ln -s /Applications/Whisky.app/Contents/Resources/Libraries/Wine wine
  • We are now done with Terminal. Install any games you want to try playing.
  • Select the game you want to play, and press the settings button in the top-right.
  • Make sure the version of Wine you just downloaded and modified is selected.
  • Make sure your Game Porting Toolkit Wine Prefix is selected. If you followed Apple's guide this is /Users/$USER/my-game-prefix.
  • If you Open the "Other" section you can also add any environment variables you want like WINEESYNC=1" and "MTL_HUD_ENABLED=1"
  • Close the settings and try running the game.

Commands

Installing individual exe games: open your Wine prefix’s virtual C: drive in Finder (open ~/my-game-prefix/drive_c) and copy your game into an appropriate subdirectory.

A. Standard launching

gameportingtoolkit ~/my-game-prefix 'C:\Program Files (x86)\Steam\steam.exe'

This launches the given Windows game binary with a visible extended Metal Performance HUD and filters logging to output from the Game Porting Toolkit.

B. Launching without a HUD

gameportingtoolkit-no-hud ~/my-game-prefix 'C:\Program Files (x86)\Steam\steam.exe'

C. Launching with Wine ESYNC disabled

gameportingtoolkit-no-esync ~/my-game-prefix 'C:\Program Files (x86)\Steam\steam.exe'

To enter Winecfg:

gameportingtoolkit ~/my-game-prefix winecfg

Shortcut

Made by user Omsier.
Made by user Omsier.

You can make a shortcut for Steam for example by using macOS built-in Automator app.

  • Open Automator.
  • Select New Application.
  • In the 2nd column select Run Shell Script.
  • Copy and paste this code into the box:
#!/bin/zsh

export PATH="/usr/local/bin:${PATH}"

arch -x86_64 gameportingtoolkit ~/my-game-prefix 'C:\Program Files (x86)\Steam\steam.exe'
  • Save the shortcut somewhere e.g. Applications.
  • Above shortcut can be customised to any Wineprefix or game.
  • Add an icon by selecting the shortcut, pressing Command+I to Get Info, then dragging and dropping a PNG file onto the top left of the window.

Logging

The provided bin/gameportingtoolkit* scripts can be copied onto your path to facilitate different forms of logging and launching. You can run these scripts from any shell; you don’t need to switch to the Rosetta environment first.

Logging output will appear in the Terminal window in which you launch your game as well as the system log, which can be viewed with the Console app found in Applications ▸ Utilities. Log messages from the Game Porting Toolkit are prefixed with D3DM. By default the gameportingtoolkit* scripts will filter to just the D3DM-prefixed messages.

Troubleshooting

Steam login black screen

Steam login black screen issue.
Steam login black screen issue.
Alternate Steam launch command

Close the Terminal window and then reopen and retry the command, repeat several times.

Alternate way of launching Steam (after installing):

MTL_HUD_ENABLED=1 WINEESYNC=1 WINEPREFIX=~/my-game-prefix /usr/local/Cellar/game-porting-toolkit/1.0/bin/wine64 'C:\Program Files (x86)/Steam/steam.exe'

If still not working then try using CrossOver and create a Steam bottle, then login, then redirect this WINEPREFIX to that bottle:

WINEPREFIX="/Users/$USER/Library/Application Support/CrossOver/Bottles/Steam/" 
Use macOS Steam login[2]
  1. Login to Steam macOS.
  2. From /Users/$USER/Library/Application Support/Steam, copy three files/folders: config, registry.vdf, userdata.
  3. Paste into ~/my-game-prefix/drive_c/Program Files (x86)/Steam/

Steam crashes straight after opening

Disconnect external monitors[3]

Disconnect any external monitors.

Battle.net launcher won't re-launch

Re-install the launcher to reopen, no other fix at the moment.

Windows version too old

Name[4]

My game won’t run because it thinks the version of Windows is too old. Some games detect specific minimum versions of Windows and need to be updated. Use this script to update your wineprefix with build 19042 which should work for most games e.g. Spider-Man Remastered.

WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 reg add 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentBuild /t REG_SZ /d 19042 /f
WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 reg add 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentBuildNumber /t REG_SZ /d 19042 /f
WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wineserver -k

steamwebhelper.exe crashes

This is caused by Steam being run through macOS Ventura or below, most users should upgrade to macOS Sonoma. You can use the CrossOver workaround to login to Steam but you'll experience constant crashing.

= Nothing loads after a crash

Try closing all Wine threads:

killall -9 wineserver && killall -9 wine64-preloader

Anti-cheat and DRM

Likely there will be no fixes for any games that use anti-cheat, e.g. Easy Anti Cheat. Some games have workarounds e.g. Elden Ring. Other games that use say Denuvo may also be incompatible until that DRM is removed by the game's developer.

My game won’t run because it requires Mono, .NET, or the MSVCRT runtime

The game porting toolkit’s evaluation environment does not pre-install these runtime support packages. If your game makes use of one of these packages, consider searching for and downloading appropriate installers (.exe or .msi) and installing them to your evaluation environment. Additional runtime installers can be run on your environment by just launching the installer and following its installation instructions:

WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 <some-installer.exe>

And .MSI packages can be installed by launching the Windows uninstaller application and choosing to install a downloaded .msi package:

WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 uninstaller

Controller issues

Steam beta[5]

Issues may be fixed by enrolling into the Steam beta.

My game looks pixelated and the display resolution is limited

Enable Retina mode

Enable Retina (high resolution) mode:

WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 reg add 'HKEY_CURRENT_USER\Software\Wine\Mac Driver' /v RetinaMode /t REG_SZ /d 'Y' /f

Some games will not run with Retina mode enabled. To disable it:

WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 reg add 'HKEY_CURRENT_USER\Software\Wine\Mac Driver' /v RetinaMode /t REG_SZ /d 'N' /f

AVX

AVX and AVX2 games are not supported by Apple's arm64 chipset, e.g. Red Dead Redemption 2.

AVX requirement can be bypassed in some games, e.g Dying Light 2.

AVX Fix for Dying Light 2[6]

There is a workaround in Dying Light 2 which is to simply remove the "runtime_dx11.dll"

  1. Right click on DL2 on steam
  2. Manage
  3. Local files
  4. Navigate to "ph\work\bin\x64"
  5. Delete "runtime_dx11.dll"
  6. Start the game

If for some reason you need the "runtime_dx11.dll" back, just verify integrity of game files in Steam

Game compatibility list

Total number of games: 188
This list was last refreshed on November 23, 2024. Purge the page to refresh it.
Game Rating
7 Days to Die Perfect
Age of Empires II: Definitive Edition Playable
Age of Empires II: HD Edition Playable
Age of Mythology: Extended Edition Perfect
Age of Wonders 4 Runs
Aliens: Fireteam Elite Perfect
Among Us Playable
Annie and the Art Gallery Perfect
Astroneer Perfect
Batman Arkham Knight Perfect
Batman: Arkham Asylum Menu
Battlefield 3 Playable
Battlefield 5 Playable
BeamNG.drive Runs
BioShock Infinite Runs
Boson X Perfect
Bright Lights of Svetlov Playable
Brotato Perfect
Capcom Fighting Collection Perfect
Cities: Skylines II Playable
Clustertruck Perfect
Codename: Loop Perfect
Cogmind Perfect
Control Perfect
Counter-Strike 2 Perfect
Crime Scene Cleaner Perfect
Cult Of The Lamb Perfect
Cuphead Perfect
Cyberpunk 2077 Perfect
Dark Souls Remastered Perfect
Days Gone Playable
Dead Space Perfect
Deadlock Perfect
Definitely Not Fried Chicken Perfect
Deus Ex Runs
Diablo II Perfect
Diablo IV Perfect
Disco Elysium Perfect
Dishonored Playable
DRAFTYCAR Runs
DREDGE Perfect
Dying Light Perfect
Elden Ring Perfect
Elite: Dangerous Playable
EVE Online Perfect
Everspace 2 Perfect
F1 2020 Perfect
Fallout 4 Playable
Fallout Shelter Perfect
Fallout: New Vegas Playable
Farthest Frontier Playable
FIFA 22 Menu
Final Fantasy VII Remake Intergrade Perfect
Final Fantasy XIV Perfect
Final Fantasy XV Perfect
Firewatch Perfect
Floating Point Perfect
Freeways Perfect
Genshin Impact Perfect
Geometry Dash Perfect
Ghost of Tsushima Director's Cut Perfect
Ghostrunner Playable
Ghostwire tokyo Menu
God of War Playable
Grand Theft Auto V Perfect
Grim Dawn Perfect
GTFO Playable
Guild Wars 2 Perfect
Guilty Gear Strive Perfect
Gunfire Reborn Perfect
Half-Life 2 Perfect
Halo 3 Playable
Halo: Reach Perfect
Hatsune Miku: Project DIVA Mega Mix+ Perfect
Hellblade: Senua's Sacrifice Playable
Heroes of Might and Magic III Perfect
High On Life Perfect
Hitman 3 Playable
Hogwarts Legacy Perfect
Horizon zero dawn Perfect
Hot Wheels Unleashed Perfect
Hotline Miami Playable
House flipper 2 Perfect
It Takes Two Playable
Jazz Jackrabbit 2 Perfect
Jected - Rivals Playable
Journey Perfect
Just Cause 4 Menu
Killer7 Perfect
Kingdom Come: Deliverance Playable
L.A. Noire Runs
Left 4 Dead 2 Playable
Lego Star Wars: The Skywalker Saga Perfect
Lethal Company Perfect
Magicite Perfect
Manor Lords Perfect
Marvel’s Spider-Man Remastered Playable
Mass Effect Legendary Edition Perfect
Mass Effect: Andromeda Playable
Master of Olympus: Zeus Gold (AKA: Zeus + Poseidon) Playable
Max Payne Runs
Metal Gear Solid V: The Phantom Pain Playable
METALLIC CHILD Perfect
Metro 2033 Redux Perfect
Muck Perfect
My Hero Ultra Rumble Perfect
NASCAR 21: Ignition Menu
NASCAR Heat 5 Runs
Necromunda: Hired Gun Playable
NieR: Automata Perfect
Noita Perfect
One piece odessey Perfect
Osu! Perfect
Outer Wilds Playable
Paladins Perfect
Palia Perfect
Palworld Perfect
Parkasaurus Perfect
Party animals Perfect
Path of Exile Perfect
Pathologic 2 Runs
Penumbra Overture Playable
Persona 3 Reload Perfect
Persona 5 Tactica Perfect
Planet of Lana Perfect
PlateUp! Perfect
Portal Playable
Portal 2 Playable
Potion Craft: Alchemist Simulator Perfect
PowerWash Simulator Perfect
Project Zomboid Perfect
Raft Perfect
Ready or Not Perfect
Remnant: From the Ashes Perfect
Resident Evil 2 (2019) Playable
Resident Evil 3 (2020) Playable
Risk of Rain 2 Perfect
Risk of Rain Returns Playable
Rocket League Playable
ROUNDS Perfect
S.T.A.L.K.E.R.: Shadow of Chernobyl Perfect
Sable Perfect
Satisfactory Playable
Scarlet Nexus Playable
Sekiro: Shadows Die Twice Playable
Shadow Tactics: Blades of the Shogun Menu
Slime Rancher Perfect
Slime Rancher 2 Perfect
Sniper: Ghost Warrior Contracts Menu
Sniper: Ghost Warrior Contracts 2 Menu
Soul Calibur 6 Playable
Space Engineers Menu
Spore Playable
Spyro Reignited Trilogy Playable
Star Trek Online Playable
Star Wars Episode I: Racer Playable
Star Wars Jedi: Fallen Order Perfect
Super Hexagon Playable
System Shock: Enhanced Edition Perfect
Team Fortress 2 Perfect
Teardown Playable
Tell Me Why Perfect
Tetris Effect: Connected Playable
The Elder Scrolls IV: Oblivion Runs
The Elder Scrolls V: Skyrim Special Edition Perfect
The Escapists 2 Perfect
The Evil Within Perfect
The Evil Within 2 Perfect
The Forest Perfect
The Karters 2: Turbo Charged Perfect
The Sims 4 Perfect
The Stanley Parable: Ultra Deluxe Playable
The Witcher Playable
The Witcher 3 Playable
This Bed We Made Perfect
Thumper Perfect
Tomb Raider I-III Remastered Perfect
Torchlight II Runs
Train Simulator 2021 Perfect
Ultimate Fishing Simulator Perfect
Valheim Playable
Vampyr Playable
Warhammer 40,000: Boltgun Playable
Wattam Runs
Wreckfest Playable
XIII Perfect
Yakuza 0 Perfect
Yu-Gi-Oh! Duel Links Perfect


Old list - this should be made into individual wiki articles in order to populate the automated list above, which tracks all game compatibility methods using Wine.

Working games:

Not working well:

Not working yet:


References