Skip to content

Commit

Permalink
Read from DRI_VENDOR
Browse files Browse the repository at this point in the history
  • Loading branch information
javizqh committed Oct 21, 2024
1 parent 5e0f322 commit 9eb3d90
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions manager/libs/process_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 9eb3d90

Please sign in to comment.