Skip to content

Commit

Permalink
Merge pull request #168 from JdeRobot/add-vendor-name
Browse files Browse the repository at this point in the history
Use DRI_VENDOR for gpu introspection
  • Loading branch information
javizqh authored Oct 25, 2024
2 parents ab8b725 + 47f6f6c commit 0fbb7b6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions manager/libs/process_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,21 @@ def check_gpu_acceleration():
if not os.path.exists("/dev/dri"):
LogManager.logger.error(
"/dev/dri does not exist. No direct GPU access.")
return False
return "OFF"

# Obtiene la salida de glxinfo
result = subprocess.check_output(
"glxinfo | grep direct", shell=True).decode('utf-8')
print(result)
# # 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
# # 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 0fbb7b6

Please sign in to comment.