Update GPU check logic

This commit is contained in:
Deniz Şafak
2025-05-20 04:11:17 +03:00
parent 814c171a90
commit 578da66f34
3 changed files with 23 additions and 25 deletions
+11 -3
View File
@@ -230,13 +230,22 @@ if errorlevel 1 (
:: Install setup requirements
echo Installing setup requirements...
%PYTHON_CONSOLE_PATH% -m pip install --upgrade setuptools wheel sphinx hatchling --no-warn-script-location
%PYTHON_CONSOLE_PATH% -m pip install --upgrade setuptools setuptools-scm wheel sphinx hatchling --no-warn-script-location
if errorlevel 1 (
echo Failed to install setup requirements.
pause
exit /b
)
:: Install gpustat
echo Installing gpustat...
%PYTHON_CONSOLE_PATH% -m pip install gpustat --no-warn-script-location
if errorlevel 1 (
echo Failed to install gpustat.
pause
exit /b
)
:: Install project and dependencies from pyproject.toml
echo Checking and installing project dependencies...
if exist %PYPROJECT_FILE% (
@@ -264,8 +273,7 @@ if "%MISAKI_LANG%" NEQ "en" (
)
:: Check for NVIDIA GPU via is_nvidia()
for /f %%i in ('%PYTHON_CONSOLE_PATH% -c "from abogen.utils import is_nvidia; print(is_nvidia())"') do set IS_NVIDIA=%%i
echo NVIDIA GPU detected: %IS_NVIDIA%
for /f %%i in ('%PYTHON_CONSOLE_PATH% -c "from abogen.is_nvidia import check; print(check())"') do set IS_NVIDIA=%%i
:: Check if torch is installed with CUDA support
echo Checking CUDA availability...