Forked from dataslayermedia/real-time-temperature-output-coral-ai-pcie-accelerators.sh
Last active
November 15, 2024 13:00
-
-
Save siberex/22b37f8d184e3621399f64f3a13ae3a5 to your computer and use it in GitHub Desktop.
real-time-temperature-output-coral-ai-pcie-accelerators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Main loop to continuously monitor the temperature | |
while true; do | |
clear | |
echo "Monitoring Coral PCIe Accelerators Temperature" | |
# Dynamically find all apex devices and read their temperatures | |
for device_path in /sys/class/apex/apex_*; do | |
if [ -f "$device_path/temp" ]; then | |
device_name=$(basename "$device_path") | |
temp_milli_c=$(cat "$device_path/temp") | |
temp_c=$(echo "scale=1; $temp_milli_c / 1000" | bc) | |
echo "$device_name: $temp_c °C" | |
else | |
echo "$device_name: Temperature readout not available" | |
fi | |
done | |
# Wait for a second before the next update | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment