From 9eb3d907e939a3767713a7f5d2ecd664a034552f Mon Sep 17 00:00:00 2001 From: Javier Izquierdo Hernandez Date: Mon, 21 Oct 2024 23:12:20 +0200 Subject: [PATCH 1/2] Read from DRI_VENDOR --- manager/libs/process_utils.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/manager/libs/process_utils.py b/manager/libs/process_utils.py index 669cf7b..493fa2f 100644 --- a/manager/libs/process_utils.py +++ b/manager/libs/process_utils.py @@ -130,23 +130,11 @@ def wait_for_process_to_start(process_name, timeout=60): def check_gpu_acceleration(): try: - # Verifica si /dev/dri existe - if not os.path.exists("/dev/dri"): - LogManager.logger.error( - "/dev/dri does not exist. No direct GPU access.") - return False - - # Obtiene la salida de glxinfo - result = subprocess.check_output( - "glxinfo | grep direct", shell=True).decode('utf-8') - print(result) - - # Verifica si la aceleración directa está habilitada - return "direct rendering: Yes" in result - + vendor_name = os.environ['DRI_VENDOR'] + return vendor_name.upper() except Exception as e: print(f"Error: {e}") - return False + return "OFF" def get_ros_version(): From 47f6f6c5f8c33c729edfe0477477a2e1309a54c5 Mon Sep 17 00:00:00 2001 From: Javier Izquierdo Hernandez Date: Tue, 22 Oct 2024 14:07:14 +0200 Subject: [PATCH 2/2] Trying to fix non gpu status --- manager/libs/process_utils.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/manager/libs/process_utils.py b/manager/libs/process_utils.py index 493fa2f..df4b0fd 100644 --- a/manager/libs/process_utils.py +++ b/manager/libs/process_utils.py @@ -130,6 +130,20 @@ def wait_for_process_to_start(process_name, timeout=60): def check_gpu_acceleration(): try: + # Verifica si /dev/dri existe + if not os.path.exists("/dev/dri"): + LogManager.logger.error( + "/dev/dri does not exist. No direct GPU access.") + return "OFF" + + # # Obtiene la salida de glxinfo + # result = subprocess.check_output( + # "glxinfo | grep direct", shell=True).decode('utf-8') + # print(result) + + # # Verifica si la aceleración directa está habilitada + # return "direct rendering: Yes" in result + vendor_name = os.environ['DRI_VENDOR'] return vendor_name.upper() except Exception as e: