Introduce resolve_cudnn_conv_algo_search
This commit is contained in:
@@ -36,7 +36,7 @@ def create_inference_session_providers(execution_device_id : str, execution_prov
|
||||
inference_session_providers.append((facefusion.choices.execution_provider_set.get(execution_provider),
|
||||
{
|
||||
'device_id': execution_device_id,
|
||||
'cudnn_conv_algo_search': 'DEFAULT' if is_geforce_16_series() else 'EXHAUSTIVE'
|
||||
'cudnn_conv_algo_search': resolve_cudnn_conv_algo_search()
|
||||
}))
|
||||
if execution_provider == 'tensorrt':
|
||||
inference_session_providers.append((facefusion.choices.execution_provider_set.get(execution_provider),
|
||||
@@ -68,6 +68,17 @@ def create_inference_session_providers(execution_device_id : str, execution_prov
|
||||
return inference_session_providers
|
||||
|
||||
|
||||
def resolve_cudnn_conv_algo_search() -> str:
|
||||
execution_devices = detect_static_execution_devices()
|
||||
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):
|
||||
return 'DEFAULT'
|
||||
|
||||
return 'EXHAUSTIVE'
|
||||
|
||||
|
||||
def resolve_openvino_device_type(execution_device_id : str) -> str:
|
||||
if execution_device_id == '0':
|
||||
return 'GPU'
|
||||
@@ -76,13 +87,6 @@ def resolve_openvino_device_type(execution_device_id : str) -> str:
|
||||
return 'GPU.' + execution_device_id
|
||||
|
||||
|
||||
def is_geforce_16_series() -> bool:
|
||||
execution_devices = detect_static_execution_devices()
|
||||
product_names = ('GeForce GTX 1630', 'GeForce GTX 1650', 'GeForce GTX 1660')
|
||||
|
||||
return any(execution_device.get('product').get('name').startswith(product_names) for execution_device in execution_devices)
|
||||
|
||||
|
||||
def run_nvidia_smi() -> subprocess.Popen[bytes]:
|
||||
commands = [ shutil.which('nvidia-smi'), '--query', '--xml-format' ]
|
||||
return subprocess.Popen(commands, stdout = subprocess.PIPE)
|
||||
|
||||
Reference in New Issue
Block a user