diff --git a/bitbots_misc/system_monitor/system_monitor/gpu.py b/bitbots_misc/system_monitor/system_monitor/gpu.py index 249ed38b6..68fa0f511 100644 --- a/bitbots_misc/system_monitor/system_monitor/gpu.py +++ b/bitbots_misc/system_monitor/system_monitor/gpu.py @@ -6,7 +6,9 @@ def collect_all(): return 0 gpu = pyamdgpuinfo.get_gpu(0) - vram_size = gpu.VRAM # change VRAM to the real attribute name + vram_size = gpu.memory_info["vram_size"] vram_usage = gpu.query_vram_usage() + load = gpu.query_load() + temperature = gpu.query_temperature() - return vram_usage / vram_size + return (vram_usage / vram_size, load, temperature) diff --git a/bitbots_misc/system_monitor/system_monitor/monitor.py b/bitbots_misc/system_monitor/system_monitor/monitor.py index 6fc7370d9..dc2bc1060 100755 --- a/bitbots_misc/system_monitor/system_monitor/monitor.py +++ b/bitbots_misc/system_monitor/system_monitor/monitor.py @@ -55,7 +55,7 @@ def main(): while rclpy.ok(): last_send_time = time.time() running_processes, cpu_usages, overall_usage_percentage = cpus.collect_all() if do_cpu else (-1, [], 0) - gpu_usage_percentage = gpu.collect_all() if do_gpu else 0 + gpu_usage_percentage, gpu_load, gpu_temperature = gpu.collect_all() if do_gpu else 0 memory_available, memory_used, memory_total = memory.collect_all() if do_memory else (-1, -1, -1) interfaces = network_interfaces.collect_all(node.get_clock()) if do_network else [] @@ -65,6 +65,8 @@ def main(): running_processes=running_processes, cpu_usage_overall=overall_usage_percentage, gpu_usage=gpu_usage_percentage, + gpu_load=gpu_load, + gpu_temperature=gpu_temperature, memory_available=memory_available, memory_used=memory_used, memory_total=memory_total, diff --git a/bitbots_msgs/msg/Workload.msg b/bitbots_msgs/msg/Workload.msg index 8516f45fd..bc256ef95 100644 --- a/bitbots_msgs/msg/Workload.msg +++ b/bitbots_msgs/msg/Workload.msg @@ -5,6 +5,8 @@ int32 running_processes float32 cpu_usage_overall float32 gpu_usage +float32 gpu_load +float32 gpu_temperature int64 memory_available int64 memory_used