-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathupdate-runtime-directml.cmd
86 lines (69 loc) · 2.42 KB
/
update-runtime-directml.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
@echo off
cd /d "%~dp0"
SET MAMBA_ROOT_PREFIX=%~dp0conda
echo %MAMBA_ROOT_PREFIX%
if exist "%MAMBA_ROOT_PREFIX%\condabin\micromamba.bat" (
echo Deleting micromamba.exe as its out of date
del micromamba.exe
if errorlevel 1 (
echo Error: Failed to delete micromamba.exe. Please delete it manually.
exit /b 1
)
echo Deleting the conda directory as its out of date
rmdir /s /q conda
if errorlevel 1 (
echo Error: Failed to delete the conda directory. Please delete it manually.
exit /b 1
)
)
:Check if micromamba is already installed
if exist micromamba.exe goto Isolation
curl.exe -L -o micromamba.exe https://github.com/mamba-org/micromamba-releases/releases/latest/download/micromamba-win-64
:Isolation
SET CONDA_SHLVL=
SET PYTHONNOUSERSITE=1
SET PYTHONPATH=
echo %MAMBA_ROOT_PREFIX%
setlocal EnableDelayedExpansion
for %%a in (%*) do (
if /I "%%a"=="--hordelib" (
set hordelib=true
) else (
set hordelib=
)
if /I "%%a"=="--scribe" (
set scribe=true
) else (
set scribe=
)
)
endlocal
if defined scribe (
SET CONDA_ENVIRONMENT_FILE=environment_scribe.yaml
) else (
SET CONDA_ENVIRONMENT_FILE=environment.rocm.yaml
)
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v "LongPathsEnabled" /t REG_DWORD /d "1" /f 2>nul
:We do this twice the first time to workaround a conda bug where pip is not installed correctly the first time - Henk
IF EXIST CONDA GOTO WORKAROUND_END
.\micromamba.exe create --no-shortcuts -r conda -n windows -f %CONDA_ENVIRONMENT_FILE% -y
:WORKAROUND_END
.\micromamba.exe create --no-shortcuts -r conda -n windows -f %CONDA_ENVIRONMENT_FILE% -y
REM Check if hordelib argument is defined
micromamba.exe shell hook -s cmd.exe %MAMBA_ROOT_PREFIX% -v
call "%MAMBA_ROOT_PREFIX%\condabin\mamba_hook.bat"
call "%MAMBA_ROOT_PREFIX%\condabin\mamba.bat" activate windows
python -s -m pip install torch-directml torchvision==0.19.1
if defined hordelib (
python -s -m pip uninstall -y hordelib horde_engine horde_model_reference
python -s -m pip install horde_engine horde_model_reference
) else (
if defined scribe (
python -s -m pip install -r requirements-scribe.txt
) else (
python -s -m pip install -r requirements.directml.txt
)
)
call deactivate
echo If there are no errors above everything should be correctly installed (If not, try deleting the folder /conda/envs/ and try again).
pause