- Joined
- Apr 4, 2023
- Messages
- 1
- Reaction score
- 0
something to play a sound/execute a command/start or stop a program when gpu temperature sensor reads 70 degrees celcius and stop it when it reads <70
#!/bin/bash
# Set the temperature threshold
TEMP_THRESHOLD=70
# Loop indefinitely
while true; do
# Get the current GPU temperature
TEMP=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader)
# Check if the temperature is above the threshold
if [[ $TEMP -ge $TEMP_THRESHOLD ]]; then
# Play a sound
paplay /usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga
# Execute a command or start a program
# For example, start a stress test using the FurMark benchmark
/path/to/FurMark-1.24.0.0/FurMark.exe /run /nogui /max_gpu_temp 80 /no_score_box
else
# Stop the program
# For example, stop the FurMark benchmark
killall FurMark.exe
fi
# Sleep for 1 minute before checking the temperature again
sleep 60
done
Tools like HWMonitor, Open Hardware Monitor, or GPU-Z provide real-time monitoring of GPU temperature. These often have built-in alerting features that can play sounds, send notifications, or execute scripts when temperatures reach specific thresholds.something to play a sound/execute a command/start or stop a program when gpu temperature sensor reads 70 degrees celcius and stop it when it reads <70
something to play a sound/execute a command/start or stop a program when gpu temperature sensor reads 70 degrees celcius and stop it when it reads <70
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.