Skip to content

Instantly share code, notes, and snippets.

@nijave
Last active April 7, 2024 10:27
Show Gist options
  • Save nijave/53eb41a4aa79f754f1ba6fdeaa32c0dd to your computer and use it in GitHub Desktop.
Save nijave/53eb41a4aa79f754f1ba6fdeaa32c0dd to your computer and use it in GitHub Desktop.
Setup sensors for Gigabyte X470 Gaming 7 w/ Fedora
#!/bin/sh
# The chip info can be found via sensors-detect in lm_sensors
# Driver `to-be-written':
# * ISA bus, address 0xa40
# Chip `ITE IT8686E Super IO Sensors' (confidence: 9)
# Driver `it87':
# * ISA bus, address 0xa60
# Chip `ITE IT8792E Super IO Sensors' (confidence: 9)
# Driver `k10temp' (autoloaded):
# * Chip `AMD Family 17h thermal sensors' (confidence: 9)
# Not sure what the difference between the 0xa40 and 0xa60 chips are
# besides the 0xa40 seeming to have the right values and 60 doesn't
# from https://fossies.org/linux/lm-sensors/configs/Gigabyte/X470-AORUS-ULTRA-GAMING.conf
cat <<EOF >> /etc/sensors.d/gigabyte-x470.conf
chip "it8628-isa-0a40"
label temp1 "System 1"
label temp2 "Chipset"
label temp3 "CPU Socket"
label temp4 "PCIEX16"
label temp5 "VRM MOS"
label temp6 "VSOC MOS"
label in0 "CPU Vcore"
label in1 "+3.3V"
label in2 "+12V"
label in3 "+5V"
label in4 "CPU Vcore SOC"
label in5 "CPU Vddp"
label in6 "DRAM A/B"
# label in7 "3VSB"
# label in8 "Battery"
label fan1 "CPU_FAN"
label fan2 "SYS_FAN1"
label fan3 "SYS_FAN2"
label fan4 "SYS_FAN3"
label fan5 "CPU_OPT"
# compute temp3 @+0.5,@+0.5
compute in1 @*1.65,@*1.65
compute in2 @*6,@*6
compute in3 @*2.5,@*2.5
set in0_min 0.35
set in0_max 1.45
set in1_min 3.3 * 0.97
set in1_max 3.3 * 1.03
set in2_min 12 * 0.97
set in2_max 12 * 1.03
set in3_min 5 * 0.97
set in3_max 5 * 1.03
set in4_min 0.9
set in4_max 1.26
set in5_min 0.9 * 0.95
set in5_max 0.9 * 1.05
set in6_min 1.1
set in6_max 1.6
EOF
# I haven't paid much attention but this is apparently marginally unsafe
# as it allows multiple programs to simultaneously access the same registers/hardware
if ! grep -q acpi_enforce_resources=lax /etc/default/grub; then
grubby --args=acpi_enforce_resources=lax --update-kernel ALL
fi
# 8628 comes from advice for x570 version
# https://forum.level1techs.com/t/configuring-lm-sensors-on-x570-aorus-master-to-get-cpu-temps-fans-etc/166170/5
echo it87 > /etc/modules-load.d/it87.conf
echo "options it87 force_id=0x8628" > /etc/modprobe.d/it87.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment