For the sake of your sanity, use Busybox for Windows so that you have a normal, native shell environment instead of PowerShell or cmd.exe. You can save Busybox as C:/Windows/sh.exe, then execute it from a command prompt using sh -ilX.
Clone this repository, apply this patch and build:
# installs visual studio build tools if you do not already have it
# requires chocolatey
choco install -y visualstudio2022buildtools
choco install -y visualstudio2022-workload-vctools
# activates vcvars aka puts the compilation tools on the path
cmd /c 'C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\AUXILI~1\Build\VCVARS~1.BAT amd64 & busybox sh -ilX'
git clone https://github.com/NVIDIA/apex.git
cd apex
git checkout 810ffae374a2b9cb4b5c5e28eaeca7d7998fca0c
curl -L "https://github.com/NVIDIA/apex/files/14844602/windows_support.patch" | git apply
python -m venv venv
source venv/scripts/activate
pip install packaging wheel
export DISTUTILS_USE_SDK=1
pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" --config-settings "--build-option=--deprecated_fused_adam" ./
Change install to wheel if you need an installable wheel to put into your repo. Then, add this to your requirements.txt if your wheel is located at the root of your repo:
For example, if you built for Python 3.11 like I did:
apex @ {root:uri}/apex-0.1-cp311-cp311-win_amd64.whl ;platform_system == 'Windows' and python_version == '3.11'
Tested on Python 3.11
For the sake of your sanity, use Busybox for Windows so that you have a normal, native shell environment instead of
PowerShell
orcmd.exe
. You can save Busybox asC:/Windows/sh.exe
, then execute it from a command prompt usingsh -ilX
.The patch: windows_support.patch
The wheel for Python 3.11: apex-0.1-cp311-cp311-win_amd64.whl.zip
Clone this repository, apply this patch and build:
Change
install
towheel
if you need an installable wheel to put into your repo. Then, add this to yourrequirements.txt
if your wheel is located at the root of your repo:For example, if you built for Python 3.11 like I did:
pip
understands{root:uri}
.Take care to enable the options you need.
Patch: