Fixed [WinError 1114] A dynamic link library (DLL) initialization routine failed, Potential fix for CUDA GPU is not available

This commit is contained in:
Deniz Şafak
2025-10-30 12:52:46 +03:00
parent 4b175c7cf2
commit afbd5203fe
5 changed files with 31 additions and 5 deletions
+6
View File
@@ -257,6 +257,12 @@ def calculate_text_length(text):
def get_gpu_acceleration(enabled):
"""
Check GPU acceleration availability.
Note: On Windows, torch DLLs must be pre-loaded in main.py before PyQt6
to avoid DLL initialization errors.
"""
try:
import torch
from torch.cuda import is_available as cuda_available