gpufix: create script

This commit is contained in:
bain 2023-01-01 17:21:55 +01:00
parent 05ff1b18f7
commit 819365a8d5

21
scripts/gpufix/script.sh Normal file
View file

@ -0,0 +1,21 @@
#!/bin/bash
# For some reason, the GTX1060 GPU in my system draws 5W more when
# nvtop is not open. This creates a tmux session with nvtop open
# on startup in an attempt to fix it.
set -euo pipefail
source "$HL_LIB"
_ch_001-install_deps() {
sudo apt-get install -y nvtop tmux;
}
_ch_002-install_crontab() {
echo "@reboot $USER tmux has-session -t gpumon || tmux new -d -s gpumon nvtop -d 200" | sudo tee /etc/cron.d/$USER-gpufix
}
_ch_003-run_immediately() {
tmux has-session -t gpumon || tmux new -d -s gpumon nvtop -d 200
}
_run_checkpoints