From 9eb3d907e939a3767713a7f5d2ecd664a034552f Mon Sep 17 00:00:00 2001 From: Javier Izquierdo Hernandez Date: Mon, 21 Oct 2024 23:12:20 +0200 Subject: [PATCH] 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():