Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GPU selector to install script #493

Open
wants to merge 1 commit into
base: united
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 114 additions & 66 deletions install_requirements.bat
Original file line number Diff line number Diff line change
@@ -1,66 +1,114 @@
@echo off
title KoboldAI Runtime Installer (MicroMamba)

echo Errors? Rerun this as admin so it can add the needed LongPathsEnabled registery tweak.
echo Installer failed or crashed? Run it again so it can continue.
echo Only Windows 10 and higher officially supported, older Windows installations can't handle the paths.
echo.

Reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v "LongPathsEnabled" /t REG_DWORD /d "1" /f 2>nul
cd /D %~dp0

:Isolation
call conda deactivate 2>NUL
set Path=%windir%\system32;%windir%;C:\Windows\System32\Wbem;%windir%\System32\WindowsPowerShell\v1.0\;%windir%\System32\OpenSSH\
SET CONDA_SHLVL=
SET PYTHONNOUSERSITE=1
SET PYTHONPATH=

if exist miniconda3\ (
echo Delete existing installation?
echo This is required if you are switching modes, or if you get dependency errors in the game.
echo 1. Yes
echo 2. No
SET /P D=Type the number of the desired option and then press ENTER:
) ELSE (
SET D=Workaround
)
IF %D%==1 rmdir /s /q miniconda3

:Mode
echo Which installation mode would you like?
echo 1. Temporary Drive Letter (Mounts the folder as drive B:, more stable and portable)
echo 2. Subfolder (Traditional method, can't run in folder paths that contain spaces)
echo.
SET /P M=Type the number of the desired option and then press ENTER:
IF %M%==1 GOTO drivemap
IF %M%==2 GOTO subfolder
ECHO Incorrect choice
GOTO MODE


:drivemap
echo 3 > loader.settings
subst B: /D >nul
mkdir miniconda3
subst B: miniconda3
copy umamba.exe B:\umamba.exe
copy loader.settings B:\loader.settings
copy disconnect-kobold-drive.bat B:\disconnect-kobold-drive.bat
B:
umamba.exe create -r B:\python\ -n base
umamba.exe install --no-shortcuts -r B:\python\ -n base -f "%~dp0\environments\huggingface.yml" -y --always-copy
umamba.exe -r B:\ clean -a -y
rd B:\Python\pkgs /S /Q
subst B: /d
pause
exit

:subfolder
echo 2 > loader.settings
umamba.exe create -r miniconda3\ -n base
umamba.exe install --no-shortcuts -r miniconda3 -n base -f environments\huggingface.yml -y --always-copy
umamba.exe clean -a -y
rd miniconda3\Python\pkgs /S /Q
pause
exit
@echo off
title KoboldAI Runtime Installer (MicroMamba)

echo Errors? Rerun this as admin so it can add the needed LongPathsEnabled registery tweak.
echo Installer failed or crashed? Run it again so it can continue.
echo Only Windows 10 and higher officially supported, older Windows installations can't handle the paths.
echo.

Reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v "LongPathsEnabled" /t REG_DWORD /d "1" /f 2>nul
cd /D %~dp0

:Isolation
call conda deactivate 2>NUL
set Path=%windir%\system32;%windir%;C:\Windows\System32\Wbem;%windir%\System32\WindowsPowerShell\v1.0\;%windir%\System32\OpenSSH\
SET CONDA_SHLVL=
SET PYTHONNOUSERSITE=1
SET PYTHONPATH=

if exist miniconda3\ (
echo Delete existing installation?
echo This is required if you are switching modes/GPU vendors, or if you get dependency errors in the game.
echo 1. Yes
echo 2. No
SET /P D=Type the number of the desired option and then press ENTER:
) ELSE (
SET D=Workaround
)
IF %D%==1 rmdir /s /q miniconda3

:GPU
echo Which GPU do you have?
echo 1. NVIDIA
echo 2. Intel
echo.
SET /P M=Type the number of the desired option and then press ENTER:
IF %M%==1 GOTO Mode
IF %M%==2 GOTO Mode-ipex
ECHO Incorrect choice
GOTO GPU

:Mode
echo Which installation mode would you like?
echo 1. Temporary Drive Letter (Mounts the folder as drive B:, more stable and portable)
echo 2. Subfolder (Traditional method, can't run in folder paths that contain spaces)
echo.
SET /P M=Type the number of the desired option and then press ENTER:
IF %M%==1 GOTO drivemap
IF %M%==2 GOTO subfolder
ECHO Incorrect choice
GOTO MODE

:Mode-ipex
echo Which installation mode would you like?
echo 1. Temporary Drive Letter (Mounts the folder as drive B:, more stable and portable)
echo 2. Subfolder (Traditional method, can't run in folder paths that contain spaces)
echo.
SET /P M=Type the number of the desired option and then press ENTER:
IF %M%==1 GOTO drivemap-ipex
IF %M%==2 GOTO subfolder-ipex
ECHO Incorrect choice
GOTO MODE-IPEX


:drivemap
echo 3 > loader.settings
subst B: /D >nul
mkdir miniconda3
subst B: miniconda3
copy umamba.exe B:\umamba.exe
copy loader.settings B:\loader.settings
copy disconnect-kobold-drive.bat B:\disconnect-kobold-drive.bat
B:
umamba.exe create -r B:\python\ -n base
umamba.exe install --no-shortcuts -r B:\python\ -n base -f "%~dp0\environments\huggingface.yml" -y --always-copy
umamba.exe -r B:\ clean -a -y
rd B:\Python\pkgs /S /Q
subst B: /d
pause
exit

:drivemap-ipex
echo 3 > loader.settings
subst B: /D >nul
mkdir miniconda3
subst B: miniconda3
copy umamba.exe B:\umamba.exe
copy loader.settings B:\loader.settings
copy disconnect-kobold-drive.bat B:\disconnect-kobold-drive.bat
B:
umamba.exe create -r B:\python\ -n base
umamba.exe install --no-shortcuts -r B:\python\ -n base -f "%~dp0\environments\ipex.yml" -y --always-copy
umamba.exe -r B:\ clean -a -y
rd B:\Python\pkgs /S /Q
subst B: /d
pause
exit

:subfolder
echo 2 > loader.settings
umamba.exe create -r miniconda3\ -n base
umamba.exe install --no-shortcuts -r miniconda3 -n base -f environments\huggingface.yml -y --always-copy
umamba.exe clean -a -y
rd miniconda3\Python\pkgs /S /Q
pause
exit

:subfolder-ipex
echo 2 > loader.settings
umamba.exe create -r miniconda3\ -n base
umamba.exe install --no-shortcuts -r miniconda3 -n base -f environments\ipex.yml -y --always-copy
umamba.exe clean -a -y
rd miniconda3\Python\pkgs /S /Q
pause
exit