Skip to content

Commit 21e667e

Browse files
authored
Merge pull request #2035 from r3claimer/next
Show GPU temp if defined
2 parents f5754b3 + 5722d4a commit 21e667e

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

projects/ROCKNIX/packages/hardware/quirks/platforms/SM8250/005-thermal_path

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44

55
cat <<EOF >/storage/.config/profile.d/005-thermal_path
66
DEVICE_TEMP_SENSOR=("/sys/devices/virtual/thermal/thermal_zone10/temp")
7+
DEVICE_GPU_TEMP_SENSOR=("/sys/devices/virtual/thermal/thermal_zone15/temp")
78
EOF

projects/ROCKNIX/packages/hardware/quirks/profile.d/999-export

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export OS_VERSION \
2222
DEVICE_FUNC_KEYB_MODIFIER \
2323
DEVICE_HAS_FAN \
2424
DEVICE_GPU_OVERCLOCK \
25+
DEVICE_GPU_TEMP_SENSOR \
2526
DEVICE_HAS_HDMI \
2627
DEVICE_HAS_TOUCHSCREEN \
2728
DEVICE_HDMI_GPIO \

projects/ROCKNIX/packages/rocknix/sources/scripts/rocknix-info

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ case ${HW_ARCH} in
169169
esac
170170
if [ -n "$GPUCUR" ]; then
171171
echo "GPU INFORMATION:"
172+
# GPU temperature
173+
# Unit: millidegree Celsius
174+
if [ -n "${DEVICE_GPU_TEMP_SENSOR}" ]; then
175+
GTEMPE=$(awk '{total += $1; count++} END {printf "%d", total/count/1000}' ${DEVICE_GPU_TEMP_SENSOR})
176+
if [ -n "${GTEMPE}" ]; then
177+
echo "GPU TEMPERATURE: ${GTEMPE}°"
178+
fi
179+
fi
172180
echo "GPU CURRENT FREQUENCY: ${GPUCUR} MHz"
173181
echo "GPU MAXIMUM FREQUENCY: ${GPUMAX} MHz"
174182
fi

0 commit comments

Comments
 (0)