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
(69 intermediate revisions by 20 users not shown)
Line 1: Line 1:
Game Porting Toolkit is Apple's new translation layer which combines Wine with Apple's own D3DMetal which supports DirectX 9-12. Games that use anti-cheat or aggressive DRM generally don't work. Games that require AVX CPUs also do not work e.g. Last of Us.
+
{{Image|Game Porting Toolkit.png|Released 6th June, 2023 at WWDC23.}}
  
Working games:
+
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<ref>{{Refurl|url=https://mastodon.gamedev.place/@gavkar/110501451404624870|title=Gokhan Avkarogullari: "@yiningkarlli @aras @romainguy…" - Gamedev Mastodon}}</ref>. 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.
* Cyberpunk 2077
 
* Elden Ring
 
* SpongeBob SquarePants: The Cosmic Shake
 
* Diablo IV [https://www.reddit.com/r/macgaming/comments/14307be/comment/jn7dxzo/?utm_source=reddit&utm_medium=web2x&context=3 ]
 
* Hogwarts Legacy
 
* Deep Rock Galactic
 
* Sonic Omens
 
* Sonic P-06
 
* Scarlet Nexus
 
* Dyson Sphere Program (some objects and main character weren't visible before)
 
* Derail Valley (awesome performance, no missing manuals - in-game objects for train operation - like on CrossOver)
 
* Spider-Man (2018)
 
* Spider-Man Miles Morales - ''requires Windows ver fix''
 
* Warframe - ''To get installer/launcher working add dwrite (disabled) to library overrides in winecfg''
 
* Deep Rock Galactic
 
* HI-Fi RUSH
 
* QUBE 2
 
 
 
Not working well:
 
* Horizon Zero Dawn - slowdown issues
 
  
=== Toolkit install instructions ===
+
== Toolkit install instructions ==
==== Requirements ====
+
=== Requirements ===
 
*macOS Sonoma should be used, currently it is in beta. You can download the pkg installer from [https://mrmacintosh.com/macos-sonoma-full-installer-database-download-directly-from-apple/ Mr Macintosh blog].
 
*macOS Sonoma should be used, currently it is in beta. You can download the pkg installer from [https://mrmacintosh.com/macos-sonoma-full-installer-database-download-directly-from-apple/ Mr Macintosh blog].
 
*macOS Ventura causes large numbers of issues with steamwebhelper.exe crashing so it isn't recommended, use the macOS Sonoma beta.
 
*macOS Ventura causes large numbers of issues with steamwebhelper.exe crashing so it isn't recommended, use the macOS Sonoma beta.
 +
**If you have an old version Xcode installed, remove it.
 
*Visit [https://developer.apple.com/downloads Apple Developer Downloads site], these files are now free to download use for any logged in Apple account.
 
*Visit [https://developer.apple.com/downloads 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.
 
**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.
 
**Search for Game Porting Toolkit and download it. Open the dmg file and then run the pkg.
  
==== Homebrew ====
+
=== Homebrew ===
Note: if you have ever installed Homebrew before, then it is advisable to remove arm64 Homebrew as this can interfere with this build process. Either use a Homebrew uninstall script or delete the folder <code>/opt/homebrew/bin</code>.
+
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 <code>/opt/homebrew/bin</code>. If you prefer to keep both ARM64 and x86 versions of brew installed, you may add a "brew-switcher" to your <code>.zshrc</code> 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).
 
Open Terminal (search in Spotlight on macOS).
Line 52: Line 32:
 
<pre>export PATH=/usr/local/bin:${PATH}</pre>
 
<pre>export PATH=/usr/local/bin:${PATH}</pre>
  
==== Build ====
+
{{Fixbox|description=Optionally retain both ARM64 and x86 versions of Brew|ref=|collapsed=yes|fix=
 +
(Optional) If you want to have both ARM64 and x86 versions of Brew installed, begin by editing your <code>.zshrc</code> file:
 +
<pre>nano ~/.zshrc</pre>
 +
 
 +
Scroll down (by using the arrow keys or Control + V) to the bottom of the file, and paste the following script:
 +
<pre>
 +
if [ "$(arch)" = "arm64" ]; then
 +
    eval "$(/opt/homebrew/bin/brew shellenv)"
 +
else
 +
    eval "$(/usr/local/bin/brew shellenv)"
 +
fi
 +
</pre>
 +
 
 +
You may now restart your terminal and use the following command to return to an x86_64 shell:
 +
<pre>arch -x86_64 zsh</pre>
 +
Your shell will now select the right installation of Brew, depending on your architecture.
 +
}}
 +
 
 +
=== Build ===
 
Run this command to download Apple tap:
 
Run this command to download Apple tap:
 
<pre>brew tap apple/apple http://github.com/apple/homebrew-apple</pre>
 
<pre>brew tap apple/apple http://github.com/apple/homebrew-apple</pre>
Line 62: Line 60:
 
<pre>brew update brew -v install apple/apple/game-porting-toolkit</pre>
 
<pre>brew update brew -v install apple/apple/game-porting-toolkit</pre>
  
==== Wine prefix ====
+
===Wine prefix ===
 
A Wine prefix contains a virtual C: drive. 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.
 
A Wine prefix contains a virtual C: drive. 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.
 
<pre>WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 winecfg</pre>
 
<pre>WINEPREFIX=~/my-game-prefix `brew --prefix game-porting-toolkit`/bin/wine64 winecfg</pre>
Line 71: Line 69:
 
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.
 
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.
  
==== Preparing the 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.
 
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.
 
<pre>ditto /Volumes/Game\ Porting\ Toolkit-1.0/lib/ `brew --prefix game-porting-toolkit`/lib/</pre>
 
<pre>ditto /Volumes/Game\ Porting\ Toolkit-1.0/lib/ `brew --prefix game-porting-toolkit`/lib/</pre>
Line 78: Line 76:
 
<pre>cp /Volumes/Game\ Porting\ Toolkit*/gameportingtoolkit* /usr/local/bin</pre>
 
<pre>cp /Volumes/Game\ Porting\ Toolkit*/gameportingtoolkit* /usr/local/bin</pre>
  
==== Steam install ====
+
Now you are ready to install a launcher or individual Windows games, see below.
Go to Steam website and download the Windows version of Steam: https://cdn.cloudflare.steamstatic.com/client/installer/SteamSetup.exe and place in your Downloads folder.
+
 
 +
== Steam ==
 +
Download the [https://cdn.cloudflare.steamstatic.com/client/installer/SteamSetup.exe Windows version of Steam] and place in your Downloads folder.
  
 
'''Install Steam'''
 
'''Install Steam'''
Line 88: Line 88:
  
 
'''Log into Steam'''
 
'''Log into Steam'''
 +
 
A common issue is that Steam will present with a blank black window.
 
A common issue is that Steam will present with a blank black window.
  
 
Alternate way of launching Steam (after installing):
 
Alternate way of launching Steam (after installing):
 
<pre>
 
<pre>
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'
+
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'
 
</pre>
 
</pre>
  
 
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.
 
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.
  
==== Launching individual game ====
+
== Battle.net ==
Open your Wine prefix’s virtual C: drive in Finder (open ~/my-game-prefix/drive_c) and copy your game into an appropriate subdirectory.
+
Download the [https://download.battle.net/en-gb/?platform=windows Windows version of Battle.net].
 +
 
 +
Make a new Wineprefix for Battle.net - we will refer to this as battle-net from now:
 +
<pre>WINEPREFIX=~/battle-net `brew --prefix game-porting-toolkit`/bin/wine64 winecfg</pre>
 +
*A “Wine configuration” window should appear on your screen.
 +
*Change the version of Windows to <code>Windows 10</code>.
 +
*Choose Apply and then OK to exit winecfg.
 +
 
 +
'''Run Battle.net launcher'''
 +
<pre>gameportingtoolkit ~/battle-net ~/Downloads/Battle.net-Setup.exe</pre>
 +
 
 +
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:
 +
<pre>arch -x86_64 gameportingtoolkit-no-hud ~/battle-net 'C:\Program Files (x86)\Diablo IV\Diablo IV Launcher.exe'</pre>
 +
 
 +
== Epic and GOG.com support ==
 +
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 [https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases 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 <code>Wine-Crossover-Wine-22.1.0</code>
 +
* 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 <code>cd ~/Library/Application\ Support/heroic/tools/wine/Wine-crossover-wine-22.1.0</code>.
 +
* <pre>cd Contents/MacOS</pre>
 +
* Remove the existing Wine: <pre>rm wine</pre>
 +
* Create a symlink to Game Porting Toolkit's Wine:
 +
** If using Game Porting Toolkit Wineprefix: <pre>ln -s `/usr/local/bin/brew --prefix game-porting-toolkit`/bin/wine64 wine</pre>
 +
** If using Whisky: <pre>ln -s /Applications/Whisky.app/Contents/Resources/Libraries/Wine/bin/wine64 wine</pre>
 +
* <pre>cd ../Resources</pre>
 +
* Remove the existing Wine: <pre>rm -rfv wine</pre>
 +
* Create a symlink to Game Porting Toolkit's Wine
 +
** If using Game Porting Toolkit Wineprefix: <pre>ln -s `/usr/local/bin/brew --prefix game-porting-toolkit` wine</pre>
 +
** If using Whisky: <pre>ln -s /Applications/Whisky.app/Contents/Resources/Libraries/Wine wine</pre>
 +
* 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 <code>/Users/you/my-game-prefix</code>.
 +
* If you Open the "Other" section you can also add any environment variables you want like <code>WINEESYNC=1"</code> and <code>"MTL_HUD_ENABLED=1"</code>
 +
* 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'''
 
'''A. Standard launching'''
<pre>gameportingtoolkit ~/my-game-prefix 'C:\Program Files\MyGame\MyGame.exe'</pre>
+
<pre>gameportingtoolkit ~/my-game-prefix 'C:\Program Files (x86)\Steam\steam.exe'</pre>
  
 
This launches the given Windows game binary with a visible extended Metal Performance HUD and filters logging to output from the Game Porting Toolkit.
 
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'''
 
'''B. Launching without a HUD'''
<pre>gameportingtoolkit-no-hud ~/my-game-prefix 'C:\Program Files\MyGame\MyGame.exe'</pre>
+
<pre>gameportingtoolkit-no-hud ~/my-game-prefix 'C:\Program Files (x86)\Steam\steam.exe'</pre>
  
 
'''C. Launching with Wine ESYNC disabled'''
 
'''C. Launching with Wine ESYNC disabled'''
<pre>gameportingtoolkit-no-esync ~/my-game-prefix 'C:\Program Files\MyGame\MyGame.exe'</pre>
+
<pre>gameportingtoolkit-no-esync ~/my-game-prefix 'C:\Program Files (x86)\Steam\steam.exe'</pre>
 +
 
 +
To enter Winecfg:
 +
<pre>gameportingtoolkit ~/my-game-prefix winecfg</pre>
 +
 
 +
== Shortcut ==
 +
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:
 +
<pre>
 +
#!/bin/zsh
 +
 
 +
export PATH="/usr/local/bin:${PATH}"
  
=== Logging ===
+
arch -x86_64 gameportingtoolkit ~/my-game-prefix 'C:\Program Files (x86)\Steam\steam.exe'
 +
</pre>
 +
*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 {{key|cmd|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.
 
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.
 
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 ===
+
== Troubleshooting ==
 +
{{Image|GPTK Steam black screen.png|Steam login black screen issue.}}
 
'''Steam login black screen'''
 
'''Steam login black screen'''
  
Line 126: Line 194:
 
</pre>
 
</pre>
  
If still not working then try using [[CrossOver]] and create a Steam bottle, then redirect this WINEPREFIX to that bottle:
+
If still not working then try using [[CrossOver]] and create a Steam bottle, then login, then redirect this WINEPREFIX to that bottle:
 
<pre>
 
<pre>
 
WINEPREFIX="/Users/[username]/Library/Application Support/CrossOver/Bottles/Steam/"  
 
WINEPREFIX="/Users/[username]/Library/Application Support/CrossOver/Bottles/Steam/"  
Line 139: Line 207:
 
Re-install the launcher to reopen, no other fix at the moment.
 
Re-install the launcher to reopen, no other fix at the moment.
  
'''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.
+
'''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.
 
<pre>
 
<pre>
 
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 CurrentBuild /t REG_SZ /d 19042 /f
Line 148: Line 216:
 
'''steamwebhelper.exe crashes'''
 
'''steamwebhelper.exe crashes'''
  
This is caused by Steam being run through macOS Ventura or below, upgrade to macOS Sonoma.
+
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.
  
 
'''My game won't run and crashes with an invalid instruction'''
 
'''My game won't run and crashes with an invalid instruction'''
  
Invalid instruction crashes are often (but not always) caused when Rosetta 2 is unable to translate AVX/AVX2 instructions. You may be able to recompile a version of your game without AVX/AVX2 instructions in order to evaluate its potential on Apple Silicon with the Game Porting Toolkit when you hit this error. When porting your code natively to Apple Silicon, NEON instructions are a high-performance replacement for AVX/AVX2.
+
AVX and AVX2 games are not supported by Apple's arm64 chipset.
  
 
'''My game won't run because its anti-cheat or DRM software is incompatible with Wine translation.'''
 
'''My game won't run because its anti-cheat or DRM software is incompatible with Wine translation.'''
  
You may be able to rebuild a custom version of your game in your Windows development environment with anti-cheat or DRM disabled for your own evaluation purposes. When porting your code natively to Apple Silicon and macOS, contact your anti-cheat or DRM provider—most have native Apple Silicon solutions for your native build.
+
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.'''
 
'''My game won’t run because it requires Mono, .NET, or the MSVCRT runtime.'''
Line 173: Line 241:
  
 
Issues may be fixed by enrolling into the Steam beta.
 
Issues may be fixed by enrolling into the Steam beta.
Enrolling into Steam beta
+
 
 +
'''My game looks pixelated and the display resolution is limited'''
 +
 
 +
Enable Retina (high resolution) mode:
 +
<pre>
 +
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
 +
</pre>
 +
Some games will not run with Retina mode enabled. To disable it:
 +
<pre>
 +
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
 +
</pre>
 +
 
 +
== Game compatibility list ==
 +
Working games:
 +
* Bloodstained: Ritual of the Night
 +
* Control (DX12 mode, if downloaded from Heroic, needs to be ran by Terminal)
 +
* Crysis Remastered
 +
* Cuphead
 +
* Cyberpunk 2077
 +
* Deep Rock Galactic
 +
* Deceive Inc. - works well if launched without EAC
 +
* Derail Valley (awesome performance, no missing manuals - in-game objects for train operation - like on CrossOver)
 +
* Diablo IV [https://www.reddit.com/r/macgaming/comments/14307be/comment/jn7dxzo/?utm_source=reddit&utm_medium=web2x&context=3 ]
 +
* Dyson Sphere Program (some objects and main character weren't visible before)
 +
* Elden Ring
 +
* Final Fantasy VII Remake Intergrade (~50 FPS on High settings at 1080p with M1 Pro)
 +
* God of War (Works somewhat well on M1 Pro (16gb), wouldn't recommend lesser hardware.)
 +
* Going Medieval
 +
* Guilty Gear Strive
 +
* Halo 3 (MCC - No Online due to Easy Anti-Cheat Compatibility) [https://www.reddit.com/r/macgaming/comments/143zoos/halo_3_mcc_no_online_eac_m1_pro_game_porting/]
 +
* HI-Fi RUSH
 +
* Hogwarts Legacy
 +
* Hatsune Miku: Project DIVA Mega Mix+ - works with Retina mode; DivaModLoader and DivaNoSpy recommended; run Steam with WINEDEBUG=-all WINEESYNC=0 WINEDLLOVERRIDES="dinput8.dll=n,b"; may randomly crash at the title screen (just restart and try again until it works)
 +
* Kena: Bridge of Spirits
 +
* Metal Gear Solid V: The Phantom Pain
 +
* Overwatch 2
 +
* QUBE 2
 +
* Risk of Rain 2 (does not require `-disable-gpu-skinning` like Crossover 22)
 +
* Scarlet Nexus
 +
* Sonic Omens
 +
* Sonic P-06
 +
* Spider-Man (2018)
 +
* Spider-Man Miles Morales - ''requires Windows ver fix''
 +
* SpongeBob SquarePants: The Cosmic Shake
 +
* StarCraft: Remastered - Game runs fine but opening Option menu the second time will cause game not recognizing any inputs.
 +
* Tetris Effect: Connected - Game window likes to be uncooperative; really doesn't like retina mode, works otherwise
 +
* Warframe - ''To get installer/launcher working add dwrite (disabled) to library overrides in winecfg''
 +
 
 +
Not working well:
 +
* Horizon Zero Dawn - slowdown issues
 +
 
 +
Not working yet:
 +
* Among Us
 +
* Company of Heroes 3
 +
* F1 22 - Crash on launch (  "Exception": "C0000005 EXCEPTION_ACCESS_VIOLATION at 0000000141bd8687")
 +
* Halo Infinite - Crash on launch
 +
* Hitman 3 - launcher works, crash at 0x0000014136dddd hitman3+0x136dddd: int $3
 +
* Microsoft Flight Simulator 2020 (Steam) - Crash on launch
 +
* Monster Hunter Rise - DX12 Game, it launches but window goes dark after compiling shaders.
 +
* Monster Hunter World - Black Screen on Launch
 +
* Red Dead Redemption 2
 +
* Rogue Company - anti-cheat conflict.
 +
* Sea of Thieves - Launches, but the prompt to sign into an xbox live account appears blank and cannot
 +
* Many (all?) DX9 games
 +
** 30XX - "Failed to create D3D device" -> crash on launch; this is a rare 64-bit DX9 game
 +
** Killing Floor 1 - Crash on launch
 +
** Left 4 Dead 2 - Black screen -> crash on launch
 +
** Mega Man Zero/ZX Legacy Collection - "Failed to create d3d9 device" -> crash on launch
 +
** Sonic Mania - Crash on launch
 +
** StarCraft II -> "Failed to initialize DirectX" error
 +
** Battlefield 2 - DirectX installation failed, won't launch, see the [https://gist.github.com/chrismwendt/1d01a306cdc8618a06bdfb555743e25c error log]
 +
 
 +
 
 +
{{References}}

Revision as of 22:01, 8 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.
    • If you have an old version Xcode installed, remove it.
  • 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.
    • 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)"

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

Wine prefix

A Wine prefix contains a virtual C: drive. 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.

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.

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

Now you are ready to install a launcher or individual Windows games, 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.

Make a new Wineprefix for Battle.net - we will refer to this as battle-net from now:

WINEPREFIX=~/battle-net `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.

Run Battle.net launcher

gameportingtoolkit ~/battle-net ~/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 ~/battle-net 'C:\Program Files (x86)\Diablo IV\Diablo IV Launcher.exe'

Epic and GOG.com support

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/you/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

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 issue.
Steam login black screen issue.

Steam login black screen

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=<path to the Wine bottle you set up> /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/[username]/Library/Application Support/CrossOver/Bottles/Steam/" 

Steam crashes straight after opening

Disconnect any external monitors.

Battle.net launcher won't re-launch

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

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.

My game won't run and crashes with an invalid instruction

AVX and AVX2 games are not supported by Apple's arm64 chipset.

My game won't run because its anti-cheat or DRM software is incompatible with Wine translation.

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

Issues may be fixed by enrolling into the Steam beta.

My game looks pixelated and the display resolution is limited

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

Game compatibility list

Working games:

  • Bloodstained: Ritual of the Night
  • Control (DX12 mode, if downloaded from Heroic, needs to be ran by Terminal)
  • Crysis Remastered
  • Cuphead
  • Cyberpunk 2077
  • Deep Rock Galactic
  • Deceive Inc. - works well if launched without EAC
  • Derail Valley (awesome performance, no missing manuals - in-game objects for train operation - like on CrossOver)
  • Diablo IV [1]
  • Dyson Sphere Program (some objects and main character weren't visible before)
  • Elden Ring
  • Final Fantasy VII Remake Intergrade (~50 FPS on High settings at 1080p with M1 Pro)
  • God of War (Works somewhat well on M1 Pro (16gb), wouldn't recommend lesser hardware.)
  • Going Medieval
  • Guilty Gear Strive
  • Halo 3 (MCC - No Online due to Easy Anti-Cheat Compatibility) [2]
  • HI-Fi RUSH
  • Hogwarts Legacy
  • Hatsune Miku: Project DIVA Mega Mix+ - works with Retina mode; DivaModLoader and DivaNoSpy recommended; run Steam with WINEDEBUG=-all WINEESYNC=0 WINEDLLOVERRIDES="dinput8.dll=n,b"; may randomly crash at the title screen (just restart and try again until it works)
  • Kena: Bridge of Spirits
  • Metal Gear Solid V: The Phantom Pain
  • Overwatch 2
  • QUBE 2
  • Risk of Rain 2 (does not require `-disable-gpu-skinning` like Crossover 22)
  • Scarlet Nexus
  • Sonic Omens
  • Sonic P-06
  • Spider-Man (2018)
  • Spider-Man Miles Morales - requires Windows ver fix
  • SpongeBob SquarePants: The Cosmic Shake
  • StarCraft: Remastered - Game runs fine but opening Option menu the second time will cause game not recognizing any inputs.
  • Tetris Effect: Connected - Game window likes to be uncooperative; really doesn't like retina mode, works otherwise
  • Warframe - To get installer/launcher working add dwrite (disabled) to library overrides in winecfg

Not working well:

  • Horizon Zero Dawn - slowdown issues

Not working yet:

  • Among Us
  • Company of Heroes 3
  • F1 22 - Crash on launch ( "Exception": "C0000005 EXCEPTION_ACCESS_VIOLATION at 0000000141bd8687")
  • Halo Infinite - Crash on launch
  • Hitman 3 - launcher works, crash at 0x0000014136dddd hitman3+0x136dddd: int $3
  • Microsoft Flight Simulator 2020 (Steam) - Crash on launch
  • Monster Hunter Rise - DX12 Game, it launches but window goes dark after compiling shaders.
  • Monster Hunter World - Black Screen on Launch
  • Red Dead Redemption 2
  • Rogue Company - anti-cheat conflict.
  • Sea of Thieves - Launches, but the prompt to sign into an xbox live account appears blank and cannot
  • Many (all?) DX9 games
    • 30XX - "Failed to create D3D device" -> crash on launch; this is a rare 64-bit DX9 game
    • Killing Floor 1 - Crash on launch
    • Left 4 Dead 2 - Black screen -> crash on launch
    • Mega Man Zero/ZX Legacy Collection - "Failed to create d3d9 device" -> crash on launch
    • Sonic Mania - Crash on launch
    • StarCraft II -> "Failed to initialize DirectX" error
    • Battlefield 2 - DirectX installation failed, won't launch, see the error log


References