diff --git a/facefusion/execution.py b/facefusion/execution.py index b5a02de6..2b3ea0e2 100644 --- a/facefusion/execution.py +++ b/facefusion/execution.py @@ -113,11 +113,11 @@ def resolve_cache_path() -> str: def resolve_cudnn_conv_algo_search(execution_providers : List[ExecutionProvider]) -> str: - execution_devices = detect_static_graphic_devices(tuple(execution_providers)) + graphic_devices = detect_static_graphic_devices(tuple(execution_providers)) product_names = ('GeForce GTX 1630', 'GeForce GTX 1650', 'GeForce GTX 1660') - for execution_device in execution_devices: - if execution_device.get('product').get('name').startswith(product_names): + for graphic_device in graphic_devices: + if graphic_device.get('product').get('name').startswith(product_names): return 'DEFAULT' return 'EXHAUSTIVE' diff --git a/facefusion/system.py b/facefusion/system.py index ab4171eb..95af94ec 100644 --- a/facefusion/system.py +++ b/facefusion/system.py @@ -29,21 +29,13 @@ def detect_static_graphic_devices(execution_providers : Tuple[ExecutionProvider, def detect_graphic_devices(execution_providers : Tuple[ExecutionProvider, ...]) -> List[GraphicDevice]: - if has_amd_execution_provider(execution_providers): + if 'rocm' in execution_providers or 'migraphx' in execution_providers: return detect_amd_graphic_devices() - if has_nvidia_execution_provider(execution_providers): + if 'cuda' in execution_providers or 'tensorrt' in execution_providers: return detect_nvidia_graphic_devices() return [] -def has_amd_execution_provider(execution_providers : Tuple[ExecutionProvider, ...]) -> bool: - return 'rocm' in execution_providers or 'migraphx' in execution_providers - - -def has_nvidia_execution_provider(execution_providers : Tuple[ExecutionProvider, ...]) -> bool: - return 'cuda' in execution_providers or 'tensorrt' in execution_providers - - def detect_nvidia_graphic_devices() -> List[GraphicDevice]: pynvml = importlib.import_module('pynvml') graphic_devices : List[GraphicDevice] = []