mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Do not install CUDA in Windows if GPU is AMD
This commit is contained in:
+11
-1
@@ -263,8 +263,15 @@ 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 if torch is installed with CUDA support
|
:: Check if torch is installed with CUDA support
|
||||||
echo Checking CUDA availability...
|
echo Checking CUDA availability...
|
||||||
|
if /I "%GPU_VENDOR%"=="nvidia" (
|
||||||
for /f %%i in ('%PYTHON_CONSOLE_PATH% -c "from torch.cuda import is_available; print(is_available())"') do set cuda_available=%%i
|
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" (
|
if "%cuda_available%"=="False" (
|
||||||
@@ -277,7 +284,10 @@ if "%cuda_available%"=="False" (
|
|||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
echo CUDA is available.
|
echo CUDA is available on NVIDIA GPU.
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
echo Non-NVIDIA GPU detected (%GPU_VENDOR%). Skipping PyTorch CUDA installation.
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Ask user if they want to create a desktop shortcut
|
:: Ask user if they want to create a desktop shortcut
|
||||||
|
|||||||
Reference in New Issue
Block a user