mirror of
https://github.com/facefusion/facefusion.git
synced 2026-05-12 18:32:18 +02:00
remove has methods
This commit is contained in:
@@ -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'
|
||||
|
||||
+2
-10
@@ -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] = []
|
||||
|
||||
Reference in New Issue
Block a user