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

created functional Windows Bat and NVDiffrast windows compiler settings added #72

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Update Start_Windows.bat
adds a default conda installation, easier for dummys, using this it can install cuda version agnostic, and also makes a proper venv instead of docker which is prone to deployment issues
  • Loading branch information
waefrebeorn authored Apr 26, 2024
commit e0dcd0dbb4377f12fabcc29c704d0329e1886adb
23 changes: 22 additions & 1 deletion Start_Windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,32 @@
if not defined PYTHON (set PYTHON=python)
if not defined VENV_DIR (set "VENV_DIR=%~dp0%venv")
if not defined REQUIREMENTS_FILE (set "REQUIREMENTS_FILE=requirements.txt")
if not defined CONDA_URL (set "CONDA_URL=https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe")
if not defined CONDA_INSTALL_DIR (set "CONDA_INSTALL_DIR=%UserProfile%\miniconda3")

set ERROR_REPORTING=TRUE

mkdir tmp 2>NUL

where conda >tmp/stdout.txt 2>tmp/stderr.txt
if %ERRORLEVEL% == 0 goto :install_cuda

echo Conda not found. Installing Conda...
powershell -Command "Invoke-WebRequest -Uri '%CONDA_URL%' -OutFile 'miniconda_installer.exe'"
start /wait "" miniconda_installer.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%CONDA_INSTALL_DIR%
set "PATH=%CONDA_INSTALL_DIR%;%CONDA_INSTALL_DIR%\Scripts;%CONDA_INSTALL_DIR%\Library\bin;%PATH%"
del miniconda_installer.exe

:install_cuda
echo Installing CUDA using conda...
conda install -y cuda -c nvidia/label/cuda-12.1.0
if %ERRORLEVEL% == 0 (
echo CUDA installed successfully.
) else (
echo Failed to install CUDA using conda.
)

:install_requirements
%PYTHON% -c "" >tmp/stdout.txt 2>tmp/stderr.txt
if %ERRORLEVEL% == 0 goto :check_pip

Expand Down Expand Up @@ -77,7 +98,7 @@ type tmp\stdout.txt

:show_stderr
for /f %%i in ("tmp\stderr.txt") do set size=%%~zi
if %size% equ 0 goto :show_stderr
if %size% equ 0 goto :endofscript
echo.
echo stderr:
type tmp\stderr.txt
Expand Down