Update GPU detection logic

This commit is contained in:
Deniz Şafak
2025-05-20 03:32:29 +03:00
parent b3b420beec
commit 814c171a90
2 changed files with 25 additions and 32 deletions
+5 -7
View File
@@ -263,15 +263,13 @@ if "%MISAKI_LANG%" NEQ "en" (
)
)
:: Check GPU vendor
echo Checking GPU vendor...
set GPU_VENDOR=unknown
for /f %%i in ('%PYTHON_CONSOLE_PATH% -c "from abogen.utils import get_gpu_vendor; print(get_gpu_vendor())"') do set GPU_VENDOR=%%i
echo GPU Vendor: %GPU_VENDOR%
:: 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%
:: Check if torch is installed with CUDA support
echo Checking CUDA availability...
if /I "%GPU_VENDOR%"=="nvidia" (
if /I "%IS_NVIDIA%"=="true" (
for /f %%i in ('%PYTHON_CONSOLE_PATH% -c "from torch.cuda import is_available; print(is_available())"') do set cuda_available=%%i
if "%cuda_available%"=="False" (
@@ -287,7 +285,7 @@ if /I "%GPU_VENDOR%"=="nvidia" (
echo CUDA is available on NVIDIA GPU.
)
) else (
echo Non-NVIDIA GPU detected (%GPU_VENDOR%). Skipping PyTorch CUDA installation.
echo GPU is not NVIDIA. Skipping PyTorch CUDA installation.
)
:: Ask user if they want to create a desktop shortcut