From 819365a8d5d652808889b72d337c75a83b8920f6 Mon Sep 17 00:00:00 2001 From: bain Date: Sun, 1 Jan 2023 17:21:55 +0100 Subject: [PATCH] gpufix: create script --- scripts/gpufix/script.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 scripts/gpufix/script.sh diff --git a/scripts/gpufix/script.sh b/scripts/gpufix/script.sh new file mode 100644 index 0000000..068d22b --- /dev/null +++ b/scripts/gpufix/script.sh @@ -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