Skip to content

Commit

Permalink
Allow direct download of the install script from docs website
Browse files Browse the repository at this point in the history
  • Loading branch information
BillHuang2001 committed Jan 15, 2025
1 parent ed710e7 commit a674f46
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 1 deletion.
97 changes: 97 additions & 0 deletions docs/source/_static/win-install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
@echo off
setlocal enabledelayedexpansion

REM Check NVIDIA driver version
set "use_cpu=N"
where nvidia-smi > nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] NVIDIA driver not found. Please install the latest NVIDIA driver first from https://www.nvidia.com/drivers/.
echo Do you want install torch cpu version instead? ^(Y/N, default N^)
set /p use_cpu=">> "
if "!use_cpu!"=="" set "use_cpu=N"
if /i "!use_cpu!"=="Y" (
goto Continue
) else (
exit /b 1
)
)

for /f "tokens=1* delims=," %%A in ('nvidia-smi --query-gpu=driver_version --format="csv,noheader"') do (
echo [INFO] Detect installed NVIDIA driver version: %%A. Make sure the latest NVIDIA driver is installed from https://www.nvidia.com/drivers/
)

:Continue
@REM setlocal DisableDelayedExpansion
@REM echo %use_cpu%
REM check winget is installed
where winget > nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] winget is not installed. This usually happens on LTSC and Server OS. Please manually install winget from https://github.com/microsoft/winget-cli, then reopen this script.
pause
exit /b 1
)

REM Check if VS Code is installed
where code > nul 2>&1
if %errorlevel% neq 0 (
echo [INFO] VSCode is not found. Downloading Visual Studio Code installer...
winget install -e --id Microsoft.VisualStudioCode
) else (
echo [INFO] VSCode is already installed. Skip
)

REM Checking if Git is installed
where git > nul 2>&1
if %errorlevel% neq 0 (
echo [INFO] Git is not found. Downloading Git installer...
winget install -e --id Git.Git
) else (
echo [INFO] Git is already installed. Skip
)



REM Install Miniforge3 (example using curl)
@REM where conda > nul 2>&1
echo [INFO] Downloading Miniforge...
if not exist "%UserProfile%\miniforge3" (
curl -L -o Miniforge3-Windows-x86_64.exe https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe
if exist Miniforge3-Windows-x86_64.exe (
echo [INFO] Installing Miniforge on %UserProfile%\miniforge3
start /wait Miniforge3-Windows-x86_64.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%UserProfile%\miniforge3
)
) else (
echo [INFO] Miniforge is already installed. Skip
)


REM Temp activate conda

call %UserProfile%\miniforge3\Scripts\activate.bat %UserProfile%\miniforge3
call mamba info
echo [INFO] Installing EvoX packages...
call conda env list | findstr "evox-zoo" >nul
if %ERRORLEVEL%==0 (
echo Environment evox-zoo already exists. Removing...
call conda env remove -n evox-zoo -y
)
call mamba create -n evox-zoo python=3.10 -y
call mamba activate evox-zoo
pip install numpy jupyterlab
if /i "!use_cpu!"=="Y" (
pip install torch
) else (
pip install torch --index-url https://download.pytorch.org/whl/cu124
)
pip install "evox>=1.0.0a1"
REM Download some demo
mkdir %UserProfile%\evox-demo
@REM curl -L -o %UserProfile%\evox-demo\custom_algo_prob.ipynb https://raw.githubusercontent.com/EMI-Group/evox/refs/heads/evoxtorch-main/docs/source/example/custom_algo_prob.ipynb
git clone --depth 1 https://github.com/EMI-Group/evox.git %UserProfile%\evox-demo\evox
xcopy %UserProfile%\evox-demo\evox\docs\source\example\custom_algo_prob.ipynb %UserProfile%\evox-demo /E /I /Y
start code %UserProfile%\evox-demo

echo Reboot is highly recommended to apply the changes.

pause
:: ...existing code...
2 changes: 1 addition & 1 deletion docs/source/guide/install/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ There are two ways to use PyTorch with GPU acceleration on Windows:
1. Using WSL 2 (Windows Subsystem for Linux) and install PyTorch on the Linux side.
2. Directly install PyTorch on Windows.

We also provide a <a href="https://raw.githubusercontent.com/EMI-Group/evox/refs/tags/latest-release/win-install.bat" download="win-install.bat">one-click script</a> for fast deployment on fresh installed windows 10/11 64bit with Nvidia GPUs. The script will not use WSL 2 and will install the native Pytorch version on Windows. It will automatically install related applications like VSCode, Git and MiniForge3.
We also provide a [one-click script](/_static/win-install.bat) for fast deployment on fresh installed windows 10/11 64bit with Nvidia GPUs. The script will not use WSL 2 and will install the native Pytorch version on Windows. It will automatically install related applications like VSCode, Git and MiniForge3.

* Ensure the [Nvidia driver](https://www.nvidia.com/Download/index.aspx?lang=en-us) is properly installed first. Otherwise the script will fall back to cpu mode.
* When running the script, ensure a stable network (accessible to `github.com` etc.).
Expand Down

0 comments on commit a674f46

Please sign in to comment.