From 98d5a3c7325bd4c2448d3992d957bcf1d1d2a04f Mon Sep 17 00:00:00 2001 From: Kirill Petrov Date: Tue, 6 Jul 2021 22:17:30 +0300 Subject: [PATCH 1/2] fix --- utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 5593ef443..1b7e874b4 100755 --- a/utils.py +++ b/utils.py @@ -117,12 +117,14 @@ def get_hw_parameters() -> Dict[str, Union[Dict[str, Any], float]]: 'nvidia-smi --query-gpu=name,memory.total,driver_version,pstate ' '--format=csv,noheader') gpu_info_arr = gpu_info.split(', ') + if len(gpu_info_arr) == 0: + return hw_params['GPU Nvidia'] = { 'Name': gpu_info_arr[0], 'Memory size': gpu_info_arr[1], 'Performance mode': gpu_info_arr[3] } - except (FileNotFoundError, json.JSONDecodeError): + except (FileNotFoundError, json.JSONDecodeError, IndexError): pass return hw_params From 9036722ed2d3fc9169d7500920edd3b589ab88c8 Mon Sep 17 00:00:00 2001 From: Kirill Petrov Date: Tue, 6 Jul 2021 22:18:58 +0300 Subject: [PATCH 2/2] add fix --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 1b7e874b4..8c1720dcb 100755 --- a/utils.py +++ b/utils.py @@ -118,7 +118,7 @@ def get_hw_parameters() -> Dict[str, Union[Dict[str, Any], float]]: '--format=csv,noheader') gpu_info_arr = gpu_info.split(', ') if len(gpu_info_arr) == 0: - return + return hw_params hw_params['GPU Nvidia'] = { 'Name': gpu_info_arr[0], 'Memory size': gpu_info_arr[1],