Merge pull request #2899 from mglae/master_amd_temp

cputemp: add amdgpu, prefer dedicated gpu
This commit is contained in:
Christian Hewitt 2018-08-20 15:40:15 +04:00 committed by GitHub
commit 4bece6e4db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,14 +19,11 @@ if [ $(basename "$0") = "gputemp" -o "$1" = "gpu" ]; then
for hwmon in /sys/class/hwmon/*; do
if [ -f "${hwmon}/name" ]; then
case $(cat ${hwmon}/name) in
nouveau|radeon)
[[ -f "${hwmon}/temp1_input" ]] && TEMP="$(cat ${hwmon}/temp1_input)" && break
[[ -f "${hwmon}/temp2_input" ]] && TEMP="$(cat ${hwmon}/temp2_input)" && break
;;
coretemp)
nouveau|radeon|amdgpu)
[[ -f "${hwmon}/temp1_input" ]] && TEMP="$(cat ${hwmon}/temp1_input)" && break
[[ -f "${hwmon}/temp2_input" ]] && TEMP="$(cat ${hwmon}/temp2_input)" && break
;;
# intel gpu is supported by cpu coretemp below
esac
fi
done