Skip to content

Instantly share code, notes, and snippets.

@NooNameR
Created June 7, 2025 20:59
Show Gist options
  • Select an option

  • Save NooNameR/1a34b5e2d62977dc7a6413413157b86a to your computer and use it in GitHub Desktop.

Select an option

Save NooNameR/1a34b5e2d62977dc7a6413413157b86a to your computer and use it in GitHub Desktop.
#!/bin/bash
# From intel GPU top
DRM=/sys/class/drm/card1
# cat /sys/class/hwmon/*/name to find a right one
HWMON=/sys/class/hwmon/hwmon4
while :
do
POWER1=$(cat $HWMON/energy1_input)
sleep 0.25
POWER2=$(cat $HWMON/energy1_input)
POWER=$((($POWER2 - $POWER1) / 252525))
clear
echo "============================="
echo " "
echo "Power Usage: $POWER Watts"
echo "Voltage: $(cat $HWMON/in0_input) mV"
echo "RPS ACT Freq: $(cat $DRM/gt/gt0/rps_act_freq_mhz) MHz"
echo "Power Limit: $(($(cat $HWMON/power1_max) / 1000000)) Watts"
echo "Is Throttling: $(cat $DRM/gt/gt0/throttle_reason_status)"
echo " "
echo "============================="
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment